mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-01 07:33:12 +08:00
Object.freeze of a fresh record or array literal now sets the native frozen bit instead of compiling to the literal, so an untyped reference to the value sees it frozen: Object.isFrozen answers true and strict-mode writes throw Node's TypeErrors. Untyped property writes in sloppy-mode code (IrModule.sloppyDynWrites, decided per write by isStrictCode) call scr_dyn_key_set_sloppy and its computed form, which drop exactly the TypeError a refused assignment raises (a read-only or frozen property, a non-extensible object, a frozen array element) while a setter's exception still propagates. Computed-write dispatch helpers are shared only by writes of the same mode. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>