mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-06 08:23:19 +08:00
A frozen class instance kept its symbol-keyed fields writable through
typed references, and Object.isFrozen, isSealed and isExtensible reported
it unfrozen, because the field write checks and the instance's checked
view covered its string-keyed fields only. This held for Object.freeze
through an untyped value and for a typed Object.freeze alike.
- Writes to a symbol-keyed field of a hierarchy with an integrity word are
checked like other field writes, and throw Node's TypeError naming the
symbol ("Cannot assign to read only property 'Symbol(tag)' ...").
- The checked view applies the instance's integrity state to its
symbol-keyed properties too, and the commit of an untyped freeze, seal
or preventExtensions counts them.
- The commit removes a symbol-keyed field's entry from the property bag
whatever its attributes (scr_dyn_obj_delete_symbol_field), as it does
for string-keyed fields, so a sealed view no longer leaves the field's
old value in the bag.
Corpus 7407 covers freeze and seal of symbol-keyed fields through unknown
and through typed calls, on a class and a subclass, and matches Node.