mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-04 08:04:37 +08:00
Add the primitive wrapper unit and its gated runtime feature
scr_js_wrapper.c constructs `new String/Number/Boolean` wrappers and ToObject of a primitive as ordinary dictionary-mode objects whose prototype is the unit's String, Number or Boolean prototype, with the [[PrimitiveValue]] slot on the object's source identity. The unit also answers instanceof, Object.prototype.toString, the util.types brands, the String method receiver, and the guard of the graph-walking consumers that cannot read the slot yet. A new `primitiveWrapper` runtime feature (any `wrapper.` libCall) links it, so a program that never creates a wrapper links no byte of the unit and the zero-cost gate keeps fully typed programs clean. The `wrapper.*` signatures, symbols and dispatch case are registered here; no frontend emits them yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
686c34bd25
commit
fd7be9993d
@@ -68,6 +68,7 @@ export interface EarlyExecutableNativeFeatures {
|
||||
nodeIsland?: boolean;
|
||||
moduleNamespace?: boolean;
|
||||
moduleNamespaceDyn?: boolean;
|
||||
primitiveWrapper?: boolean;
|
||||
zlib: boolean;
|
||||
brotli?: boolean;
|
||||
assert: boolean;
|
||||
|
||||
Reference in New Issue
Block a user