class A { #x = 1; static has(o) { return #x in o } }
A.has(new A()) // node: true perry: false
Also false for #method brands and for subclass instances.
Per ES §13.10.2, #x in o is true when o has the private field installed — which new A() does. Perry answers false, so downleveled TypeScript/Babel brand checks silently take the wrong branch: code that asks "is this one of mine?" concludes no, and falls through to whatever it does for foreign objects.
Silent wrong answer, no error — the failure mode is a wrong code path rather than a crash.
Found by a differential stress-test of claude-code under perry.
Also false for
#methodbrands and for subclass instances.Per ES §13.10.2,
#x in ois true whenohas the private field installed — whichnew A()does. Perry answersfalse, so downleveled TypeScript/Babel brand checks silently take the wrong branch: code that asks "is this one of mine?" concludes no, and falls through to whatever it does for foreign objects.Silent wrong answer, no error — the failure mode is a wrong code path rather than a crash.
Found by a differential stress-test of claude-code under perry.