You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Per-evaluation class: #private access inside a generator method skips the evaluation-brand check #11185
For a class expression evaluated more than once (a per-evaluation class), a private access inside a generator method doesn't enforce the per-evaluation brand. Calling evaluation A's generator method on an instance of evaluation B reads B's private field, where the spec requires a TypeError. Non-generator methods reject the call correctly. This applies to string-keyed and [Symbol.iterator] generator methods alike.
Perry origin/mainc7d0963 (perry-dev, PERRY_NO_AUTO_OPTIMIZE=1, Linux x86_64): gen cross 9 / method cross threw TypeError
Likely cause
js_private_guard compares the receiver's evaluation brand with the brand of the lexical this (brand_owner), or with the PRIVATE_LEXICAL_BRAND_STACK top. A generator body runs later, inside the next closure, so neither the method's lexical class evaluation nor its receiver-independent brand is available there. The guard then compares the receiver with itself and passes. The generator needs to capture the evaluation brand at generator creation, or the brand-stack entry needs to be re-established around each next/return/throw.
Found while fixing #11170. Possibly adjacent to the per-evaluation class work in #11141 / #11142.
Activity