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.
Summary
<symbol> in <ClassRef>returnsfalsefor symbol-keyed static members,whereas Node returns
true.Repro
Notes
Pre-existing, separate from the string-key class-ref fix (#6149 / PR #6159).
Symbol keys are intercepted early in
js_object_has_propertyby the symbolpath (
js_object_get_symbol_property), which doesn't resolve a class ref'sstatic symbol methods or runtime
C[sym] = …assignments. Both a declaredstatic [Sym]() {}and a runtime symbol assignment on a class ref are missed.