Files
scriptc/packages/compiler/src
Malte UblandClaude Opus 5.5 9558fcddf3 Read Number.prototype and Boolean.prototype as prototype objects
A JavaScript source reading Number.prototype got undefined: the checker
types it with the wrapper interface, the type mapper maps that interface to
f64, and nothing built a prototype object.

The read now lowers, in JavaScript sources only, to dyn.builtinPrototype,
served by a new gated unit that builds the two prototype objects the way
the language defines them: an ordinary object on Object.prototype carrying
the kind's methods as non-enumerable, writable, configurable data
properties, answered from one box per thread so repeated reads are the same
object. A method runs on the prototype's primitive (+0 / false), which is
its [[PrimitiveValue]] in Node.

Two follow-on gaps the read exposed are fixed with it: narrowing no longer
extracts a scalar from a prototype value, and a call through the prototype
no longer takes the dyn.toString/dyn.valueOf/primitive-method
specializations, which assume a primitive receiver.

The methods are not generic: a receiver that is neither the kind's
primitive nor the prototype object — the wrapper around +0 / false, which
is its [[PrimitiveValue]] — is Node's TypeError, so a copied
`Number.prototype.toString` called on a plain object throws instead of
answering 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 05:38:57 -07:00
..
2026-10-27 23:02:33 -05:00
…
2026-10-25 10:43:36 -05:00
…
2026-10-25 22:34:40 -05:00
2026-10-25 22:34:40 -05:00