@scriptc/compiler 0.0.11 → 0.0.13

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.
Files changed (97) hide show
  1. package/ambient/scriptc-node-fallback.d.ts +153 -24
  2. package/ambient/scriptc.d.ts +2 -2
  3. package/dist/backend/cc.d.ts +10 -2
  4. package/dist/backend/cc.js +12 -0
  5. package/dist/backend/cc.js.map +1 -1
  6. package/dist/backend/emission/emit-async.js +1 -1
  7. package/dist/backend/emission/emit-exprs.js +235 -64
  8. package/dist/backend/emission/emit-exprs.js.map +1 -1
  9. package/dist/backend/emission/emit-island.js +1 -1
  10. package/dist/backend/emission/emit-shapes.js +1 -1
  11. package/dist/backend/emission/emit-walkers.d.ts +14 -14
  12. package/dist/backend/emission/emit-walkers.js +44 -44
  13. package/dist/backend/emission/emit-walkers.js.map +1 -1
  14. package/dist/backend/emission/emitter.d.ts +3 -3
  15. package/dist/backend/emission/emitter.js +8 -8
  16. package/dist/backend/emission/may-throw.js +1 -1
  17. package/dist/backend/llvm/dyn.d.ts +10 -10
  18. package/dist/backend/llvm/dyn.js +26 -26
  19. package/dist/backend/llvm/dyn.js.map +1 -1
  20. package/dist/backend/llvm/emitter.js +140 -49
  21. package/dist/backend/llvm/emitter.js.map +1 -1
  22. package/dist/backend/llvm/shapes.js +1 -1
  23. package/dist/backend/llvm/walkers.js +2 -2
  24. package/dist/backend/llvm/walkers.js.map +1 -1
  25. package/dist/diagnostics/diagnostic.d.ts +1 -1
  26. package/dist/diagnostics/diagnostic.js +4 -3
  27. package/dist/diagnostics/diagnostic.js.map +1 -1
  28. package/dist/frontend/lowering/crypto-tables.d.ts +7 -0
  29. package/dist/frontend/lowering/crypto-tables.js +139 -0
  30. package/dist/frontend/lowering/crypto-tables.js.map +1 -0
  31. package/dist/frontend/lowering/lib-boundary.js +5 -5
  32. package/dist/frontend/lowering/lib-boundary.js.map +1 -1
  33. package/dist/frontend/lowering/lower-assert.js +12 -12
  34. package/dist/frontend/lowering/lower-assert.js.map +1 -1
  35. package/dist/frontend/lowering/lower-builtins.d.ts +45 -27
  36. package/dist/frontend/lowering/lower-builtins.js +203 -70
  37. package/dist/frontend/lowering/lower-builtins.js.map +1 -1
  38. package/dist/frontend/lowering/lower-calls.d.ts +4 -4
  39. package/dist/frontend/lowering/lower-calls.js +74 -66
  40. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  41. package/dist/frontend/lowering/lower-classes.js +41 -7
  42. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  43. package/dist/frontend/lowering/lower-containers.d.ts +5 -5
  44. package/dist/frontend/lowering/lower-containers.js +19 -19
  45. package/dist/frontend/lowering/lower-containers.js.map +1 -1
  46. package/dist/frontend/lowering/lower-emitter.js +2 -2
  47. package/dist/frontend/lowering/lower-emitter.js.map +1 -1
  48. package/dist/frontend/lowering/lower-exprs.d.ts +7 -7
  49. package/dist/frontend/lowering/lower-exprs.js +227 -119
  50. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  51. package/dist/frontend/lowering/lower-inspect.js +5 -5
  52. package/dist/frontend/lowering/lower-inspect.js.map +1 -1
  53. package/dist/frontend/lowering/lower-island.js +12 -3
  54. package/dist/frontend/lowering/lower-island.js.map +1 -1
  55. package/dist/frontend/lowering/lower-modules.js +17 -17
  56. package/dist/frontend/lowering/lower-modules.js.map +1 -1
  57. package/dist/frontend/lowering/lower-namespaces.d.ts +11 -1
  58. package/dist/frontend/lowering/lower-namespaces.js +41 -6
  59. package/dist/frontend/lowering/lower-namespaces.js.map +1 -1
  60. package/dist/frontend/lowering/lower-server.d.ts +21 -0
  61. package/dist/frontend/lowering/lower-server.js +278 -23
  62. package/dist/frontend/lowering/lower-server.js.map +1 -1
  63. package/dist/frontend/lowering/lower-stmts.d.ts +1 -1
  64. package/dist/frontend/lowering/lower-stmts.js +195 -34
  65. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  66. package/dist/frontend/lowering/lower-stream.js +67 -23
  67. package/dist/frontend/lowering/lower-stream.js.map +1 -1
  68. package/dist/frontend/lowering/lowerer.d.ts +31 -13
  69. package/dist/frontend/lowering/lowerer.js +99 -45
  70. package/dist/frontend/lowering/lowerer.js.map +1 -1
  71. package/dist/frontend/lowering/surfaces.d.ts +6 -0
  72. package/dist/frontend/lowering/surfaces.js +78 -2
  73. package/dist/frontend/lowering/surfaces.js.map +1 -1
  74. package/dist/frontend/program.js +1 -1
  75. package/dist/frontend/shared.js +7 -7
  76. package/dist/frontend/shared.js.map +1 -1
  77. package/dist/frontend/types.d.ts +2 -2
  78. package/dist/frontend/types.js +27 -15
  79. package/dist/frontend/types.js.map +1 -1
  80. package/dist/index.js +44 -8
  81. package/dist/index.js.map +1 -1
  82. package/dist/ir/nodes.d.ts +208 -106
  83. package/dist/ir/nodes.js +100 -22
  84. package/dist/ir/nodes.js.map +1 -1
  85. package/dist/ir/validate.js +96 -38
  86. package/dist/ir/validate.js.map +1 -1
  87. package/dist/library/int-infer.js +13 -0
  88. package/dist/library/int-infer.js.map +1 -1
  89. package/dist/library/profile.d.ts +8 -6
  90. package/dist/library/profile.js.map +1 -1
  91. package/dist/library/sidecar-validate.js +1 -1
  92. package/dist/library/sidecar-validate.js.map +1 -1
  93. package/dist/library/sidecar.d.ts +1 -1
  94. package/dist/library/sidecar.js +20 -7
  95. package/dist/library/sidecar.js.map +1 -1
  96. package/package.json +2 -2
  97. package/surface-manifest.json +289 -4
@@ -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 DOM ARRAY carrying the
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 DOM tree (ScrDyn). Deliberately NARROW: a dyn value can
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
- * DOM's function kind, boxed closures with per-call argument checks),
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→DOM conversion,
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 DOM value — `h.onDone = cb` / `h["k"] = v` on a
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,38 @@ 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 DOM source — `const [a, b] = d`, a
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 DOM array, +1). Iterable kinds collect like spread
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
- /** Object.defineProperties over DOM values (args: target, descriptors —
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
+ /** `key in v` with a RUNTIME (string) key on a checked-dynamic
1348
+ * receiver (args: value dyn, key string; result bool): OBJ answers
1349
+ * own-member presence, ARR answers 'length'/a valid index — exactly
1350
+ * the compile-time dynHasKey fold, per value. Never throws. */
1351
+ | "dyn.hasKey"
1352
+ /** Object.defineProperties over dyn values (args: target, descriptors —
1342
1353
  * both borrowed dyn; result: the target, +1 — JS's return value).
1343
1354
  * Value descriptors become plain own properties on OBJ and FUNC targets
1344
- * (writable/enumerable/configurable accepted and IGNORED — DOM
1355
+ * (writable/enumerable/configurable accepted and IGNORED — dyn
1345
1356
  * properties are plain data properties, SEMANTICS.md); get/set
1346
1357
  * descriptors and non-object targets/descriptors throw catchably
1347
1358
  * (Node's TypeError texts; accessors the loud unsupported Error). In
1348
1359
  * the may-throw seed set. */
1349
1360
  | "dyn.defineProps"
1350
1361
  /** Bare `typeof v` on a dyn value AS A STRING (arg: the dyn value,
1351
- * borrowed; result: an owned string) — the DOM kind's JS answer:
1362
+ * borrowed; result: an owned string) — the dyn kind's JS answer:
1352
1363
  * undefined→"undefined", null/object/array/bytes→"object" (JS's oldest
1353
1364
  * wart preserved), boolean/number/string by kind, function→"function".
1354
1365
  * Never throws. */
@@ -1479,8 +1490,8 @@ export type IrLibFn = "island.eval"
1479
1490
  * unescaped — total like the component encoder. Borrow; result +1. */
1480
1491
  | "str.encodeUri"
1481
1492
  /** The WHATWG base64 globals (scr_string.c), Node-global since v16.
1482
- * Arguments are borrowed DOM values — WebIDL ToString runs in the
1483
- * runtime over the DOM kind (String(null) is "null": the html spec's
1493
+ * Arguments are borrowed dyn values — WebIDL ToString runs in the
1494
+ * runtime over the dyn kind (String(null) is "null": the html spec's
1484
1495
  * coercion, which Node's atob(null) exercises). str.atob decodes
1485
1496
  * forgiving-base64 (ASCII whitespace stripped, %4==0 strips up to two
1486
1497
  * '=', %4==1 refuses, leftover bits discarded) into the latin1 code
@@ -1568,7 +1579,7 @@ export type IrLibFn = "island.eval"
1568
1579
  * arm tolerated — @types/node's Dict), verified structurally by the
1569
1580
  * frontend (lowerQuerystringParseCall); the emitters construct the
1570
1581
  * 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 DOM value
1582
+ * union tags. qs.stringify takes (obj, sep, eq) with obj a dyn value
1572
1583
  * (the frontend dynFroms the typed record; JS-world dyn values pass
1573
1584
  * through) — Node's encodeStringified rules run in the runtime, so
1574
1585
  * arrays expand to repeated keys and null/undefined/nested objects are
@@ -1765,7 +1776,7 @@ export type IrLibFn = "island.eval"
1765
1776
  * blocking divergence); its per-union adapter builds the
1766
1777
  * `Error | null` first argument. */
1767
1778
  | "dgram.createSocket" | "dgram.bind" | "dgram.bindCb" | "dgram.connect" | "dgram.connectCb" | "dgram.sendStr" | "dgram.sendBytes"
1768
- /** The send argument-validation ladder over DOM arguments (Node's
1779
+ /** The send argument-validation ladder over dyn arguments (Node's
1769
1780
  * signature shuffle: slice bounds, list/type contracts, port/address
1770
1781
  * validation, connected-state errors) — a fully-validated unconnected
1771
1782
  * single-payload send RUNS; callback/list/connected forms meet the
@@ -1882,7 +1893,17 @@ export type IrLibFn = "island.eval"
1882
1893
  * bytes to the front of the stream; serverEmitConnection routes a
1883
1894
  * socket into another server's protocol layer (a TLS target's
1884
1895
  * 'connection' waits for its handshake). */
1885
- | "net.sockOnReadable" | "net.sockRead" | "net.sockUnshift" | "net.serverEmitConnection"
1896
+ | "net.sockOnReadable" | "net.sockRead" | "net.sockUnshift"
1897
+ /** Socket flow control and the compat surface: pause/resume (reads
1898
+ * gate off/on — kernel backpressure holds paused bytes; resume flows
1899
+ * and discards sans listeners) and setNoDelay answer the SOCKET (+1,
1900
+ * Node's chaining); destroySoon ends now and destroys once the FIN
1901
+ * flushed; bytesWritten counts accepted bytes; readable is true until
1902
+ * the read half ends. */
1903
+ | "net.sockPause" | "net.sockResume" | "net.sockSetNoDelay" | "net.sockDestroySoon" | "net.sockBytesWritten" | "net.sockReadable"
1904
+ /** socket.on('finish', cb) / end(cb): fires once when the FIN goes out
1905
+ * (sweep-deferred, never the registering stack). */
1906
+ | "net.sockOnFinish" | "net.serverEmitConnection"
1886
1907
  /** node:http, the CLIENT slice (http.request/http.get over the net
1887
1908
  * client machinery): request/requestCb take (host, port, path, method,
1888
1909
  * timeoutMs, headerPairs, autoEnd[, responseCb]) — headerPairs is the
@@ -1899,6 +1920,24 @@ export type IrLibFn = "island.eval"
1899
1920
  * the caller set content-length; clientEnd(data) before any write sends
1900
1921
  * Content-Length exactly like Node. */
1901
1922
  | "http.request" | "http.requestCb"
1923
+ /** new http.Agent(opts) / new https.Agent(opts): (secure, keepAlive,
1924
+ * keepAliveMsecs, maxSockets, maxFreeSockets, timeoutMs, port) — the
1925
+ * numeric options arrive < 0 for "unset" (Infinity/256/none; port
1926
+ * seeds the settable defaultPort, Node's option merge). Returns the
1927
+ * Agent as a checked-dynamic HANDLE (getName/destroy and the
1928
+ * sockets/requests/freeSockets counters dispatch through the dyn
1929
+ * handle ops). keepAlive: true THROWS the named construction fence —
1930
+ * socket POOLING is not modeled (one dial per request); maxSockets
1931
+ * accounting is real: over-limit requests defer their dial and queue.
1932
+ * MAY THROW. */
1933
+ | "http.agentNew"
1934
+ /** The agent-threaded request rows: the http.request/https.request
1935
+ * shape with a trailing `agent` dyn argument (an Agent handle, false —
1936
+ * the one-shot Connection: close dial — or null/undefined for the
1937
+ * default path). port < 0 means "no port option": the agent's settable
1938
+ * defaultPort, then the scheme's. MAY THROW (a non-Agent value is
1939
+ * Node's ERR_INVALID_ARG_TYPE). */
1940
+ | "http.requestAgent" | "http.requestAgentCb" | "https.requestAgent" | "https.requestAgentCb"
1902
1941
  /** The createConnection form (the proxy's own dialer): args are
1903
1942
  * (connCb, path, method, timeout, headers, autoEnd[, cb]) — connCb is
1904
1943
  * a `() => net.Socket` closure the runtime invokes ONCE, synchronously
@@ -1956,7 +1995,18 @@ export type IrLibFn = "island.eval"
1956
1995
  /** tls.getCACertificates(type): validateString + the documented name
1957
1996
  * set, then the trailing compiler-rendered fence — ALWAYS THROWS (the
1958
1997
  * error.nodeThrow polymorphic-result carve-out). May-throw seed. */
1959
- | "tls.caCertsChk" | "https.createServer" | "https.request" | "https.requestCb"
1998
+ | "tls.caCertsChk"
1999
+ /** The CA-store introspection surface (scr_tls_ca.c — its own unit and
2000
+ * link gate, "tlsca." NOT "tls.", so a getCACertificates-only binary
2001
+ * never pulls mbedTLS): tlsca.get is tls.getCACertificates(type) — the
2002
+ * cached per-type string[] of PEM blocks (identity-stable across calls,
2003
+ * Node's caching; an unknown type throws Node's ERR_INVALID_ARG_VALUE
2004
+ * TypeError); tlsca.root is the tls.rootCertificates value read;
2005
+ * tlsca.set is tls.setDefaultCACertificates(certs) — replaces the
2006
+ * default set (deduped) and the anchors the TLS client verifies
2007
+ * against, throwing Node's ERR_CRYPTO_OPERATION_FAILED when no entry
2008
+ * carries a certificate block. */
2009
+ | "tlsca.get" | "tlsca.root" | "tlsca.set" | "https.createServer" | "https.request" | "https.requestCb"
1960
2010
  /** A call through a `const requestFn = tls ? https.request :
1961
2011
  * http.request` binding — the module-function-as-value ternary between
1962
2012
  * the two known clients: the https.request row with a leading `secure`
@@ -1976,6 +2026,20 @@ export type IrLibFn = "island.eval"
1976
2026
  * serverOnSessionError evaluates and releases its callback — no h2
1977
2027
  * session ever exists, so the event NEVER fires. */
1978
2028
  | "http2.createSecureServer"
2029
+ /** createSecureServer(options, handler) — the eager COMPAT handler as
2030
+ * the first 'request' listener (Node's exact route), on both literal
2031
+ * flavors: Req is the allowHTTP1 server (scr_https_create_server with
2032
+ * the closure — HTTP/1.1 req/res handles), H2Req the ALPN=h2 server
2033
+ * (the compat handles over h2 streams — scr_http2.c's layer). Args are
2034
+ * (cert, key, cb). */
2035
+ | "http2.createSecureServerReq" | "http2.createSecureServerH2Req"
2036
+ /** createSecureServer with a RUNTIME options record (the divergence-66
2037
+ * stance): allowHTTP1/cert/key read at runtime — allowHTTP1 picks the
2038
+ * flavor, the TLS server walk fences its out-of-bounds members with
2039
+ * the catchable runtime fence, and h2 session-tuning keys drop exactly
2040
+ * like the literal walk ignores them. May throw. The Cb form carries
2041
+ * the eager compat handler. */
2042
+ | "http2.createSecureServerDyn" | "http2.createSecureServerDynCb"
1979
2043
  /** createSecureServer with an SNI callback: args are (cert, key, sniCb)
1980
2044
  * where sniCb is the JS SNICallback — a `(servername, cb) => void`
1981
2045
  * closure, or the `SNICallback | undefined` union from the conditional-
@@ -2085,12 +2149,12 @@ export type IrLibFn = "island.eval"
2085
2149
  * always throws Node's ERR_INVALID_ARG_TYPE ("The \"string\" argument
2086
2150
  * must be of type string. Received ..."). Borrowed dyn; may-throw. */
2087
2151
  | "buffer.newStringFail"
2088
- /** fs._toUnixTimestamp(time) over a DOM value: numeric strings and
2152
+ /** fs._toUnixTimestamp(time) over a dyn value: numeric strings and
2089
2153
  * finite numbers coerce (negatives answer now/1000, Node's shape);
2090
2154
  * everything else throws Node's ERR_INVALID_ARG_TYPE. May-throw. */
2091
2155
  | "fs.toUnixTimestamp"
2092
2156
  /** The fs argument-validation ladders (checked-dynamic lane): each Chk
2093
- * replicates its API's Node-order validation over DOM values (Node's
2157
+ * replicates its API's Node-order validation over dyn values (Node's
2094
2158
  * exact typed errors — ERR_INVALID_ARG_TYPE/VALUE, ERR_OUT_OF_RANGE),
2095
2159
  * and a full pass meets the trailing compiler-rendered SC2020 fence
2096
2160
  * string — so the ALWAYS-THROW forms take the error.nodeThrow
@@ -2101,7 +2165,7 @@ export type IrLibFn = "island.eval"
2101
2165
  | "fs.existsChk" | "fs.mkdtempChk" | "fs.mkdtempSyncChk" | "fs.readFileChk" | "fs.opendirChk" | "fs.watchFileChk" | "fs.lchmodChk" | "fs.lchmodSyncChk" | "fsp.lchmodChk" | "fs.readChk" | "fs.streamOptsChk"
2102
2166
  /** The compiler-resolved ERR_INVALID_ARG_TYPE throw with a RUNTIME-
2103
2167
  * rendered Received tail: args [argname, "of type ..." clause, the
2104
- * offending DOM value]. ALWAYS THROWS; polymorphic result (the
2168
+ * offending dyn value]. ALWAYS THROWS; polymorphic result (the
2105
2169
  * error.nodeThrow pattern). May-throw seed. */
2106
2170
  | "error.argTypeThrow"
2107
2171
  /** The property flavor of argTypeThrow ("The \"options.x\" property
@@ -2109,7 +2173,7 @@ export type IrLibFn = "island.eval"
2109
2173
  * THROWS; polymorphic result. May-throw seed. */
2110
2174
  | "error.propTypeThrow"
2111
2175
  /** The checked-dynamic max-listeners ladders: setMaxChk is the
2112
- * instance form over a DOM n (non-numbers ERR_INVALID_ARG_TYPE,
2176
+ * instance form over a dyn n (non-numbers ERR_INVALID_ARG_TYPE,
2113
2177
  * negatives/NaN ERR_OUT_OF_RANGE; +1 receiver back — chaining);
2114
2178
  * setDefaultMaxChk is the static/property form, its second argument
2115
2179
  * naming the message slot ("setMaxListeners" for the static call,
@@ -2157,7 +2221,7 @@ export type IrLibFn = "island.eval"
2157
2221
  /** The ambient receiver — JS `this` in a plain (non-method) function
2158
2222
  * body: the innermost binding the current firing/dispatch window
2159
2223
  * pushed (Node's listener receiver, a dyn OBJ method's object, an
2160
- * apply/call thisArg), or the undefined DOM singleton with none bound
2224
+ * apply/call thisArg), or the undefined dyn singleton with none bound
2161
2225
  * (the strict-mode plain-call answer, the old constant). Zero args →
2162
2226
  * dyn (+1). Never throws. */
2163
2227
  | "dyn.this"
@@ -2347,7 +2411,7 @@ export type IrLibFn = "island.eval"
2347
2411
  * the replaced expression's own (never materialized — the
2348
2412
  * global.undefRead pattern). May-throw seed. */
2349
2413
  | "error.nodeThrow"
2350
- /** JS ToString over a DOM value WITH the object protocol (a user
2414
+ /** JS ToString over a dyn value WITH the object protocol (a user
2351
2415
  * toString/valueOf member is CALLED and its throw propagates;
2352
2416
  * exhaustion throws "Cannot convert object to primitive value"; units
2353
2417
  * render "null"/"undefined") — the WHATWG USVString conversions
@@ -2366,43 +2430,43 @@ export type IrLibFn = "island.eval"
2366
2430
  * `C.name` on the class name itself folds to a strLit instead. */
2367
2431
  | "class.name" | "error.ctor" | "error.toString"
2368
2432
  /** `new DOMException(message?, nameOrOptions?)` (scr_error.c): both args
2369
- * are borrowed DOM values (the lowering passes the DOM undefined for an
2433
+ * are borrowed dyn values (the lowering passes the dyn undefined for an
2370
2434
  * absent argument, so WebIDL's optionality lives in one place). The
2371
2435
  * runtime ToStrings the message ("" for absent/undefined), resolves the
2372
2436
  * name — absent/undefined → "Error", a non-null object → ToString of its
2373
2437
  * `name` member plus the `cause` own-property record, anything else →
2374
2438
  * ToString — and stamps the legacy code from the WebIDL name table (0
2375
- * off-table). Result is an owned (+1) %DOMException. Never throws (DOM
2439
+ * off-table). Result is an owned (+1) %DOMException. Never throws (dyn
2376
2440
  * ToString is total). */
2377
2441
  | "error.newDom"
2378
2442
  /** DOMException's own read surface (scr_error.c; %DOMException receivers
2379
2443
  * only — borrowed). domCode: the legacy numeric code. domHasCause: the
2380
2444
  * options form's own-property record (`'cause' in e`). domCause: the
2381
- * cause value, +1 (the DOM undefined when absent — matching Node's
2445
+ * cause value, +1 (the dyn undefined when absent — matching Node's
2382
2446
  * undefined read). None throws. */
2383
2447
  | "error.domCode" | "error.domHasCause" | "error.domCause"
2384
2448
  /** structuredClone of a %DOMException receiver (scr_error.c): WebIDL
2385
2449
  * serialization — name/message copy, the legacy code re-derives, cause
2386
2450
  * does not serialize. args are the borrowed receiver and the borrowed
2387
- * options DOM value (the DOM undefined when absent — the shared
2451
+ * options dyn value (the dyn undefined when absent — the shared
2388
2452
  * validation throws Node's exact option errors; any non-empty transfer
2389
2453
  * list throws DataCloneError, nothing static is transferable). Result
2390
2454
  * +1 %DOMException. */
2391
2455
  | "error.domClone"
2392
2456
  /** `d instanceof TypeError` (and the other BUILTIN error classes) on a
2393
2457
  * checked-dynamic value (scr_json.c): the from_error cache holds the
2394
- * DOM↔error identity edge, so the test resolves the runtime error and
2458
+ * dyn↔error identity edge, so the test resolves the runtime error and
2395
2459
  * asks its vtable's stamped preorder interval — exact for every error
2396
- * that crossed the boundary. A DOM object that never came from an
2460
+ * that crossed the boundary. A dyn object that never came from an
2397
2461
  * error (a hand-built {%error} literal) answers false: subclass
2398
2462
  * identity is unknowable there (the root keeps dynTest's marker
2399
2463
  * answer). args are the borrowed dyn and the SCR_ERR_* kind literal.
2400
2464
  * Never throws. */
2401
2465
  | "dyn.errInstanceof"
2402
2466
  /** Object.keys/values/entries over a CHECKED-DYNAMIC receiver
2403
- * (scr_json.c): the runtime walks the DOM node's own members in JS
2467
+ * (scr_json.c): the runtime walks the dyn node's own members in JS
2404
2468
  * own-key order (array-index keys ascending first, then insertion
2405
- * order) and answers a DOM array (entries: an array of [key, value]
2469
+ * order) and answers a dyn array (entries: an array of [key, value]
2406
2470
  * pairs; values RETAIN the member nodes — reference semantics, like
2407
2471
  * JS). Strings/arrays/bytes answer their index keys; other scalars an
2408
2472
  * empty array; null/undefined throw Node's catchable TypeError
@@ -2410,7 +2474,7 @@ export type IrLibFn = "island.eval"
2410
2474
  | "dyn.objKeys" | "dyn.hasOwn" | "dyn.assign"
2411
2475
  /** Variadic Object.assign over CHECKED-DYNAMIC targets (`Object.assign(
2412
2476
  * {}, ...arr.map(f), tail)` — the option-table merge): the lowering
2413
- * builds one fresh DOM pack of sources (packPush retains a plain source
2477
+ * builds one fresh dyn pack of sources (packPush retains a plain source
2414
2478
  * in; packPushSpread flattens a spread source through the spread-call
2415
2479
  * walk — V8's exact TypeError texts, the string arg spelling the spread
2416
2480
  * expression for the nullish form), so every source evaluates and
@@ -2426,19 +2490,19 @@ export type IrLibFn = "island.eval"
2426
2490
  * ("object null is not iterable (cannot read property
2427
2491
  * Symbol(Symbol.iterator))"). The frontend picks by position. */
2428
2492
  | "dyn.packPushSpreadIter" | "dyn.assignAll"
2429
- /** `Object.create(null)` (scr_json.c): a fresh NULL-PROTOTYPE DOM
2430
- * dictionary. The DOM's OBJ dispatch is already own-member-only —
2493
+ /** `Object.create(null)` (scr_json.c): a fresh NULL-PROTOTYPE dyn
2494
+ * dictionary. The checked-dynamic tree's OBJ dispatch is already own-member-only —
2431
2495
  * Node's null-proto answer — so the flag's whole job is the observations
2432
2496
  * that SEE the prototype: inspect's "[Object: null prototype]" prefix
2433
2497
  * and deepStrictEqual's prototype gate. Never throws. Static builds
2434
2498
  * only; --dynamic routes Object.create through the engine instead. */
2435
2499
  | "dyn.objCreateNullProto" | "dyn.objValues" | "dyn.objEntries"
2436
- /** structuredClone over the DOM (scr_json.c): the JSON-safe subset plus
2500
+ /** structuredClone over the checked-dynamic tree (scr_json.c): the JSON-safe subset plus
2437
2501
  * bytes (a fresh copy — a Buffer clones as a plain Uint8Array, like
2438
2502
  * Node), deep. Functions and handle kinds throw the spec's catchable
2439
- * DataCloneError; CYCLES throw the scriptc fence (the DOM cannot
2503
+ * DataCloneError; CYCLES throw the scriptc fence (the checked-dynamic tree cannot
2440
2504
  * represent them — Node clones cycles; documented divergence). The
2441
- * options DOM value validates with Node's exact errors (dictionary
2505
+ * options dyn value validates with Node's exact errors (dictionary
2442
2506
  * conversion, the transfer-sequence member; any non-empty transfer
2443
2507
  * list throws DataCloneError). dyn.cloneMissing is the zero-argument
2444
2508
  * call: always throws Node's TypeError [ERR_MISSING_ARGS] with Node's
@@ -2457,7 +2521,7 @@ export type IrLibFn = "island.eval"
2457
2521
  /** structuredClone with a NON-EMPTY transfer array of static values:
2458
2522
  * nothing static is transferable, so the call always throws Node's
2459
2523
  * catchable DataCloneError ("Found invalid value in transferList.") —
2460
- * lowered directly (the list's values need no DOM representation to
2524
+ * lowered directly (the list's values need no dyn representation to
2461
2525
  * fail). */
2462
2526
  | "dyn.cloneTransferFail"
2463
2527
  /** node:events EventEmitter (scr_events_emitter.c, link-gated by
@@ -2546,7 +2610,7 @@ export type IrLibFn = "island.eval"
2546
2610
  /** node:stream/consumers — the promise consumers over the readable
2547
2611
  * machinery: (s) → a pending promise settled at the terminal point
2548
2612
  * with the accumulated result (sc.text: the utf8 decode, sc.json: the
2549
- * parsed DOM — malformed input rejects with the parse's SyntaxError,
2613
+ * parsed dyn — malformed input rejects with the parse's SyntaxError,
2550
2614
  * sc.buffer: the concatenated bytes) or rejected with the stream's
2551
2615
  * error / ERR_STREAM_PREMATURE_CLOSE. */
2552
2616
  | "sc.text" | "sc.json" | "sc.buffer" | "readable.newDyn" | "writable.newDyn" | "duplex.newDyn" | "transform.newDyn" | "passthrough.newDyn" | "readable.initDyn" | "writable.initDyn" | "duplex.initDyn" | "transform.initDyn" | "passthrough.initDyn" | "readable.push" | "readable.pushStr" | "readable.pushNull" | "readable.pushU" | "readable.pushDyn" | "readable.unshift" | "readable.unshiftStr" | "readable.read" | "readable.pause" | "readable.resume" | "readable.setEncoding"
@@ -2611,10 +2675,10 @@ export type IrLibFn = "island.eval"
2611
2675
  * (a, b, negated, deep, msg, hasMsg) — the whole quartet over
2612
2676
  * checked-dynamic operands (both slots dyn; the frontend boxes a
2613
2677
  * static side with dynFrom first): SameValue for the strict pair over
2614
- * the DOM kinds (boxed-closure identity for functions), the structural
2615
- * DOM walk for the deep pair, with assertion_error.js's messages —
2678
+ * the dyn kinds (boxed-closure identity for functions), the structural
2679
+ * dyn walk for the deep pair, with assertion_error.js's messages —
2616
2680
  * scalar forms byte-exact, composites rendered compact:false/sorted
2617
- * through the DOM and diffed with the real myers line printer.
2681
+ * through the checked-dynamic tree and diffed with the real myers line printer.
2618
2682
  *
2619
2683
  * The assert.throws(fn, {name/code/message}) shape check
2620
2684
  * (expectedException over the static error surface): shapeBegin
@@ -2637,7 +2701,7 @@ export type IrLibFn = "island.eval"
2637
2701
  * All arguments are borrowed. */
2638
2702
  | "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
2703
  /** Node's expectsError over an error-INSTANCE expected (assert.throws/
2640
- * rejects second argument): walk the expected DOM error's keys (name,
2704
+ * rejects second argument): walk the expected dyn error's keys (name,
2641
2705
  * message, code — the %error marker skipped) and deep-compare each
2642
2706
  * against the caught value's; a mismatch throws the deep-equal
2643
2707
  * AssertionError (scr_assert.c). MAY THROW by design. */
@@ -2648,7 +2712,7 @@ export type IrLibFn = "island.eval"
2648
2712
  * ladder + line splitting; insp.regex: /source/flags; insp.buffer:
2649
2713
  * <Buffer aa ..>). insp.error renders the STACKLESS [Name: message]
2650
2714
  * form with the code slot as its one property. insp.dyn walks the
2651
- * checked-dynamic DOM entirely in the runtime (its shape lives in the
2715
+ * checked-dynamic tree entirely in the runtime (its shape lives in the
2652
2716
  * value); insp.dynS is format's %s twin (dyn strings pass verbatim).
2653
2717
  * insp.jsval ([value, recurse, depth], --dynamic only) renders the
2654
2718
  * island scalars and THROWS a catchable TypeError on composites (the
@@ -2656,7 +2720,7 @@ export type IrLibFn = "island.eval"
2656
2720
  * engine from the compiler-synthesized per-type traversal helpers
2657
2721
  * (%util.insp.N — the deepStrictEqual precedent). */
2658
2722
  | "insp.f64"
2659
- /** util.format %j over a checked-dynamic argument: the runtime DOM
2723
+ /** util.format %j over a checked-dynamic argument: the runtime dyn
2660
2724
  * walk (JS-exact stringify; root undefined/function prints
2661
2725
  * "undefined"; a handle in the tree throws the loud fence). */
2662
2726
  | "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 +2760,7 @@ export type IrLibFn = "island.eval"
2696
2760
  /** node:diagnostics_channel (scr_dc.c, linked when any dc.* appears —
2697
2761
  * the zlib gating precedent): a process-global name→channel registry;
2698
2762
  * channel values are f64 handles (types.ts maps Channel to F64, the
2699
- * readline.Interface pattern). Subscribers are DOM function values —
2763
+ * readline.Interface pattern). Subscribers are dyn function values —
2700
2764
  * identity-compared by unsubscribe, called (message, name) by publish
2701
2765
  * over a SNAPSHOT of the list (a subscriber unsubscribing itself
2702
2766
  * mid-publish still lets its siblings fire, Node's behavior). dc.publish
@@ -2707,23 +2771,23 @@ export type IrLibFn = "island.eval"
2707
2771
  | "dc.channel" | "dc.subscribe" | "dc.unsubscribe" | "dc.hasSubscribers" | "dc.publish" | "dc.chanSubscribe" | "dc.chanUnsubscribe" | "dc.chanHasSubscribers" | "dc.chanName"
2708
2772
  /** TracingChannel (dc.tracingChannel): a registry entry of the five
2709
2773
  * event channels, an f64 handle like Channel (types.ts). tcSubscribe/
2710
- * tcUnsubscribe walk a DOM handlers object's five event keys (truthy
2774
+ * tcUnsubscribe walk a dyn handlers object's five event keys (truthy
2711
2775
  * non-function slots throw the per-channel ERR_INVALID_ARG_TYPE);
2712
2776
  * tcTraceSync/tcTraceCallback/tcTracePromise run Node's publish choreography in C over
2713
- * DOM values (fn, ctx, thisArg, args-array) with thisArg bound as the
2777
+ * dyn values (fn, ctx, thisArg, args-array) with thisArg bound as the
2714
2778
  * ambient receiver — the traced call's throw and any subscriber throw
2715
2779
  * both propagate (MAY THROW). tcTraceCallback wraps args[position] in a
2716
2780
  * native error/result + asyncStart/asyncEnd publisher and throws Node's
2717
2781
  * TypeError when that slot is not callable. tracingChannelOf is the
2718
2782
  * five-Channel collection form of the constructor. */
2719
- /** setImmediate as a first-class DOM value (scr_async.c): a minted dyn
2783
+ /** setImmediate as a first-class dyn value (scr_async.c): a minted dyn
2720
2784
  * callable scheduling args[0](args[1..]) on the immediate queue — the
2721
2785
  * Node-suite traceCallback shape (`traceCallback(setImmediate, ...)`).
2722
2786
  * Calling it validates the callback (the dyn call machinery); minting
2723
2787
  * never throws. */
2724
2788
  | "timers.setImmediateFnValue"
2725
2789
  /** `new Promise(setImmediate)` (the Node-suite early-exit shape): a
2726
- * fresh promise an immediate fulfills with the undefined DOM value —
2790
+ * fresh promise an immediate fulfills with the undefined dyn value —
2727
2791
  * the executor IS setImmediate, so resolve rides the immediate queue
2728
2792
  * (scr_async.c). Never throws. */
2729
2793
  | "timers.immediatePromise" | "dc.tracingChannel" | "dc.tracingChannelOf" | "dc.tcChannel" | "dc.tcHasSubscribers" | "dc.tcSubscribe" | "dc.tcUnsubscribe" | "dc.tcTraceSync" | "dc.tcTraceCallback"
@@ -2737,11 +2801,11 @@ export type IrLibFn = "island.eval"
2737
2801
  /** AsyncLocalStorage (node:async_hooks — scr_async.c): stores are f64
2738
2802
  * handles; contexts are immutable fiber-carried snapshots (spawned
2739
2803
  * fibers inherit the spawner's — Node's init-time capture). run/exit
2740
- * enter (or clear) the store, call the DOM function with forwarded
2804
+ * enter (or clear) the store, call the dyn function with forwarded
2741
2805
  * arguments, and restore (the finally); getStore answers the current
2742
- * DOM value or undefined; enterWith installs with no restore point.
2806
+ * dyn value or undefined; enterWith installs with no restore point.
2743
2807
  * run/exit MAY THROW (the callback's own throws propagate). */
2744
- /** `await v` over a checked-dynamic VALUE (scr_async.c): a DOM promise
2808
+ /** `await v` over a checked-dynamic VALUE (scr_async.c): a dyn promise
2745
2809
  * adopts (rejections re-throw — MAY THROW), anything else takes JS's
2746
2810
  * one-microtask non-thenable await and answers itself. Only emitted
2747
2811
  * inside async bodies (the frontend's isAsync gate). */
@@ -2756,17 +2820,28 @@ export type IrLibFn = "island.eval"
2756
2820
  * publish and the callback (MAY THROW: transforms, subscribers, and
2757
2821
  * the callback all run). */
2758
2822
  | "dc.chanBindStore" | "dc.chanUnbindStore" | "dc.chanRunStores"
2759
- /** process warnings (scr_lib.c): onWarning/offWarning register DOM
2823
+ /** process warnings (scr_lib.c): onWarning/offWarning register dyn
2760
2824
  * listeners; emitWarning applies Node's full argument grammar over the
2761
- * call's DOM argument vector (ERR_INVALID_ARG_TYPE TypeErrors — MAY
2825
+ * call's dyn argument vector (ERR_INVALID_ARG_TYPE TypeErrors — MAY
2762
2826
  * THROW; a listener throw propagates too) and always prints Node's
2763
2827
  * stderr report. Emission is synchronous (SEMANTICS.md). */
2764
2828
  | "process.onWarning" | "process.offWarning" | "process.emitWarning"
2765
- /** process.on('unhandledRejection', fn): registers a DOM listener the
2766
- * loop-end report dispatches per never-observed rejection — (reason,
2767
- * promise) — instead of printing and exiting 1 (scr_async.c). Throws
2768
- * Node's ERR_INVALID_ARG_TYPE on a non-function. */
2769
- | "process.onUnhandledRejection"
2829
+ /** process.on/once('unhandledRejection', fn): registers a dyn listener
2830
+ * the loop-end report dispatches per never-observed rejection —
2831
+ * (reason, promise) — instead of printing and exiting 1 (scr_async.c).
2832
+ * The bool second arg is `once` (auto-removed after one delivery,
2833
+ * Node's once); off/removeListener remove by closure identity, the
2834
+ * offWarning stance. Throws Node's ERR_INVALID_ARG_TYPE on a
2835
+ * non-function. */
2836
+ | "process.onUnhandledRejection" | "process.offUnhandledRejection"
2837
+ /** process.on/once/off('rejectionHandled', fn): the sibling registry.
2838
+ * Under the loop-exhaustion rejection model the event has exactly ONE
2839
+ * firing window — a handler attached DURING an unhandledRejection
2840
+ * listener (Node's other windows, later turns, don't exist here: a
2841
+ * rejection handled before exhaustion never enters the report at all —
2842
+ * the documented end-of-turn divergence). Dispatch is synchronous at
2843
+ * the attach, with the promise, Node's payload. */
2844
+ | "process.onRejectionHandled" | "process.offRejectionHandled"
2770
2845
  /** The Number statics with a static C implementation (scr_lib.c): one
2771
2846
  * f64 arg → bool, JS-exact BY CONSTRUCTION — Number.isFinite/isNaN/
2772
2847
  * isInteger/isSafeInteger never coerce, and the frontend routes only
@@ -3159,11 +3234,24 @@ export type IrExpr =
3159
3234
  * ""/0/NaN/false falsy, object arms truthy), extract the arm when
3160
3235
  * truthy (+1 for ref kinds — the only truthy values live in that arm),
3161
3236
  * evaluate d lazily otherwise. JS value semantics exactly; `nullish`'s
3162
- * sibling with truthiness in place of the unit-tag test. */
3237
+ * sibling with truthiness in place of the unit-tag test.
3238
+ *
3239
+ * `retag` widens that to the case where the checker types the result as
3240
+ * ANOTHER UNION (`process.env.X || null` is `string | null`; `||
3241
+ * 3000` is `string | number`): `type` is then that union and the truthy
3242
+ * side hands the whole left box to the named union→union retag helper
3243
+ * instead of extracting one arm, so u may have any number of non-unit
3244
+ * arms. The helper's stranded-unit-arm throw is unreachable here BY
3245
+ * CONSTRUCTION — the truthiness test has already ruled those arms out,
3246
+ * which is exactly why the left cannot be coerced eagerly into a target
3247
+ * the checker built by DROPPING them. The helper consumes its argument
3248
+ * (the ordinary call convention), so the truthy side must not also
3249
+ * release the left. */
3163
3250
  | {
3164
3251
  kind: "orDefault";
3165
3252
  left: IrExpr;
3166
3253
  right: IrExpr;
3254
+ retag?: string;
3167
3255
  type: IrType;
3168
3256
  loc: SrcLoc;
3169
3257
  }
@@ -3730,13 +3818,13 @@ export type IrExpr =
3730
3818
  * struct slot), then the overflow map on index-signature shapes. `type`
3731
3819
  * is the CHECKER's type for the access: the index signature's value type
3732
3820
  * (dyn for `unknown`; with noUncheckedIndexedAccess, its
3733
- * `V | undefined` union). A MISSING key produces: the undefined DOM
3821
+ * `V | undefined` union). A MISSING key produces: the undefined dyn
3734
3822
  * singleton when `type` is dyn; the undefined arm when `type` is an
3735
3823
  * undefined-armed union; otherwise a TRAP — the checker claimed V and no
3736
3824
  * undefined is representable (the array OOB policy; on declared-only
3737
3825
  * shapes tsc's keyof check makes the trap unreachable without an `as`
3738
3826
  * smuggle). Declared-field values surface as `type`: V-typed fields read
3739
- * directly, dyn results build a DOM COPY of the field value (the dynFrom
3827
+ * directly, dyn results build a dyn COPY of the field value (the dynFrom
3740
3828
  * conversion — deep for composites, documented), union results wrap.
3741
3829
  * The key and object are borrowed; refcounted results are owned (+1).
3742
3830
  * `overflowOnly` (set when the key is a LITERAL that names no declared
@@ -3751,17 +3839,17 @@ export type IrExpr =
3751
3839
  type: IrType;
3752
3840
  loc: SrcLoc;
3753
3841
  }
3754
- /** Static value → dyn DOM conversion (`type` is always dyn): the operand
3842
+ /** Static value → dyn conversion (`type` is always dyn): the operand
3755
3843
  * (a JSON-safe type — f64/string/bool/record/array/union, validated)
3756
- * converts to a fresh DOM tree, DEEP-COPYING composites (the jsMarshal
3844
+ * converts to a fresh dyn tree, DEEP-COPYING composites (the jsMarshal
3757
3845
  * aliasing stance; a dyn value can never alias static storage). An
3758
- * undefined-armed union's undefined arm becomes the undefined DOM
3846
+ * undefined-armed union's undefined arm becomes the undefined dyn
3759
3847
  * singleton. A FUNCTION operand (canBoxFuncIntoDyn — the mustCall shape:
3760
3848
  * a typed closure flowing into an untyped JS helper's implicit-any
3761
- * param) BOXES instead of copying: the DOM's function kind carries the
3849
+ * param) BOXES instead of copying: the checked-dynamic tree's function kind carries the
3762
3850
  * retained closure, a compiled per-signature call thunk (per-argument
3763
3851
  * dynCheck into the declared param types, result dynFrom'd back — JS
3764
- * arity: extras ignored, missing args are the undefined DOM value and
3852
+ * arity: extras ignored, missing args are the undefined dyn value and
3765
3853
  * must satisfy the param's type or the thunk throws the catchable
3766
3854
  * TypeError), the interned signature key (dynCheck's exact-unwrap fast
3767
3855
  * path), and `fnName` — the best-effort static spelling for inspect
@@ -3774,14 +3862,14 @@ export type IrExpr =
3774
3862
  type: IrType;
3775
3863
  loc: SrcLoc;
3776
3864
  }
3777
- /** Island value → dyn DOM conversion (`type` is always dyn; the operand
3778
- * is always jsval): the jsval→DOM crossing — an 'any'-typed engine
3865
+ /** Island value → dyn conversion (`type` is always dyn; the operand
3866
+ * is always jsval): the jsval→dyn crossing — an 'any'-typed engine
3779
3867
  * value flowing into an 'unknown'/'object'/JS-residue slot wraps BY
3780
- * REFERENCE as the DOM's SCR_DYN_JSVAL kind (scr_dyn_from_jsval).
3868
+ * REFERENCE as the checked-dynamic tree's SCR_DYN_JSVAL kind (scr_dyn_from_jsval).
3781
3869
  * Engine scalars (number/string/boolean/null/undefined) normalize to
3782
- * the native DOM kinds at wrap time, so wrapped nodes only ever hold
3870
+ * the native dyn kinds at wrap time, so wrapped nodes only ever hold
3783
3871
  * engine objects/arrays/functions; typeof/truthiness/String()/=== on
3784
- * the wrapped node route to the engine, un-armed DOM walks fence
3872
+ * the wrapped node route to the engine, un-armed dyn walks fence
3785
3873
  * loudly, and scr_jsval_from_dyn unwraps the SAME engine value back
3786
3874
  * (identity round trip). The operand is borrowed; the result is owned
3787
3875
  * (+1). Never throws. */
@@ -3791,7 +3879,7 @@ export type IrExpr =
3791
3879
  type: IrType;
3792
3880
  loc: SrcLoc;
3793
3881
  }
3794
- /** CALLING a dyn DOM value — `fn(a, b)` where fn is checked-dynamic (an
3882
+ /** CALLING a dyn value — `fn(a, b)` where fn is checked-dynamic (an
3795
3883
  * implicit-any JS binding, a dyn record member, a dynKeyGet result).
3796
3884
  * Arguments are ALREADY dyn-typed (typed values box through dynFrom at
3797
3885
  * the call's coercion — function args included); `type` is always dyn.
@@ -3806,8 +3894,8 @@ export type IrExpr =
3806
3894
  * args are borrowed; the result is owned (+1). MAY THROW.
3807
3895
  *
3808
3896
  * `spreads` (the runtime-arity form — `f(...args)`, the rest-forwarding
3809
- * idiom): entries name indices into `args` whose DOM values FLATTEN into
3810
- * the argument vector at the call — JS's spread over the DOM's iterable
3897
+ * idiom): entries name indices into `args` whose dyn values FLATTEN into
3898
+ * the argument vector at the call — JS's spread over the checked-dynamic tree's iterable
3811
3899
  * kinds (arrays element-by-element, strings by code point, bytes by
3812
3900
  * byte; every other kind throws V8's exact spread-call TypeError,
3813
3901
  * catchably — `what` is the spread expression's source spelling, which
@@ -3827,7 +3915,7 @@ export type IrExpr =
3827
3915
  loc: SrcLoc;
3828
3916
  }
3829
3917
  /** Prototype-method DISPATCH on a dyn receiver — `recv.m(...)` where `m`
3830
- * is a name a DOM-representable prototype declares (Array/String/
3918
+ * is a name a dyn-representable prototype declares (Array/String/
3831
3919
  * Function shared names: push, slice, join, forEach, map, apply, ...),
3832
3920
  * so a stored-member read would silently mis-answer real methods. The
3833
3921
  * runtime (scr_dyn_invoke) dispatches on the receiver's KIND:
@@ -3848,7 +3936,7 @@ export type IrExpr =
3848
3936
  type: IrType;
3849
3937
  loc: SrcLoc;
3850
3938
  }
3851
- /** A DOM ARRAY built element-by-element (JS mixed-element literals —
3939
+ /** A dyn ARRAY built element-by-element (JS mixed-element literals —
3852
3940
  * `['pwd', []]` — and evolving `[]` declarations): each element is
3853
3941
  * already a dyn value; the result owns them. Never throws. */
3854
3942
  | {
@@ -3857,7 +3945,7 @@ export type IrExpr =
3857
3945
  type: IrType;
3858
3946
  loc: SrcLoc;
3859
3947
  }
3860
- /** A DOM OBJECT built member-by-member. With no `fields` it is the empty
3948
+ /** A dyn OBJECT built member-by-member. With no `fields` it is the empty
3861
3949
  * object (the JS stand-in for opaque container values — `new WeakMap()`
3862
3950
  * in harness code: the value exists for identity; every reached METHOD
3863
3951
  * use meets its own fence). With `fields` it is a JS object literal whose
@@ -3868,7 +3956,7 @@ export type IrExpr =
3868
3956
  * JS's ToPropertyKey on the string side), each value is already dyn, and
3869
3957
  * entries evaluate key-then-value in SOURCE order (JS's object-literal
3870
3958
  * evaluation order; later duplicate keys win, insertion order preserved —
3871
- * the DOM's own set semantics). Keys and values are borrowed (the member
3959
+ * the checked-dynamic tree's own set semantics). Keys and values are borrowed (the member
3872
3960
  * retains the value in). Never throws itself. */
3873
3961
  | {
3874
3962
  kind: "dynObjLit";
@@ -3879,32 +3967,32 @@ export type IrExpr =
3879
3967
  type: IrType;
3880
3968
  loc: SrcLoc;
3881
3969
  }
3882
- /** Runtime kind test on a dyn DOM value — the narrowing tests tsc's
3970
+ /** Runtime kind test on a dyn value — the narrowing tests tsc's
3883
3971
  * control flow understands on `unknown`: `typeof v === "string" |
3884
3972
  * "number" | "boolean" | "undefined"` and the unit comparisons `v ===
3885
3973
  * undefined` / `v === null` (`"nullish"` is the LOOSE `v == null` pair —
3886
3974
  * undefined or null in one test), and `v instanceof Uint8Array`
3887
- * (`"bytes"` — the DOM's bytes kind; Node's Buffer IS a Uint8Array
3975
+ * (`"bytes"` — the checked-dynamic tree's bytes kind; Node's Buffer IS a Uint8Array
3888
3976
  * subclass and both worlds answer true for it, SEMANTICS.md 45), plus
3889
3977
  * the two object-family tests: `"object"` is `typeof v === "object"`
3890
- * exactly (true for the DOM's object, array, bytes, AND null kinds —
3978
+ * exactly (true for the checked-dynamic tree's object, array, bytes, AND null kinds —
3891
3979
  * JS's oldest wart preserved), `"array"` is `Array.isArray(v)` (the
3892
- * array kind alone), and `"truthy"` is ToBoolean over the whole DOM
3980
+ * array kind alone), and `"truthy"` is ToBoolean over the whole dyn
3893
3981
  * (`if (v)` on unknown): undefined/null false, bool by value, number
3894
3982
  * falsy exactly for 0, -0, and NaN, string falsy exactly when empty,
3895
3983
  * object/array/bytes always true — JS-exact for every kind. A pure
3896
- * kind-tag compare against the DOM node's kind (truthy also reads the
3984
+ * kind-tag compare against the dyn node's kind (truthy also reads the
3897
3985
  * scalar payload); the operand is
3898
3986
  * borrowed, nothing allocates, never throws. Result is bool. Narrowed
3899
3987
  * READS afterwards bridge through `dynCheck` extraction
3900
3988
  * (trust-but-VERIFY: unlike unionNarrow, a read reached with a lying
3901
3989
  * kind throws instead of misreading the payload). `"error"` is
3902
- * `v instanceof Error` on an unknown value: true exactly for the DOM's
3990
+ * `v instanceof Error` on an unknown value: true exactly for the checked-dynamic tree's
3903
3991
  * error encoding — an object carrying the reserved "%error" key, the
3904
3992
  * shape caughtToDyn builds for Error payloads (SEMANTICS.md 67) — so a
3905
3993
  * caught Error passed through an unknown slot answers true like Node;
3906
3994
  * dynCheck against %Error extracts it. `"function"` is `typeof v ===
3907
- * "function"` — true exactly for the DOM's function kind (boxed
3995
+ * "function"` — true exactly for the checked-dynamic tree's function kind (boxed
3908
3996
  * closures); function values are truthy and answer FALSE to the
3909
3997
  * `"object"` test, JS-exact. */
3910
3998
  | {
@@ -3915,7 +4003,7 @@ export type IrExpr =
3915
4003
  type: IrType;
3916
4004
  loc: SrcLoc;
3917
4005
  }
3918
- /** Keyed read on a dyn DOM value — `pkg.name` / `pkg["k"]` / the
4006
+ /** Keyed read on a dyn value — `pkg.name` / `pkg["k"]` / the
3919
4007
  * `pkg?.scripts` chain step on a JSON.parse result. `key` is
3920
4008
  * string-typed (a strLit for the dot form); `type` is always dyn. An
3921
4009
  * OBJ receiver answers the member (+1) or the undefined singleton (the
@@ -3937,9 +4025,9 @@ export type IrExpr =
3937
4025
  type: IrType;
3938
4026
  loc: SrcLoc;
3939
4027
  }
3940
- /** `"k" in pkg` on a dyn DOM receiver (literal keys only): OBJ answers
4028
+ /** `"k" in pkg` on a dyn receiver (literal keys only): OBJ answers
3941
4029
  * own-member presence (a member holding the undefined value still
3942
- * answers true — the DOM stores presence, unlike the record form's
4030
+ * answers true — the checked-dynamic tree stores presence, unlike the record form's
3943
4031
  * SEMANTICS.md 55 stance), ARR answers true for "length" and canonical
3944
4032
  * in-range indices, everything else answers false (tsc admits `in`
3945
4033
  * only on object-typed operands, so unit receivers — where JS throws —
@@ -3953,16 +4041,16 @@ export type IrExpr =
3953
4041
  type: IrType;
3954
4042
  loc: SrcLoc;
3955
4043
  }
3956
- /** Strict equality between a dyn DOM value and a SCALAR-typed value
4044
+ /** Strict equality between a dyn value and a SCALAR-typed value
3957
4045
  * (`v !== ""`, `v === 5` — one side `unknown`, the other f64/string/
3958
4046
  * bool): a guarded kind test plus payload compare — true exactly when
3959
- * the DOM holds that scalar kind AND the payloads are strictly equal
4047
+ * the checked-dynamic tree holds that scalar kind AND the payloads are strictly equal
3960
4048
  * (C == for numbers: NaN false, ±0 equal — JS-exact; bytewise for
3961
4049
  * strings). `left`/`right` keep SOURCE order (evaluation order is
3962
4050
  * JS's); at least one side is dyn-typed — BOTH-dyn compares run the
3963
- * runtime's whole-DOM strict equality (scr_dyn_strict_eq: scalars by
4051
+ * runtime's whole-dyn strict equality (scr_dyn_strict_eq: scalars by
3964
4052
  * value, units by kind, reference kinds by node identity — JS-exact
3965
- * within the DOM's aliasing story). Both operands are borrowed,
4053
+ * within the checked-dynamic tree's aliasing story). Both operands are borrowed,
3966
4054
  * nothing allocates, never throws. Result is bool. */
3967
4055
  | {
3968
4056
  kind: "dynScalarEq";
@@ -3993,7 +4081,7 @@ export type IrExpr =
3993
4081
  * 'FIRSTPROP' of 'SPELLING' …" when `firstProp` is set (V8 names the
3994
4082
  * pattern's first property) — and yields the value unchanged otherwise.
3995
4083
  * `spelling` is the RHS's compile-time source spelling. Value and type
3996
- * are dyn (the DOM helper) or jsval (the island's prelude guard —
4084
+ * are dyn (the dyn helper) or jsval (the island's prelude guard —
3997
4085
  * engine-thrown, catchable like every boundary throw). */
3998
4086
  | {
3999
4087
  kind: "dynDestrCheck";
@@ -4004,12 +4092,12 @@ export type IrExpr =
4004
4092
  loc: SrcLoc;
4005
4093
  }
4006
4094
  /** GetIterator + the first `count` steps, as array destructuring sees
4007
- * it. Over a DOM value: arrays step by index, strings by code point,
4095
+ * it. Over a dyn value: arrays step by index, strings by code point,
4008
4096
  * Buffers by byte; everything else throws V8's exact "<desc> is not
4009
4097
  * iterable (cannot read property Symbol(Symbol.iterator))" TypeError.
4010
4098
  * Over an island (jsval) value the engine runs the REAL iterator
4011
4099
  * protocol (user iterables included, IteratorClose per spec) behind the
4012
- * same V8 message for non-iterables. The result is a FRESH array (DOM
4100
+ * same V8 message for non-iterables. The result is a FRESH array (dyn
4013
4101
  * or engine, matching the operand) of exactly `count` elements
4014
4102
  * (undefined-padded past the end) — the empty pattern passes count 0
4015
4103
  * and uses only the validation. Value is borrowed; the result is owned
@@ -4093,16 +4181,16 @@ export type IrExpr =
4093
4181
  loc: SrcLoc;
4094
4182
  }
4095
4183
  /** A catch binding flowing into an `unknown` slot (`options.onError?.(e)`
4096
- * — the caught snapshot converting to a dyn DOM value, the typed→unknown
4184
+ * — the caught snapshot converting to a dyn value, the typed→unknown
4097
4185
  * deep-copy stance extended to exception payloads, SEMANTICS.md 67).
4098
4186
  * Runtime dispatch on the snapshot's kind: string/number/boolean payloads
4099
- * become the exact DOM scalars; an Error-family OBJ payload becomes the
4100
- * DOM's error encoding — an object with the reserved "%error" marker key
4187
+ * become the exact dyn scalars; an Error-family OBJ payload becomes the
4188
+ * dyn's error encoding — an object with the reserved "%error" marker key
4101
4189
  * plus "name"/"message" (and "code" when stamped), so `instanceof Error`
4102
4190
  * (dynTest "error"), the %Error dynCheck extraction, and String() answer
4103
4191
  * like Node; every other payload (records, arrays, closures, unions,
4104
4192
  * non-Error hierarchy objects — type-erased at runtime) becomes an EMPTY
4105
- * DOM object: truthy, typeof "object", fields unreadable — the
4193
+ * dyn object: truthy, typeof "object", fields unreadable — the
4106
4194
  * "[object Object]" approximation, documented. `value` is a caught-typed
4107
4195
  * varRef (borrowed); `type` is dyn; the result is a fresh tree (+1),
4108
4196
  * never aliasing the payload. Never throws. */
@@ -4272,7 +4360,7 @@ export type IrExpr =
4272
4360
  loc: SrcLoc;
4273
4361
  }
4274
4362
  /** The dynamic-boundary check — a CHECKED cast `dynValue as T`: validate
4275
- * the dyn value's JSON DOM against `type` (a non-dyn, JSON-representable
4363
+ * the dyn value's JSON dyn against `type` (a non-dyn, JSON-representable
4276
4364
  * IR type) and BUILD the typed value (+1), or THROW a catchable
4277
4365
  * TypeError-flavored, path-annotated string ("TypeError: expected number
4278
4366
  * at $.items[2].price, got string") through the exception cell. Semantics:
@@ -4282,7 +4370,7 @@ export type IrExpr =
4282
4370
  * missing key for an undefined-armed union field — an optional field —
4283
4371
  * builds the interned undefined arm instead); arrays check every element;
4284
4372
  * unions try arms in canonical order and the first FULL match wins (no
4285
- * match → throw; an undefined arm matches no DOM value); JSON null matches
4373
+ * match → throw; an undefined arm matches no dyn value); JSON null matches
4286
4374
  * exactly the nullT arm of a union target (bare null targets cannot
4287
4375
  * exist). MAY THROW:
4288
4376
  * backends' may-throw analyses must treat it like a `throw` statement.
@@ -4501,7 +4589,7 @@ export declare function islandCallbackRet(t: IrType, getRecord: (shapeId: string
4501
4589
  * (no per-type extraction exists for them inside a host call). */
4502
4590
  export declare function canMarshalTypedFuncIntoIsland(t: IrType, getRecord: (shapeId: string) => IrRecordShape | undefined, getUnion: (unionId: string) => IrUnionDef | undefined): boolean;
4503
4591
  /** The runtime HANDLE kinds that cross the checked-dynamic boundary as
4504
- * the DOM's HANDLE kind (SCR_DYN_HANDLE): boxed by REFERENCE (identity —
4592
+ * the checked-dynamic tree's HANDLE kind (SCR_DYN_HANDLE): boxed by REFERENCE (identity —
4505
4593
  * stateful I/O objects never copy), unboxed by tag check, members
4506
4594
  * dispatched at runtime onto the same entry points the static lowerings
4507
4595
  * use. The set is deliberately the handles whose member surfaces have
@@ -4514,7 +4602,7 @@ export declare const DYN_HANDLE_KINDS: ReadonlyMap<string, {
4514
4602
  tag: string;
4515
4603
  cls: string;
4516
4604
  }>;
4517
- /** A static type that CONVERTS into a dyn DOM value — the dynFrom domain:
4605
+ /** A static type that CONVERTS into a dyn value — the dynFrom domain:
4518
4606
  * JSON-safe data, bytes<u8> (payload copied), undefined-armed unions of
4519
4607
  * JSON-safe arms, boxable function types, and the runtime HANDLE kinds
4520
4608
  * (boxed by reference — DYN_HANDLE_KINDS). */
@@ -4525,7 +4613,7 @@ export declare function canConvertToDyn(t: IrType, getRecord: (shapeId: string)
4525
4613
  * and the runtime HANDLE kinds (a tag-checked reference unwrap —
4526
4614
  * DYN_HANDLE_KINDS). */
4527
4615
  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 DOM's function kind (dynFrom):
4616
+ /** A closure type that can BOX into the checked-dynamic tree's function kind (dynFrom):
4529
4617
  * every param dyn or dynCheckable (the thunk validates dyn arguments into
4530
4618
  * them), return void, dyn, or dyn-convertible (the thunk converts it
4531
4619
  * back). */
@@ -4548,6 +4636,12 @@ export declare function canMarshalIntoIsland(t: IrType, getRecord: (shapeId: str
4548
4636
  * null and data ride the round trip into the union's dynCheck. The
4549
4637
  * package-API shape `result.headers` : `Record<string, string> |
4550
4638
  * undefined` is the motivating case. */
4639
+ /** The static-promise→engine bridge's payload domain: the fulfillment
4640
+ * types a scriptc promise may deliver INTO the island as a real engine
4641
+ * thenable (scr_jsval_from_promise — the async-callback return bridge,
4642
+ * reused by promise VALUES crossing at jsvalIn edges and the island
4643
+ * Promise.all arm). Null = outside the domain (the boundary fence). */
4644
+ export declare function islandPromisePayloadTag(inner: IrType): "void" | "f64" | "bool" | "string" | "jsval" | "jsvalArr" | null;
4551
4645
  export declare function canExitIslandToType(t: IrType, getRecord: (shapeId: string) => IrRecordShape | undefined, getUnion: (unionId: string) => IrUnionDef | undefined): boolean;
4552
4646
  /** True when the module contains any regex construct — a regexLit /
4553
4647
  * regexIntrinsic node or a regex-typed slot anywhere. This is the link
@@ -4634,7 +4728,7 @@ export declare function moduleUsesDynInvoke(mod: IrModule): boolean;
4634
4728
  * precedent — inspect-free binaries keep the historical command line and
4635
4729
  * size class). Same walk shape as moduleUsesZlib. */
4636
4730
  /** True when the module needs scr_async_dyn.c — the checked-dynamic
4637
- * async surfaces (DOM-promise then/catch/finally reactions, await of a
4731
+ * async surfaces (dyn-promise then/catch/finally reactions, await of a
4638
4732
  * dyn value, `new Promise(setImmediate)`, AsyncLocalStorage, the
4639
4733
  * unhandledRejection/warning process events). Also pulled by the
4640
4734
  * dynInvoke and dc gates (their TUs call into this one) — cc.ts. Same
@@ -4705,6 +4799,14 @@ export declare function moduleUsesHttp2(mod: IrModule): boolean;
4705
4799
  * true for these, so scr_net.c and scr_http.c come along). TLS-free
4706
4800
  * programs keep their exact link line and never build mbedTLS. */
4707
4801
  export declare function moduleUsesTls(mod: IrModule): boolean;
4802
+ /** True when the module contains any tlsca.* libCall — the link switch
4803
+ * for scr_tls_ca.c, the CA-store introspection unit (getCACertificates /
4804
+ * rootCertificates / setDefaultCACertificates). Deliberately SEPARATE
4805
+ * from moduleUsesTls: the unit is plain PEM-block bookkeeping, so a
4806
+ * program that only inspects the CA store never pulls mbedTLS. cc.ts
4807
+ * also compiles the unit whenever TLS itself links — scr_tls.c consults
4808
+ * the unit's default-set override for its trust anchors. */
4809
+ export declare function moduleUsesTlsCa(mod: IrModule): boolean;
4708
4810
  /** First async/event-loop/ambient-process surface the module graph
4709
4811
  * reaches, or null when the graph is async_free (the v1 library requirement).
4710
4812
  * The generic-walk shape of moduleUsesRegex, tracking the nearest