@scriptc/compiler 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ambient/scriptc-node-fallback.d.ts +12 -9
- package/ambient/scriptc.d.ts +2 -2
- package/dist/backend/cc.d.ts +2 -2
- package/dist/backend/emission/emit-async.js +1 -1
- package/dist/backend/emission/emit-exprs.js +97 -52
- package/dist/backend/emission/emit-exprs.js.map +1 -1
- package/dist/backend/emission/emit-island.js +1 -1
- package/dist/backend/emission/emit-shapes.js +1 -1
- package/dist/backend/emission/emit-walkers.d.ts +14 -14
- package/dist/backend/emission/emit-walkers.js +44 -44
- package/dist/backend/emission/emit-walkers.js.map +1 -1
- package/dist/backend/emission/emitter.d.ts +3 -3
- package/dist/backend/emission/emitter.js +8 -8
- package/dist/backend/emission/may-throw.js +1 -1
- package/dist/backend/llvm/dyn.d.ts +10 -10
- package/dist/backend/llvm/dyn.js +26 -26
- package/dist/backend/llvm/dyn.js.map +1 -1
- package/dist/backend/llvm/emitter.js +97 -43
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/backend/llvm/shapes.js +1 -1
- package/dist/backend/llvm/walkers.js +2 -2
- package/dist/backend/llvm/walkers.js.map +1 -1
- package/dist/diagnostics/diagnostic.d.ts +1 -1
- package/dist/diagnostics/diagnostic.js +4 -3
- package/dist/diagnostics/diagnostic.js.map +1 -1
- package/dist/frontend/lowering/lib-boundary.js +5 -5
- package/dist/frontend/lowering/lib-boundary.js.map +1 -1
- package/dist/frontend/lowering/lower-assert.js +12 -12
- package/dist/frontend/lowering/lower-assert.js.map +1 -1
- package/dist/frontend/lowering/lower-builtins.d.ts +7 -7
- package/dist/frontend/lowering/lower-builtins.js +92 -31
- package/dist/frontend/lowering/lower-builtins.js.map +1 -1
- package/dist/frontend/lowering/lower-calls.d.ts +4 -4
- package/dist/frontend/lowering/lower-calls.js +66 -66
- package/dist/frontend/lowering/lower-calls.js.map +1 -1
- package/dist/frontend/lowering/lower-classes.js +31 -5
- package/dist/frontend/lowering/lower-classes.js.map +1 -1
- package/dist/frontend/lowering/lower-containers.d.ts +5 -5
- package/dist/frontend/lowering/lower-containers.js +19 -19
- package/dist/frontend/lowering/lower-containers.js.map +1 -1
- package/dist/frontend/lowering/lower-emitter.js +2 -2
- package/dist/frontend/lowering/lower-emitter.js.map +1 -1
- package/dist/frontend/lowering/lower-exprs.d.ts +7 -7
- package/dist/frontend/lowering/lower-exprs.js +158 -112
- package/dist/frontend/lowering/lower-exprs.js.map +1 -1
- package/dist/frontend/lowering/lower-inspect.js +5 -5
- package/dist/frontend/lowering/lower-inspect.js.map +1 -1
- package/dist/frontend/lowering/lower-island.js +12 -3
- package/dist/frontend/lowering/lower-island.js.map +1 -1
- package/dist/frontend/lowering/lower-modules.js +16 -16
- package/dist/frontend/lowering/lower-modules.js.map +1 -1
- package/dist/frontend/lowering/lower-namespaces.d.ts +11 -1
- package/dist/frontend/lowering/lower-namespaces.js +41 -6
- package/dist/frontend/lowering/lower-namespaces.js.map +1 -1
- package/dist/frontend/lowering/lower-server.js +11 -11
- package/dist/frontend/lowering/lower-server.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.d.ts +1 -1
- package/dist/frontend/lowering/lower-stmts.js +191 -30
- package/dist/frontend/lowering/lower-stmts.js.map +1 -1
- package/dist/frontend/lowering/lower-stream.js +66 -22
- package/dist/frontend/lowering/lower-stream.js.map +1 -1
- package/dist/frontend/lowering/lowerer.d.ts +10 -10
- package/dist/frontend/lowering/lowerer.js +51 -37
- package/dist/frontend/lowering/lowerer.js.map +1 -1
- package/dist/frontend/lowering/surfaces.js +2 -2
- package/dist/frontend/lowering/surfaces.js.map +1 -1
- package/dist/frontend/program.js +1 -1
- package/dist/frontend/shared.js +7 -7
- package/dist/frontend/shared.js.map +1 -1
- package/dist/frontend/types.d.ts +2 -2
- package/dist/frontend/types.js +15 -15
- package/dist/frontend/types.js.map +1 -1
- package/dist/index.js +38 -7
- package/dist/index.js.map +1 -1
- package/dist/ir/nodes.d.ts +110 -98
- package/dist/ir/nodes.js +48 -21
- package/dist/ir/nodes.js.map +1 -1
- package/dist/ir/validate.js +44 -34
- package/dist/ir/validate.js.map +1 -1
- package/dist/library/int-infer.js +13 -0
- package/dist/library/int-infer.js.map +1 -1
- package/dist/library/profile.d.ts +8 -6
- package/dist/library/profile.js.map +1 -1
- package/dist/library/sidecar-validate.js +1 -1
- package/dist/library/sidecar-validate.js.map +1 -1
- package/dist/library/sidecar.d.ts +1 -1
- package/dist/library/sidecar.js +20 -7
- package/dist/library/sidecar.js.map +1 -1
- package/package.json +2 -2
- package/surface-manifest.json +4 -4
package/dist/ir/nodes.d.ts
CHANGED
|
@@ -232,7 +232,7 @@ export type IrType = {
|
|
|
232
232
|
/** Heap, refcounted closure. `rest` marks a VARIADIC JS function (a
|
|
233
233
|
* `...args` rest parameter, or a zero-param function body reading
|
|
234
234
|
* `arguments` — test/common's mustCall wrapper): the lifted function
|
|
235
|
-
* takes one extra trailing `ScrDyn *` param — a
|
|
235
|
+
* takes one extra trailing `ScrDyn *` param — a dyn ARRAY carrying the
|
|
236
236
|
* call's arguments from index params.length on — which the dyn call
|
|
237
237
|
* thunk builds per call. `params` stays the DECLARED (non-rest) list
|
|
238
238
|
* (fn.length semantics). Rest-marked values are only ever CALLED
|
|
@@ -286,10 +286,10 @@ export type IrType = {
|
|
|
286
286
|
}
|
|
287
287
|
/** A dynamic value — the type of `unknown` (JSON.parse results and
|
|
288
288
|
* unknown-typed locals/params/returns). Runtime representation is a
|
|
289
|
-
* refcounted JSON
|
|
289
|
+
* refcounted JSON dyn tree (ScrDyn). Deliberately NARROW: a dyn value can
|
|
290
290
|
* be stored in locals/globals, passed as a param/call arg, returned,
|
|
291
291
|
* validated with a checked cast (`dynCheck`), CALLED (`dynCall` — the
|
|
292
|
-
*
|
|
292
|
+
* dyn's function kind, boxed closures with per-call argument checks),
|
|
293
293
|
* and captured by closures (an untraced obj-box: cycles through dyn are
|
|
294
294
|
* never collected, SEMANTICS.md); it can NOT ride record/class fields,
|
|
295
295
|
* array elements, union arms, or the exception cell, and every other
|
|
@@ -756,7 +756,7 @@ export interface IrRecordShape {
|
|
|
756
756
|
* order of the first ts.Type interned to this shape) — metadata, NOT
|
|
757
757
|
* part of the interned identity: a later structurally-equal type with a
|
|
758
758
|
* different member order shares the shape and the first one's order.
|
|
759
|
-
* JSON.stringify, Object.keys/values/entries, record→
|
|
759
|
+
* JSON.stringify, Object.keys/values/entries, record→dyn conversion,
|
|
760
760
|
* and util.inspect all emit this order; JS's per-object insertion order
|
|
761
761
|
* matches it whenever objects are constructed in declaration order
|
|
762
762
|
* (SEMANTICS.md 36 documents the divergence when they are not).
|
|
@@ -1316,7 +1316,7 @@ export type IrLibFn = "island.eval"
|
|
|
1316
1316
|
* boundary, a conversion that cannot happen throws instead of lying.
|
|
1317
1317
|
* --dynamic only. */
|
|
1318
1318
|
| "island.castFail" | "json.parse"
|
|
1319
|
-
/** Keyed WRITE on a dyn
|
|
1319
|
+
/** Keyed WRITE on a dyn value — `h.onDone = cb` / `h["k"] = v` on a
|
|
1320
1320
|
* checked-dynamic object (args: receiver, key string, value — all
|
|
1321
1321
|
* borrowed; the runtime copies the key and retains the value in). An
|
|
1322
1322
|
* OBJ receiver sets the member (later writes win, insertion order
|
|
@@ -1328,27 +1328,33 @@ export type IrLibFn = "island.eval"
|
|
|
1328
1328
|
* SEMANTICS.md notes the sloppy divergence: loud, never silent). Void
|
|
1329
1329
|
* result; in the may-throw seed set. */
|
|
1330
1330
|
| "dyn.keySet"
|
|
1331
|
-
/** Destructuring pack over a dyn
|
|
1331
|
+
/** Destructuring pack over a dyn source — `const [a, b] = d`, a
|
|
1332
1332
|
* destructured dyn callback param (args: the source and the STATIC
|
|
1333
1333
|
* TypeError spelling, "" when the source has none — both borrowed;
|
|
1334
|
-
* result: a fresh
|
|
1334
|
+
* result: a fresh dyn array, +1). Iterable kinds collect like spread
|
|
1335
1335
|
* (arrays element-by-element, strings by code point, bytes by byte);
|
|
1336
1336
|
* every other kind throws V8's destructuring TypeError — the spelling
|
|
1337
1337
|
* verbatim when non-empty, else the runtime kind wording ("number 5 is
|
|
1338
1338
|
* not iterable (cannot read property Symbol(Symbol.iterator))"). In the
|
|
1339
1339
|
* may-throw seed set. */
|
|
1340
1340
|
| "dyn.iterPack"
|
|
1341
|
-
/**
|
|
1341
|
+
/** The for-of-over-dyn pack accessors — the emitted index loop drives
|
|
1342
|
+
* them over a dyn.iterPack result (ARR by construction). arrLen: the
|
|
1343
|
+
* ARR length as f64 (0 for non-ARR kinds; arg borrowed). arrAt: the
|
|
1344
|
+
* element at index (+1; the undefined singleton past the end). Neither
|
|
1345
|
+
* throws. */
|
|
1346
|
+
| "dyn.arrLen" | "dyn.arrAt"
|
|
1347
|
+
/** Object.defineProperties over dyn values (args: target, descriptors —
|
|
1342
1348
|
* both borrowed dyn; result: the target, +1 — JS's return value).
|
|
1343
1349
|
* Value descriptors become plain own properties on OBJ and FUNC targets
|
|
1344
|
-
* (writable/enumerable/configurable accepted and IGNORED —
|
|
1350
|
+
* (writable/enumerable/configurable accepted and IGNORED — dyn
|
|
1345
1351
|
* properties are plain data properties, SEMANTICS.md); get/set
|
|
1346
1352
|
* descriptors and non-object targets/descriptors throw catchably
|
|
1347
1353
|
* (Node's TypeError texts; accessors the loud unsupported Error). In
|
|
1348
1354
|
* the may-throw seed set. */
|
|
1349
1355
|
| "dyn.defineProps"
|
|
1350
1356
|
/** Bare `typeof v` on a dyn value AS A STRING (arg: the dyn value,
|
|
1351
|
-
* borrowed; result: an owned string) — the
|
|
1357
|
+
* borrowed; result: an owned string) — the dyn kind's JS answer:
|
|
1352
1358
|
* undefined→"undefined", null/object/array/bytes→"object" (JS's oldest
|
|
1353
1359
|
* wart preserved), boolean/number/string by kind, function→"function".
|
|
1354
1360
|
* Never throws. */
|
|
@@ -1479,8 +1485,8 @@ export type IrLibFn = "island.eval"
|
|
|
1479
1485
|
* unescaped — total like the component encoder. Borrow; result +1. */
|
|
1480
1486
|
| "str.encodeUri"
|
|
1481
1487
|
/** The WHATWG base64 globals (scr_string.c), Node-global since v16.
|
|
1482
|
-
* Arguments are borrowed
|
|
1483
|
-
* runtime over the
|
|
1488
|
+
* Arguments are borrowed dyn values — WebIDL ToString runs in the
|
|
1489
|
+
* runtime over the dyn kind (String(null) is "null": the html spec's
|
|
1484
1490
|
* coercion, which Node's atob(null) exercises). str.atob decodes
|
|
1485
1491
|
* forgiving-base64 (ASCII whitespace stripped, %4==0 strips up to two
|
|
1486
1492
|
* '=', %4==1 refuses, leftover bits discarded) into the latin1 code
|
|
@@ -1568,7 +1574,7 @@ export type IrLibFn = "island.eval"
|
|
|
1568
1574
|
* arm tolerated — @types/node's Dict), verified structurally by the
|
|
1569
1575
|
* frontend (lowerQuerystringParseCall); the emitters construct the
|
|
1570
1576
|
* record and hand its overflow map to scr_qs_parse_into with the two
|
|
1571
|
-
* union tags. qs.stringify takes (obj, sep, eq) with obj a
|
|
1577
|
+
* union tags. qs.stringify takes (obj, sep, eq) with obj a dyn value
|
|
1572
1578
|
* (the frontend dynFroms the typed record; JS-world dyn values pass
|
|
1573
1579
|
* through) — Node's encodeStringified rules run in the runtime, so
|
|
1574
1580
|
* arrays expand to repeated keys and null/undefined/nested objects are
|
|
@@ -1765,7 +1771,7 @@ export type IrLibFn = "island.eval"
|
|
|
1765
1771
|
* blocking divergence); its per-union adapter builds the
|
|
1766
1772
|
* `Error | null` first argument. */
|
|
1767
1773
|
| "dgram.createSocket" | "dgram.bind" | "dgram.bindCb" | "dgram.connect" | "dgram.connectCb" | "dgram.sendStr" | "dgram.sendBytes"
|
|
1768
|
-
/** The send argument-validation ladder over
|
|
1774
|
+
/** The send argument-validation ladder over dyn arguments (Node's
|
|
1769
1775
|
* signature shuffle: slice bounds, list/type contracts, port/address
|
|
1770
1776
|
* validation, connected-state errors) — a fully-validated unconnected
|
|
1771
1777
|
* single-payload send RUNS; callback/list/connected forms meet the
|
|
@@ -2085,12 +2091,12 @@ export type IrLibFn = "island.eval"
|
|
|
2085
2091
|
* always throws Node's ERR_INVALID_ARG_TYPE ("The \"string\" argument
|
|
2086
2092
|
* must be of type string. Received ..."). Borrowed dyn; may-throw. */
|
|
2087
2093
|
| "buffer.newStringFail"
|
|
2088
|
-
/** fs._toUnixTimestamp(time) over a
|
|
2094
|
+
/** fs._toUnixTimestamp(time) over a dyn value: numeric strings and
|
|
2089
2095
|
* finite numbers coerce (negatives answer now/1000, Node's shape);
|
|
2090
2096
|
* everything else throws Node's ERR_INVALID_ARG_TYPE. May-throw. */
|
|
2091
2097
|
| "fs.toUnixTimestamp"
|
|
2092
2098
|
/** The fs argument-validation ladders (checked-dynamic lane): each Chk
|
|
2093
|
-
* replicates its API's Node-order validation over
|
|
2099
|
+
* replicates its API's Node-order validation over dyn values (Node's
|
|
2094
2100
|
* exact typed errors — ERR_INVALID_ARG_TYPE/VALUE, ERR_OUT_OF_RANGE),
|
|
2095
2101
|
* and a full pass meets the trailing compiler-rendered SC2020 fence
|
|
2096
2102
|
* string — so the ALWAYS-THROW forms take the error.nodeThrow
|
|
@@ -2101,7 +2107,7 @@ export type IrLibFn = "island.eval"
|
|
|
2101
2107
|
| "fs.existsChk" | "fs.mkdtempChk" | "fs.mkdtempSyncChk" | "fs.readFileChk" | "fs.opendirChk" | "fs.watchFileChk" | "fs.lchmodChk" | "fs.lchmodSyncChk" | "fsp.lchmodChk" | "fs.readChk" | "fs.streamOptsChk"
|
|
2102
2108
|
/** The compiler-resolved ERR_INVALID_ARG_TYPE throw with a RUNTIME-
|
|
2103
2109
|
* rendered Received tail: args [argname, "of type ..." clause, the
|
|
2104
|
-
* offending
|
|
2110
|
+
* offending dyn value]. ALWAYS THROWS; polymorphic result (the
|
|
2105
2111
|
* error.nodeThrow pattern). May-throw seed. */
|
|
2106
2112
|
| "error.argTypeThrow"
|
|
2107
2113
|
/** The property flavor of argTypeThrow ("The \"options.x\" property
|
|
@@ -2109,7 +2115,7 @@ export type IrLibFn = "island.eval"
|
|
|
2109
2115
|
* THROWS; polymorphic result. May-throw seed. */
|
|
2110
2116
|
| "error.propTypeThrow"
|
|
2111
2117
|
/** The checked-dynamic max-listeners ladders: setMaxChk is the
|
|
2112
|
-
* instance form over a
|
|
2118
|
+
* instance form over a dyn n (non-numbers ERR_INVALID_ARG_TYPE,
|
|
2113
2119
|
* negatives/NaN ERR_OUT_OF_RANGE; +1 receiver back — chaining);
|
|
2114
2120
|
* setDefaultMaxChk is the static/property form, its second argument
|
|
2115
2121
|
* naming the message slot ("setMaxListeners" for the static call,
|
|
@@ -2157,7 +2163,7 @@ export type IrLibFn = "island.eval"
|
|
|
2157
2163
|
/** The ambient receiver — JS `this` in a plain (non-method) function
|
|
2158
2164
|
* body: the innermost binding the current firing/dispatch window
|
|
2159
2165
|
* pushed (Node's listener receiver, a dyn OBJ method's object, an
|
|
2160
|
-
* apply/call thisArg), or the undefined
|
|
2166
|
+
* apply/call thisArg), or the undefined dyn singleton with none bound
|
|
2161
2167
|
* (the strict-mode plain-call answer, the old constant). Zero args →
|
|
2162
2168
|
* dyn (+1). Never throws. */
|
|
2163
2169
|
| "dyn.this"
|
|
@@ -2347,7 +2353,7 @@ export type IrLibFn = "island.eval"
|
|
|
2347
2353
|
* the replaced expression's own (never materialized — the
|
|
2348
2354
|
* global.undefRead pattern). May-throw seed. */
|
|
2349
2355
|
| "error.nodeThrow"
|
|
2350
|
-
/** JS ToString over a
|
|
2356
|
+
/** JS ToString over a dyn value WITH the object protocol (a user
|
|
2351
2357
|
* toString/valueOf member is CALLED and its throw propagates;
|
|
2352
2358
|
* exhaustion throws "Cannot convert object to primitive value"; units
|
|
2353
2359
|
* render "null"/"undefined") — the WHATWG USVString conversions
|
|
@@ -2366,43 +2372,43 @@ export type IrLibFn = "island.eval"
|
|
|
2366
2372
|
* `C.name` on the class name itself folds to a strLit instead. */
|
|
2367
2373
|
| "class.name" | "error.ctor" | "error.toString"
|
|
2368
2374
|
/** `new DOMException(message?, nameOrOptions?)` (scr_error.c): both args
|
|
2369
|
-
* are borrowed
|
|
2375
|
+
* are borrowed dyn values (the lowering passes the dyn undefined for an
|
|
2370
2376
|
* absent argument, so WebIDL's optionality lives in one place). The
|
|
2371
2377
|
* runtime ToStrings the message ("" for absent/undefined), resolves the
|
|
2372
2378
|
* name — absent/undefined → "Error", a non-null object → ToString of its
|
|
2373
2379
|
* `name` member plus the `cause` own-property record, anything else →
|
|
2374
2380
|
* ToString — and stamps the legacy code from the WebIDL name table (0
|
|
2375
|
-
* off-table). Result is an owned (+1) %DOMException. Never throws (
|
|
2381
|
+
* off-table). Result is an owned (+1) %DOMException. Never throws (dyn
|
|
2376
2382
|
* ToString is total). */
|
|
2377
2383
|
| "error.newDom"
|
|
2378
2384
|
/** DOMException's own read surface (scr_error.c; %DOMException receivers
|
|
2379
2385
|
* only — borrowed). domCode: the legacy numeric code. domHasCause: the
|
|
2380
2386
|
* options form's own-property record (`'cause' in e`). domCause: the
|
|
2381
|
-
* cause value, +1 (the
|
|
2387
|
+
* cause value, +1 (the dyn undefined when absent — matching Node's
|
|
2382
2388
|
* undefined read). None throws. */
|
|
2383
2389
|
| "error.domCode" | "error.domHasCause" | "error.domCause"
|
|
2384
2390
|
/** structuredClone of a %DOMException receiver (scr_error.c): WebIDL
|
|
2385
2391
|
* serialization — name/message copy, the legacy code re-derives, cause
|
|
2386
2392
|
* does not serialize. args are the borrowed receiver and the borrowed
|
|
2387
|
-
* options
|
|
2393
|
+
* options dyn value (the dyn undefined when absent — the shared
|
|
2388
2394
|
* validation throws Node's exact option errors; any non-empty transfer
|
|
2389
2395
|
* list throws DataCloneError, nothing static is transferable). Result
|
|
2390
2396
|
* +1 %DOMException. */
|
|
2391
2397
|
| "error.domClone"
|
|
2392
2398
|
/** `d instanceof TypeError` (and the other BUILTIN error classes) on a
|
|
2393
2399
|
* checked-dynamic value (scr_json.c): the from_error cache holds the
|
|
2394
|
-
*
|
|
2400
|
+
* dyn↔error identity edge, so the test resolves the runtime error and
|
|
2395
2401
|
* asks its vtable's stamped preorder interval — exact for every error
|
|
2396
|
-
* that crossed the boundary. A
|
|
2402
|
+
* that crossed the boundary. A dyn object that never came from an
|
|
2397
2403
|
* error (a hand-built {%error} literal) answers false: subclass
|
|
2398
2404
|
* identity is unknowable there (the root keeps dynTest's marker
|
|
2399
2405
|
* answer). args are the borrowed dyn and the SCR_ERR_* kind literal.
|
|
2400
2406
|
* Never throws. */
|
|
2401
2407
|
| "dyn.errInstanceof"
|
|
2402
2408
|
/** Object.keys/values/entries over a CHECKED-DYNAMIC receiver
|
|
2403
|
-
* (scr_json.c): the runtime walks the
|
|
2409
|
+
* (scr_json.c): the runtime walks the dyn node's own members in JS
|
|
2404
2410
|
* own-key order (array-index keys ascending first, then insertion
|
|
2405
|
-
* order) and answers a
|
|
2411
|
+
* order) and answers a dyn array (entries: an array of [key, value]
|
|
2406
2412
|
* pairs; values RETAIN the member nodes — reference semantics, like
|
|
2407
2413
|
* JS). Strings/arrays/bytes answer their index keys; other scalars an
|
|
2408
2414
|
* empty array; null/undefined throw Node's catchable TypeError
|
|
@@ -2410,7 +2416,7 @@ export type IrLibFn = "island.eval"
|
|
|
2410
2416
|
| "dyn.objKeys" | "dyn.hasOwn" | "dyn.assign"
|
|
2411
2417
|
/** Variadic Object.assign over CHECKED-DYNAMIC targets (`Object.assign(
|
|
2412
2418
|
* {}, ...arr.map(f), tail)` — the option-table merge): the lowering
|
|
2413
|
-
* builds one fresh
|
|
2419
|
+
* builds one fresh dyn pack of sources (packPush retains a plain source
|
|
2414
2420
|
* in; packPushSpread flattens a spread source through the spread-call
|
|
2415
2421
|
* walk — V8's exact TypeError texts, the string arg spelling the spread
|
|
2416
2422
|
* expression for the nullish form), so every source evaluates and
|
|
@@ -2426,19 +2432,19 @@ export type IrLibFn = "island.eval"
|
|
|
2426
2432
|
* ("object null is not iterable (cannot read property
|
|
2427
2433
|
* Symbol(Symbol.iterator))"). The frontend picks by position. */
|
|
2428
2434
|
| "dyn.packPushSpreadIter" | "dyn.assignAll"
|
|
2429
|
-
/** `Object.create(null)` (scr_json.c): a fresh NULL-PROTOTYPE
|
|
2430
|
-
* dictionary. The
|
|
2435
|
+
/** `Object.create(null)` (scr_json.c): a fresh NULL-PROTOTYPE dyn
|
|
2436
|
+
* dictionary. The checked-dynamic tree's OBJ dispatch is already own-member-only —
|
|
2431
2437
|
* Node's null-proto answer — so the flag's whole job is the observations
|
|
2432
2438
|
* that SEE the prototype: inspect's "[Object: null prototype]" prefix
|
|
2433
2439
|
* and deepStrictEqual's prototype gate. Never throws. Static builds
|
|
2434
2440
|
* only; --dynamic routes Object.create through the engine instead. */
|
|
2435
2441
|
| "dyn.objCreateNullProto" | "dyn.objValues" | "dyn.objEntries"
|
|
2436
|
-
/** structuredClone over the
|
|
2442
|
+
/** structuredClone over the checked-dynamic tree (scr_json.c): the JSON-safe subset plus
|
|
2437
2443
|
* bytes (a fresh copy — a Buffer clones as a plain Uint8Array, like
|
|
2438
2444
|
* Node), deep. Functions and handle kinds throw the spec's catchable
|
|
2439
|
-
* DataCloneError; CYCLES throw the scriptc fence (the
|
|
2445
|
+
* DataCloneError; CYCLES throw the scriptc fence (the checked-dynamic tree cannot
|
|
2440
2446
|
* represent them — Node clones cycles; documented divergence). The
|
|
2441
|
-
* options
|
|
2447
|
+
* options dyn value validates with Node's exact errors (dictionary
|
|
2442
2448
|
* conversion, the transfer-sequence member; any non-empty transfer
|
|
2443
2449
|
* list throws DataCloneError). dyn.cloneMissing is the zero-argument
|
|
2444
2450
|
* call: always throws Node's TypeError [ERR_MISSING_ARGS] with Node's
|
|
@@ -2457,7 +2463,7 @@ export type IrLibFn = "island.eval"
|
|
|
2457
2463
|
/** structuredClone with a NON-EMPTY transfer array of static values:
|
|
2458
2464
|
* nothing static is transferable, so the call always throws Node's
|
|
2459
2465
|
* catchable DataCloneError ("Found invalid value in transferList.") —
|
|
2460
|
-
* lowered directly (the list's values need no
|
|
2466
|
+
* lowered directly (the list's values need no dyn representation to
|
|
2461
2467
|
* fail). */
|
|
2462
2468
|
| "dyn.cloneTransferFail"
|
|
2463
2469
|
/** node:events EventEmitter (scr_events_emitter.c, link-gated by
|
|
@@ -2611,10 +2617,10 @@ export type IrLibFn = "island.eval"
|
|
|
2611
2617
|
* (a, b, negated, deep, msg, hasMsg) — the whole quartet over
|
|
2612
2618
|
* checked-dynamic operands (both slots dyn; the frontend boxes a
|
|
2613
2619
|
* static side with dynFrom first): SameValue for the strict pair over
|
|
2614
|
-
* the
|
|
2615
|
-
*
|
|
2620
|
+
* the dyn kinds (boxed-closure identity for functions), the structural
|
|
2621
|
+
* dyn walk for the deep pair, with assertion_error.js's messages —
|
|
2616
2622
|
* scalar forms byte-exact, composites rendered compact:false/sorted
|
|
2617
|
-
* through the
|
|
2623
|
+
* through the checked-dynamic tree and diffed with the real myers line printer.
|
|
2618
2624
|
*
|
|
2619
2625
|
* The assert.throws(fn, {name/code/message}) shape check
|
|
2620
2626
|
* (expectedException over the static error surface): shapeBegin
|
|
@@ -2637,7 +2643,7 @@ export type IrLibFn = "island.eval"
|
|
|
2637
2643
|
* All arguments are borrowed. */
|
|
2638
2644
|
| "assert.ok" | "assert.eqF64" | "assert.eqStr" | "assert.eqBool" | "assert.eqSym" | "assert.eqDyn" | "assert.deepResult" | "assert.sameValue" | "assert.deqEnter" | "assert.deqLeave" | "assert.match" | "assert.throwsNone" | "assert.throwsMismatch" | "assert.throwsRegex" | "assert.shapeBegin" | "assert.shapeStr" | "assert.shapeRe" | "assert.shapeEnd" | "assert.regexErrTest" | "assert.unwantedRejection"
|
|
2639
2645
|
/** Node's expectsError over an error-INSTANCE expected (assert.throws/
|
|
2640
|
-
* rejects second argument): walk the expected
|
|
2646
|
+
* rejects second argument): walk the expected dyn error's keys (name,
|
|
2641
2647
|
* message, code — the %error marker skipped) and deep-compare each
|
|
2642
2648
|
* against the caught value's; a mismatch throws the deep-equal
|
|
2643
2649
|
* AssertionError (scr_assert.c). MAY THROW by design. */
|
|
@@ -2648,7 +2654,7 @@ export type IrLibFn = "island.eval"
|
|
|
2648
2654
|
* ladder + line splitting; insp.regex: /source/flags; insp.buffer:
|
|
2649
2655
|
* <Buffer aa ..>). insp.error renders the STACKLESS [Name: message]
|
|
2650
2656
|
* form with the code slot as its one property. insp.dyn walks the
|
|
2651
|
-
* checked-dynamic
|
|
2657
|
+
* checked-dynamic tree entirely in the runtime (its shape lives in the
|
|
2652
2658
|
* value); insp.dynS is format's %s twin (dyn strings pass verbatim).
|
|
2653
2659
|
* insp.jsval ([value, recurse, depth], --dynamic only) renders the
|
|
2654
2660
|
* island scalars and THROWS a catchable TypeError on composites (the
|
|
@@ -2656,7 +2662,7 @@ export type IrLibFn = "island.eval"
|
|
|
2656
2662
|
* engine from the compiler-synthesized per-type traversal helpers
|
|
2657
2663
|
* (%util.insp.N — the deepStrictEqual precedent). */
|
|
2658
2664
|
| "insp.f64"
|
|
2659
|
-
/** util.format %j over a checked-dynamic argument: the runtime
|
|
2665
|
+
/** util.format %j over a checked-dynamic argument: the runtime dyn
|
|
2660
2666
|
* walk (JS-exact stringify; root undefined/function prints
|
|
2661
2667
|
* "undefined"; a handle in the tree throws the loud fence). */
|
|
2662
2668
|
| "insp.jsonDyn" | "insp.str" | "insp.regex" | "insp.buffer" | "insp.error" | "insp.dyn" | "insp.dynS" | "insp.jsval" | "insp.begin" | "insp.entry" | "insp.key" | "insp.moreItems" | "insp.circCheck" | "insp.seenPush" | "insp.refWrap" | "insp.circular" | "insp.end"
|
|
@@ -2696,7 +2702,7 @@ export type IrLibFn = "island.eval"
|
|
|
2696
2702
|
/** node:diagnostics_channel (scr_dc.c, linked when any dc.* appears —
|
|
2697
2703
|
* the zlib gating precedent): a process-global name→channel registry;
|
|
2698
2704
|
* channel values are f64 handles (types.ts maps Channel to F64, the
|
|
2699
|
-
* readline.Interface pattern). Subscribers are
|
|
2705
|
+
* readline.Interface pattern). Subscribers are dyn function values —
|
|
2700
2706
|
* identity-compared by unsubscribe, called (message, name) by publish
|
|
2701
2707
|
* over a SNAPSHOT of the list (a subscriber unsubscribing itself
|
|
2702
2708
|
* mid-publish still lets its siblings fire, Node's behavior). dc.publish
|
|
@@ -2707,23 +2713,23 @@ export type IrLibFn = "island.eval"
|
|
|
2707
2713
|
| "dc.channel" | "dc.subscribe" | "dc.unsubscribe" | "dc.hasSubscribers" | "dc.publish" | "dc.chanSubscribe" | "dc.chanUnsubscribe" | "dc.chanHasSubscribers" | "dc.chanName"
|
|
2708
2714
|
/** TracingChannel (dc.tracingChannel): a registry entry of the five
|
|
2709
2715
|
* event channels, an f64 handle like Channel (types.ts). tcSubscribe/
|
|
2710
|
-
* tcUnsubscribe walk a
|
|
2716
|
+
* tcUnsubscribe walk a dyn handlers object's five event keys (truthy
|
|
2711
2717
|
* non-function slots throw the per-channel ERR_INVALID_ARG_TYPE);
|
|
2712
2718
|
* tcTraceSync/tcTraceCallback/tcTracePromise run Node's publish choreography in C over
|
|
2713
|
-
*
|
|
2719
|
+
* dyn values (fn, ctx, thisArg, args-array) with thisArg bound as the
|
|
2714
2720
|
* ambient receiver — the traced call's throw and any subscriber throw
|
|
2715
2721
|
* both propagate (MAY THROW). tcTraceCallback wraps args[position] in a
|
|
2716
2722
|
* native error/result + asyncStart/asyncEnd publisher and throws Node's
|
|
2717
2723
|
* TypeError when that slot is not callable. tracingChannelOf is the
|
|
2718
2724
|
* five-Channel collection form of the constructor. */
|
|
2719
|
-
/** setImmediate as a first-class
|
|
2725
|
+
/** setImmediate as a first-class dyn value (scr_async.c): a minted dyn
|
|
2720
2726
|
* callable scheduling args[0](args[1..]) on the immediate queue — the
|
|
2721
2727
|
* Node-suite traceCallback shape (`traceCallback(setImmediate, ...)`).
|
|
2722
2728
|
* Calling it validates the callback (the dyn call machinery); minting
|
|
2723
2729
|
* never throws. */
|
|
2724
2730
|
| "timers.setImmediateFnValue"
|
|
2725
2731
|
/** `new Promise(setImmediate)` (the Node-suite early-exit shape): a
|
|
2726
|
-
* fresh promise an immediate fulfills with the undefined
|
|
2732
|
+
* fresh promise an immediate fulfills with the undefined dyn value —
|
|
2727
2733
|
* the executor IS setImmediate, so resolve rides the immediate queue
|
|
2728
2734
|
* (scr_async.c). Never throws. */
|
|
2729
2735
|
| "timers.immediatePromise" | "dc.tracingChannel" | "dc.tracingChannelOf" | "dc.tcChannel" | "dc.tcHasSubscribers" | "dc.tcSubscribe" | "dc.tcUnsubscribe" | "dc.tcTraceSync" | "dc.tcTraceCallback"
|
|
@@ -2737,11 +2743,11 @@ export type IrLibFn = "island.eval"
|
|
|
2737
2743
|
/** AsyncLocalStorage (node:async_hooks — scr_async.c): stores are f64
|
|
2738
2744
|
* handles; contexts are immutable fiber-carried snapshots (spawned
|
|
2739
2745
|
* fibers inherit the spawner's — Node's init-time capture). run/exit
|
|
2740
|
-
* enter (or clear) the store, call the
|
|
2746
|
+
* enter (or clear) the store, call the dyn function with forwarded
|
|
2741
2747
|
* arguments, and restore (the finally); getStore answers the current
|
|
2742
|
-
*
|
|
2748
|
+
* dyn value or undefined; enterWith installs with no restore point.
|
|
2743
2749
|
* run/exit MAY THROW (the callback's own throws propagate). */
|
|
2744
|
-
/** `await v` over a checked-dynamic VALUE (scr_async.c): a
|
|
2750
|
+
/** `await v` over a checked-dynamic VALUE (scr_async.c): a dyn promise
|
|
2745
2751
|
* adopts (rejections re-throw — MAY THROW), anything else takes JS's
|
|
2746
2752
|
* one-microtask non-thenable await and answers itself. Only emitted
|
|
2747
2753
|
* inside async bodies (the frontend's isAsync gate). */
|
|
@@ -2756,13 +2762,13 @@ export type IrLibFn = "island.eval"
|
|
|
2756
2762
|
* publish and the callback (MAY THROW: transforms, subscribers, and
|
|
2757
2763
|
* the callback all run). */
|
|
2758
2764
|
| "dc.chanBindStore" | "dc.chanUnbindStore" | "dc.chanRunStores"
|
|
2759
|
-
/** process warnings (scr_lib.c): onWarning/offWarning register
|
|
2765
|
+
/** process warnings (scr_lib.c): onWarning/offWarning register dyn
|
|
2760
2766
|
* listeners; emitWarning applies Node's full argument grammar over the
|
|
2761
|
-
* call's
|
|
2767
|
+
* call's dyn argument vector (ERR_INVALID_ARG_TYPE TypeErrors — MAY
|
|
2762
2768
|
* THROW; a listener throw propagates too) and always prints Node's
|
|
2763
2769
|
* stderr report. Emission is synchronous (SEMANTICS.md). */
|
|
2764
2770
|
| "process.onWarning" | "process.offWarning" | "process.emitWarning"
|
|
2765
|
-
/** process.on('unhandledRejection', fn): registers a
|
|
2771
|
+
/** process.on('unhandledRejection', fn): registers a dyn listener the
|
|
2766
2772
|
* loop-end report dispatches per never-observed rejection — (reason,
|
|
2767
2773
|
* promise) — instead of printing and exiting 1 (scr_async.c). Throws
|
|
2768
2774
|
* Node's ERR_INVALID_ARG_TYPE on a non-function. */
|
|
@@ -3730,13 +3736,13 @@ export type IrExpr =
|
|
|
3730
3736
|
* struct slot), then the overflow map on index-signature shapes. `type`
|
|
3731
3737
|
* is the CHECKER's type for the access: the index signature's value type
|
|
3732
3738
|
* (dyn for `unknown`; with noUncheckedIndexedAccess, its
|
|
3733
|
-
* `V | undefined` union). A MISSING key produces: the undefined
|
|
3739
|
+
* `V | undefined` union). A MISSING key produces: the undefined dyn
|
|
3734
3740
|
* singleton when `type` is dyn; the undefined arm when `type` is an
|
|
3735
3741
|
* undefined-armed union; otherwise a TRAP — the checker claimed V and no
|
|
3736
3742
|
* undefined is representable (the array OOB policy; on declared-only
|
|
3737
3743
|
* shapes tsc's keyof check makes the trap unreachable without an `as`
|
|
3738
3744
|
* smuggle). Declared-field values surface as `type`: V-typed fields read
|
|
3739
|
-
* directly, dyn results build a
|
|
3745
|
+
* directly, dyn results build a dyn COPY of the field value (the dynFrom
|
|
3740
3746
|
* conversion — deep for composites, documented), union results wrap.
|
|
3741
3747
|
* The key and object are borrowed; refcounted results are owned (+1).
|
|
3742
3748
|
* `overflowOnly` (set when the key is a LITERAL that names no declared
|
|
@@ -3751,17 +3757,17 @@ export type IrExpr =
|
|
|
3751
3757
|
type: IrType;
|
|
3752
3758
|
loc: SrcLoc;
|
|
3753
3759
|
}
|
|
3754
|
-
/** Static value → dyn
|
|
3760
|
+
/** Static value → dyn conversion (`type` is always dyn): the operand
|
|
3755
3761
|
* (a JSON-safe type — f64/string/bool/record/array/union, validated)
|
|
3756
|
-
* converts to a fresh
|
|
3762
|
+
* converts to a fresh dyn tree, DEEP-COPYING composites (the jsMarshal
|
|
3757
3763
|
* aliasing stance; a dyn value can never alias static storage). An
|
|
3758
|
-
* undefined-armed union's undefined arm becomes the undefined
|
|
3764
|
+
* undefined-armed union's undefined arm becomes the undefined dyn
|
|
3759
3765
|
* singleton. A FUNCTION operand (canBoxFuncIntoDyn — the mustCall shape:
|
|
3760
3766
|
* a typed closure flowing into an untyped JS helper's implicit-any
|
|
3761
|
-
* param) BOXES instead of copying: the
|
|
3767
|
+
* param) BOXES instead of copying: the checked-dynamic tree's function kind carries the
|
|
3762
3768
|
* retained closure, a compiled per-signature call thunk (per-argument
|
|
3763
3769
|
* dynCheck into the declared param types, result dynFrom'd back — JS
|
|
3764
|
-
* arity: extras ignored, missing args are the undefined
|
|
3770
|
+
* arity: extras ignored, missing args are the undefined dyn value and
|
|
3765
3771
|
* must satisfy the param's type or the thunk throws the catchable
|
|
3766
3772
|
* TypeError), the interned signature key (dynCheck's exact-unwrap fast
|
|
3767
3773
|
* path), and `fnName` — the best-effort static spelling for inspect
|
|
@@ -3774,14 +3780,14 @@ export type IrExpr =
|
|
|
3774
3780
|
type: IrType;
|
|
3775
3781
|
loc: SrcLoc;
|
|
3776
3782
|
}
|
|
3777
|
-
/** Island value → dyn
|
|
3778
|
-
* is always jsval): the jsval→
|
|
3783
|
+
/** Island value → dyn conversion (`type` is always dyn; the operand
|
|
3784
|
+
* is always jsval): the jsval→dyn crossing — an 'any'-typed engine
|
|
3779
3785
|
* value flowing into an 'unknown'/'object'/JS-residue slot wraps BY
|
|
3780
|
-
* REFERENCE as the
|
|
3786
|
+
* REFERENCE as the checked-dynamic tree's SCR_DYN_JSVAL kind (scr_dyn_from_jsval).
|
|
3781
3787
|
* Engine scalars (number/string/boolean/null/undefined) normalize to
|
|
3782
|
-
* the native
|
|
3788
|
+
* the native dyn kinds at wrap time, so wrapped nodes only ever hold
|
|
3783
3789
|
* engine objects/arrays/functions; typeof/truthiness/String()/=== on
|
|
3784
|
-
* the wrapped node route to the engine, un-armed
|
|
3790
|
+
* the wrapped node route to the engine, un-armed dyn walks fence
|
|
3785
3791
|
* loudly, and scr_jsval_from_dyn unwraps the SAME engine value back
|
|
3786
3792
|
* (identity round trip). The operand is borrowed; the result is owned
|
|
3787
3793
|
* (+1). Never throws. */
|
|
@@ -3791,7 +3797,7 @@ export type IrExpr =
|
|
|
3791
3797
|
type: IrType;
|
|
3792
3798
|
loc: SrcLoc;
|
|
3793
3799
|
}
|
|
3794
|
-
/** CALLING a dyn
|
|
3800
|
+
/** CALLING a dyn value — `fn(a, b)` where fn is checked-dynamic (an
|
|
3795
3801
|
* implicit-any JS binding, a dyn record member, a dynKeyGet result).
|
|
3796
3802
|
* Arguments are ALREADY dyn-typed (typed values box through dynFrom at
|
|
3797
3803
|
* the call's coercion — function args included); `type` is always dyn.
|
|
@@ -3806,8 +3812,8 @@ export type IrExpr =
|
|
|
3806
3812
|
* args are borrowed; the result is owned (+1). MAY THROW.
|
|
3807
3813
|
*
|
|
3808
3814
|
* `spreads` (the runtime-arity form — `f(...args)`, the rest-forwarding
|
|
3809
|
-
* idiom): entries name indices into `args` whose
|
|
3810
|
-
* the argument vector at the call — JS's spread over the
|
|
3815
|
+
* idiom): entries name indices into `args` whose dyn values FLATTEN into
|
|
3816
|
+
* the argument vector at the call — JS's spread over the checked-dynamic tree's iterable
|
|
3811
3817
|
* kinds (arrays element-by-element, strings by code point, bytes by
|
|
3812
3818
|
* byte; every other kind throws V8's exact spread-call TypeError,
|
|
3813
3819
|
* catchably — `what` is the spread expression's source spelling, which
|
|
@@ -3827,7 +3833,7 @@ export type IrExpr =
|
|
|
3827
3833
|
loc: SrcLoc;
|
|
3828
3834
|
}
|
|
3829
3835
|
/** Prototype-method DISPATCH on a dyn receiver — `recv.m(...)` where `m`
|
|
3830
|
-
* is a name a
|
|
3836
|
+
* is a name a dyn-representable prototype declares (Array/String/
|
|
3831
3837
|
* Function shared names: push, slice, join, forEach, map, apply, ...),
|
|
3832
3838
|
* so a stored-member read would silently mis-answer real methods. The
|
|
3833
3839
|
* runtime (scr_dyn_invoke) dispatches on the receiver's KIND:
|
|
@@ -3848,7 +3854,7 @@ export type IrExpr =
|
|
|
3848
3854
|
type: IrType;
|
|
3849
3855
|
loc: SrcLoc;
|
|
3850
3856
|
}
|
|
3851
|
-
/** A
|
|
3857
|
+
/** A dyn ARRAY built element-by-element (JS mixed-element literals —
|
|
3852
3858
|
* `['pwd', []]` — and evolving `[]` declarations): each element is
|
|
3853
3859
|
* already a dyn value; the result owns them. Never throws. */
|
|
3854
3860
|
| {
|
|
@@ -3857,7 +3863,7 @@ export type IrExpr =
|
|
|
3857
3863
|
type: IrType;
|
|
3858
3864
|
loc: SrcLoc;
|
|
3859
3865
|
}
|
|
3860
|
-
/** A
|
|
3866
|
+
/** A dyn OBJECT built member-by-member. With no `fields` it is the empty
|
|
3861
3867
|
* object (the JS stand-in for opaque container values — `new WeakMap()`
|
|
3862
3868
|
* in harness code: the value exists for identity; every reached METHOD
|
|
3863
3869
|
* use meets its own fence). With `fields` it is a JS object literal whose
|
|
@@ -3868,7 +3874,7 @@ export type IrExpr =
|
|
|
3868
3874
|
* JS's ToPropertyKey on the string side), each value is already dyn, and
|
|
3869
3875
|
* entries evaluate key-then-value in SOURCE order (JS's object-literal
|
|
3870
3876
|
* evaluation order; later duplicate keys win, insertion order preserved —
|
|
3871
|
-
* the
|
|
3877
|
+
* the checked-dynamic tree's own set semantics). Keys and values are borrowed (the member
|
|
3872
3878
|
* retains the value in). Never throws itself. */
|
|
3873
3879
|
| {
|
|
3874
3880
|
kind: "dynObjLit";
|
|
@@ -3879,32 +3885,32 @@ export type IrExpr =
|
|
|
3879
3885
|
type: IrType;
|
|
3880
3886
|
loc: SrcLoc;
|
|
3881
3887
|
}
|
|
3882
|
-
/** Runtime kind test on a dyn
|
|
3888
|
+
/** Runtime kind test on a dyn value — the narrowing tests tsc's
|
|
3883
3889
|
* control flow understands on `unknown`: `typeof v === "string" |
|
|
3884
3890
|
* "number" | "boolean" | "undefined"` and the unit comparisons `v ===
|
|
3885
3891
|
* undefined` / `v === null` (`"nullish"` is the LOOSE `v == null` pair —
|
|
3886
3892
|
* undefined or null in one test), and `v instanceof Uint8Array`
|
|
3887
|
-
* (`"bytes"` — the
|
|
3893
|
+
* (`"bytes"` — the checked-dynamic tree's bytes kind; Node's Buffer IS a Uint8Array
|
|
3888
3894
|
* subclass and both worlds answer true for it, SEMANTICS.md 45), plus
|
|
3889
3895
|
* the two object-family tests: `"object"` is `typeof v === "object"`
|
|
3890
|
-
* exactly (true for the
|
|
3896
|
+
* exactly (true for the checked-dynamic tree's object, array, bytes, AND null kinds —
|
|
3891
3897
|
* JS's oldest wart preserved), `"array"` is `Array.isArray(v)` (the
|
|
3892
|
-
* array kind alone), and `"truthy"` is ToBoolean over the whole
|
|
3898
|
+
* array kind alone), and `"truthy"` is ToBoolean over the whole dyn
|
|
3893
3899
|
* (`if (v)` on unknown): undefined/null false, bool by value, number
|
|
3894
3900
|
* falsy exactly for 0, -0, and NaN, string falsy exactly when empty,
|
|
3895
3901
|
* object/array/bytes always true — JS-exact for every kind. A pure
|
|
3896
|
-
* kind-tag compare against the
|
|
3902
|
+
* kind-tag compare against the dyn node's kind (truthy also reads the
|
|
3897
3903
|
* scalar payload); the operand is
|
|
3898
3904
|
* borrowed, nothing allocates, never throws. Result is bool. Narrowed
|
|
3899
3905
|
* READS afterwards bridge through `dynCheck` extraction
|
|
3900
3906
|
* (trust-but-VERIFY: unlike unionNarrow, a read reached with a lying
|
|
3901
3907
|
* kind throws instead of misreading the payload). `"error"` is
|
|
3902
|
-
* `v instanceof Error` on an unknown value: true exactly for the
|
|
3908
|
+
* `v instanceof Error` on an unknown value: true exactly for the checked-dynamic tree's
|
|
3903
3909
|
* error encoding — an object carrying the reserved "%error" key, the
|
|
3904
3910
|
* shape caughtToDyn builds for Error payloads (SEMANTICS.md 67) — so a
|
|
3905
3911
|
* caught Error passed through an unknown slot answers true like Node;
|
|
3906
3912
|
* dynCheck against %Error extracts it. `"function"` is `typeof v ===
|
|
3907
|
-
* "function"` — true exactly for the
|
|
3913
|
+
* "function"` — true exactly for the checked-dynamic tree's function kind (boxed
|
|
3908
3914
|
* closures); function values are truthy and answer FALSE to the
|
|
3909
3915
|
* `"object"` test, JS-exact. */
|
|
3910
3916
|
| {
|
|
@@ -3915,7 +3921,7 @@ export type IrExpr =
|
|
|
3915
3921
|
type: IrType;
|
|
3916
3922
|
loc: SrcLoc;
|
|
3917
3923
|
}
|
|
3918
|
-
/** Keyed read on a dyn
|
|
3924
|
+
/** Keyed read on a dyn value — `pkg.name` / `pkg["k"]` / the
|
|
3919
3925
|
* `pkg?.scripts` chain step on a JSON.parse result. `key` is
|
|
3920
3926
|
* string-typed (a strLit for the dot form); `type` is always dyn. An
|
|
3921
3927
|
* OBJ receiver answers the member (+1) or the undefined singleton (the
|
|
@@ -3937,9 +3943,9 @@ export type IrExpr =
|
|
|
3937
3943
|
type: IrType;
|
|
3938
3944
|
loc: SrcLoc;
|
|
3939
3945
|
}
|
|
3940
|
-
/** `"k" in pkg` on a dyn
|
|
3946
|
+
/** `"k" in pkg` on a dyn receiver (literal keys only): OBJ answers
|
|
3941
3947
|
* own-member presence (a member holding the undefined value still
|
|
3942
|
-
* answers true — the
|
|
3948
|
+
* answers true — the checked-dynamic tree stores presence, unlike the record form's
|
|
3943
3949
|
* SEMANTICS.md 55 stance), ARR answers true for "length" and canonical
|
|
3944
3950
|
* in-range indices, everything else answers false (tsc admits `in`
|
|
3945
3951
|
* only on object-typed operands, so unit receivers — where JS throws —
|
|
@@ -3953,16 +3959,16 @@ export type IrExpr =
|
|
|
3953
3959
|
type: IrType;
|
|
3954
3960
|
loc: SrcLoc;
|
|
3955
3961
|
}
|
|
3956
|
-
/** Strict equality between a dyn
|
|
3962
|
+
/** Strict equality between a dyn value and a SCALAR-typed value
|
|
3957
3963
|
* (`v !== ""`, `v === 5` — one side `unknown`, the other f64/string/
|
|
3958
3964
|
* bool): a guarded kind test plus payload compare — true exactly when
|
|
3959
|
-
* the
|
|
3965
|
+
* the checked-dynamic tree holds that scalar kind AND the payloads are strictly equal
|
|
3960
3966
|
* (C == for numbers: NaN false, ±0 equal — JS-exact; bytewise for
|
|
3961
3967
|
* strings). `left`/`right` keep SOURCE order (evaluation order is
|
|
3962
3968
|
* JS's); at least one side is dyn-typed — BOTH-dyn compares run the
|
|
3963
|
-
* runtime's whole-
|
|
3969
|
+
* runtime's whole-dyn strict equality (scr_dyn_strict_eq: scalars by
|
|
3964
3970
|
* value, units by kind, reference kinds by node identity — JS-exact
|
|
3965
|
-
* within the
|
|
3971
|
+
* within the checked-dynamic tree's aliasing story). Both operands are borrowed,
|
|
3966
3972
|
* nothing allocates, never throws. Result is bool. */
|
|
3967
3973
|
| {
|
|
3968
3974
|
kind: "dynScalarEq";
|
|
@@ -3993,7 +3999,7 @@ export type IrExpr =
|
|
|
3993
3999
|
* 'FIRSTPROP' of 'SPELLING' …" when `firstProp` is set (V8 names the
|
|
3994
4000
|
* pattern's first property) — and yields the value unchanged otherwise.
|
|
3995
4001
|
* `spelling` is the RHS's compile-time source spelling. Value and type
|
|
3996
|
-
* are dyn (the
|
|
4002
|
+
* are dyn (the dyn helper) or jsval (the island's prelude guard —
|
|
3997
4003
|
* engine-thrown, catchable like every boundary throw). */
|
|
3998
4004
|
| {
|
|
3999
4005
|
kind: "dynDestrCheck";
|
|
@@ -4004,12 +4010,12 @@ export type IrExpr =
|
|
|
4004
4010
|
loc: SrcLoc;
|
|
4005
4011
|
}
|
|
4006
4012
|
/** GetIterator + the first `count` steps, as array destructuring sees
|
|
4007
|
-
* it. Over a
|
|
4013
|
+
* it. Over a dyn value: arrays step by index, strings by code point,
|
|
4008
4014
|
* Buffers by byte; everything else throws V8's exact "<desc> is not
|
|
4009
4015
|
* iterable (cannot read property Symbol(Symbol.iterator))" TypeError.
|
|
4010
4016
|
* Over an island (jsval) value the engine runs the REAL iterator
|
|
4011
4017
|
* protocol (user iterables included, IteratorClose per spec) behind the
|
|
4012
|
-
* same V8 message for non-iterables. The result is a FRESH array (
|
|
4018
|
+
* same V8 message for non-iterables. The result is a FRESH array (dyn
|
|
4013
4019
|
* or engine, matching the operand) of exactly `count` elements
|
|
4014
4020
|
* (undefined-padded past the end) — the empty pattern passes count 0
|
|
4015
4021
|
* and uses only the validation. Value is borrowed; the result is owned
|
|
@@ -4093,16 +4099,16 @@ export type IrExpr =
|
|
|
4093
4099
|
loc: SrcLoc;
|
|
4094
4100
|
}
|
|
4095
4101
|
/** A catch binding flowing into an `unknown` slot (`options.onError?.(e)`
|
|
4096
|
-
* — the caught snapshot converting to a dyn
|
|
4102
|
+
* — the caught snapshot converting to a dyn value, the typed→unknown
|
|
4097
4103
|
* deep-copy stance extended to exception payloads, SEMANTICS.md 67).
|
|
4098
4104
|
* Runtime dispatch on the snapshot's kind: string/number/boolean payloads
|
|
4099
|
-
* become the exact
|
|
4100
|
-
*
|
|
4105
|
+
* become the exact dyn scalars; an Error-family OBJ payload becomes the
|
|
4106
|
+
* dyn's error encoding — an object with the reserved "%error" marker key
|
|
4101
4107
|
* plus "name"/"message" (and "code" when stamped), so `instanceof Error`
|
|
4102
4108
|
* (dynTest "error"), the %Error dynCheck extraction, and String() answer
|
|
4103
4109
|
* like Node; every other payload (records, arrays, closures, unions,
|
|
4104
4110
|
* non-Error hierarchy objects — type-erased at runtime) becomes an EMPTY
|
|
4105
|
-
*
|
|
4111
|
+
* dyn object: truthy, typeof "object", fields unreadable — the
|
|
4106
4112
|
* "[object Object]" approximation, documented. `value` is a caught-typed
|
|
4107
4113
|
* varRef (borrowed); `type` is dyn; the result is a fresh tree (+1),
|
|
4108
4114
|
* never aliasing the payload. Never throws. */
|
|
@@ -4272,7 +4278,7 @@ export type IrExpr =
|
|
|
4272
4278
|
loc: SrcLoc;
|
|
4273
4279
|
}
|
|
4274
4280
|
/** The dynamic-boundary check — a CHECKED cast `dynValue as T`: validate
|
|
4275
|
-
* the dyn value's JSON
|
|
4281
|
+
* the dyn value's JSON dyn against `type` (a non-dyn, JSON-representable
|
|
4276
4282
|
* IR type) and BUILD the typed value (+1), or THROW a catchable
|
|
4277
4283
|
* TypeError-flavored, path-annotated string ("TypeError: expected number
|
|
4278
4284
|
* at $.items[2].price, got string") through the exception cell. Semantics:
|
|
@@ -4282,7 +4288,7 @@ export type IrExpr =
|
|
|
4282
4288
|
* missing key for an undefined-armed union field — an optional field —
|
|
4283
4289
|
* builds the interned undefined arm instead); arrays check every element;
|
|
4284
4290
|
* unions try arms in canonical order and the first FULL match wins (no
|
|
4285
|
-
* match → throw; an undefined arm matches no
|
|
4291
|
+
* match → throw; an undefined arm matches no dyn value); JSON null matches
|
|
4286
4292
|
* exactly the nullT arm of a union target (bare null targets cannot
|
|
4287
4293
|
* exist). MAY THROW:
|
|
4288
4294
|
* backends' may-throw analyses must treat it like a `throw` statement.
|
|
@@ -4501,7 +4507,7 @@ export declare function islandCallbackRet(t: IrType, getRecord: (shapeId: string
|
|
|
4501
4507
|
* (no per-type extraction exists for them inside a host call). */
|
|
4502
4508
|
export declare function canMarshalTypedFuncIntoIsland(t: IrType, getRecord: (shapeId: string) => IrRecordShape | undefined, getUnion: (unionId: string) => IrUnionDef | undefined): boolean;
|
|
4503
4509
|
/** The runtime HANDLE kinds that cross the checked-dynamic boundary as
|
|
4504
|
-
* the
|
|
4510
|
+
* the checked-dynamic tree's HANDLE kind (SCR_DYN_HANDLE): boxed by REFERENCE (identity —
|
|
4505
4511
|
* stateful I/O objects never copy), unboxed by tag check, members
|
|
4506
4512
|
* dispatched at runtime onto the same entry points the static lowerings
|
|
4507
4513
|
* use. The set is deliberately the handles whose member surfaces have
|
|
@@ -4514,7 +4520,7 @@ export declare const DYN_HANDLE_KINDS: ReadonlyMap<string, {
|
|
|
4514
4520
|
tag: string;
|
|
4515
4521
|
cls: string;
|
|
4516
4522
|
}>;
|
|
4517
|
-
/** A static type that CONVERTS into a dyn
|
|
4523
|
+
/** A static type that CONVERTS into a dyn value — the dynFrom domain:
|
|
4518
4524
|
* JSON-safe data, bytes<u8> (payload copied), undefined-armed unions of
|
|
4519
4525
|
* JSON-safe arms, boxable function types, and the runtime HANDLE kinds
|
|
4520
4526
|
* (boxed by reference — DYN_HANDLE_KINDS). */
|
|
@@ -4525,7 +4531,7 @@ export declare function canConvertToDyn(t: IrType, getRecord: (shapeId: string)
|
|
|
4525
4531
|
* and the runtime HANDLE kinds (a tag-checked reference unwrap —
|
|
4526
4532
|
* DYN_HANDLE_KINDS). */
|
|
4527
4533
|
export declare function canDynCheckTo(t: IrType, getRecord: (shapeId: string) => IrRecordShape | undefined, getUnion: (unionId: string) => IrUnionDef | undefined): boolean;
|
|
4528
|
-
/** A closure type that can BOX into the
|
|
4534
|
+
/** A closure type that can BOX into the checked-dynamic tree's function kind (dynFrom):
|
|
4529
4535
|
* every param dyn or dynCheckable (the thunk validates dyn arguments into
|
|
4530
4536
|
* them), return void, dyn, or dyn-convertible (the thunk converts it
|
|
4531
4537
|
* back). */
|
|
@@ -4548,6 +4554,12 @@ export declare function canMarshalIntoIsland(t: IrType, getRecord: (shapeId: str
|
|
|
4548
4554
|
* null and data ride the round trip into the union's dynCheck. The
|
|
4549
4555
|
* package-API shape `result.headers` : `Record<string, string> |
|
|
4550
4556
|
* undefined` is the motivating case. */
|
|
4557
|
+
/** The static-promise→engine bridge's payload domain: the fulfillment
|
|
4558
|
+
* types a scriptc promise may deliver INTO the island as a real engine
|
|
4559
|
+
* thenable (scr_jsval_from_promise — the async-callback return bridge,
|
|
4560
|
+
* reused by promise VALUES crossing at jsvalIn edges and the island
|
|
4561
|
+
* Promise.all arm). Null = outside the domain (the boundary fence). */
|
|
4562
|
+
export declare function islandPromisePayloadTag(inner: IrType): "void" | "f64" | "bool" | "string" | "jsval" | "jsvalArr" | null;
|
|
4551
4563
|
export declare function canExitIslandToType(t: IrType, getRecord: (shapeId: string) => IrRecordShape | undefined, getUnion: (unionId: string) => IrUnionDef | undefined): boolean;
|
|
4552
4564
|
/** True when the module contains any regex construct — a regexLit /
|
|
4553
4565
|
* regexIntrinsic node or a regex-typed slot anywhere. This is the link
|
|
@@ -4634,7 +4646,7 @@ export declare function moduleUsesDynInvoke(mod: IrModule): boolean;
|
|
|
4634
4646
|
* precedent — inspect-free binaries keep the historical command line and
|
|
4635
4647
|
* size class). Same walk shape as moduleUsesZlib. */
|
|
4636
4648
|
/** True when the module needs scr_async_dyn.c — the checked-dynamic
|
|
4637
|
-
* async surfaces (
|
|
4649
|
+
* async surfaces (dyn-promise then/catch/finally reactions, await of a
|
|
4638
4650
|
* dyn value, `new Promise(setImmediate)`, AsyncLocalStorage, the
|
|
4639
4651
|
* unhandledRejection/warning process events). Also pulled by the
|
|
4640
4652
|
* dynInvoke and dc gates (their TUs call into this one) — cc.ts. Same
|