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
perry: Object.create(proto) result is not instanceof the prototype's class (class-id chain not linked) #1805
Object.create(proto, descriptors?) produces an object that is not instanceof the class whose prototype it was given, even though property
reads and prototype-getter dispatch through the chain work correctly.
Per #809, Object.create(proto) wires the prototype by allocating a synthetic class_id mapped into CLASS_PROTOTYPE_OBJECTS and stamping the new object
with it (so missing-prop lookups walk proto). But instanceof matches on the
class-id chain, and a synthetic id isn't linked to the original class's id, so js_instanceof_dynamic reports false. The property/getter chain works (it walks
the prototype object) while instanceof (which keys off class-id ancestry) does
not.
Why it matters
effect's SchemaAST.annotations clones AST nodes via Object.create(Object.getPrototypeOf(ast), Object.getOwnPropertyDescriptors(ast)).
A possible contributor to the remaining _tag-of-undefined Schema-init blocker
(#1758) if any downstream path branches on instanceof of a cloned AST node —
though effect's primary dispatch is _tag-based, so this may be orthogonal.
Filing as a standalone, minimal, verified gap.
Found while landing #1804 (Object.getOwnPropertyDescriptors). Refs #1758, #809.
Activity
fix(runtime): link Object.create synthetic class_id to original class…