Skip to content

<symbol> in <ClassRef> misses static symbol members #6160

Description

@proggeramlug

Summary

<symbol> in <ClassRef> returns false for symbol-keyed static members,
whereas Node returns true.

Repro

class D { static [Symbol.hasInstance]() { return false; } }
console.log(Symbol.hasInstance in D);   // node: true   perry: false

class K {}
const s = Symbol.for("t");
(K as any)[s] = 1;
console.log(s in K);                    // node: true   perry: false

Notes

Pre-existing, separate from the string-key class-ref fix (#6149 / PR #6159).
Symbol keys are intercepted early in js_object_has_property by the symbol
path (js_object_get_symbol_property), which doesn't resolve a class ref's
static symbol methods or runtime C[sym] = … assignments. Both a declared
static [Sym]() {} and a runtime symbol assignment on a class ref are missed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions