@scriptc/compiler 0.1.2 → 0.1.4
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 +258 -64
- package/dist/backend/c/async.d.ts +30 -0
- package/dist/backend/c/async.js +224 -0
- package/dist/backend/c/async.js.map +1 -1
- package/dist/backend/c/c-emitter.d.ts +13 -0
- package/dist/backend/c/c-emitter.js +28 -9
- package/dist/backend/c/c-emitter.js.map +1 -1
- package/dist/backend/c/exprs.d.ts +8 -1
- package/dist/backend/c/exprs.js +445 -60
- package/dist/backend/c/exprs.js.map +1 -1
- package/dist/backend/c/shapes.js +15 -13
- package/dist/backend/c/shapes.js.map +1 -1
- package/dist/backend/c/types.d.ts +4 -0
- package/dist/backend/c/types.js +20 -1
- package/dist/backend/c/types.js.map +1 -1
- package/dist/backend/c/types.test.js +8 -1
- package/dist/backend/c/types.test.js.map +1 -1
- package/dist/backend/c/walkers.js +32 -11
- package/dist/backend/c/walkers.js.map +1 -1
- package/dist/backend/json-literal.d.ts +7 -0
- package/dist/backend/json-literal.js +17 -0
- package/dist/backend/json-literal.js.map +1 -0
- package/dist/backend/json-literal.test.d.ts +1 -0
- package/dist/backend/json-literal.test.js +17 -0
- package/dist/backend/json-literal.test.js.map +1 -0
- package/dist/backend/link-plan.d.ts +2 -1
- package/dist/backend/link-plan.js +6 -1
- package/dist/backend/link-plan.js.map +1 -1
- package/dist/backend/llvm/classes.js +8 -7
- package/dist/backend/llvm/classes.js.map +1 -1
- package/dist/backend/llvm/common.d.ts +4 -0
- package/dist/backend/llvm/common.js +6 -0
- package/dist/backend/llvm/common.js.map +1 -1
- package/dist/backend/llvm/common.test.d.ts +1 -0
- package/dist/backend/llvm/common.test.js +9 -0
- package/dist/backend/llvm/common.test.js.map +1 -0
- package/dist/backend/llvm/dyn.d.ts +4 -0
- package/dist/backend/llvm/dyn.js +24 -13
- package/dist/backend/llvm/dyn.js.map +1 -1
- package/dist/backend/llvm/emitter.js +54 -12
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/backend/llvm/expr-bytes.d.ts +1 -1
- package/dist/backend/llvm/expr-bytes.js +8 -8
- package/dist/backend/llvm/expr-bytes.js.map +1 -1
- package/dist/backend/llvm/expr-callbacks.d.ts +9 -0
- package/dist/backend/llvm/expr-callbacks.js +125 -0
- package/dist/backend/llvm/expr-callbacks.js.map +1 -1
- package/dist/backend/llvm/expr-context.d.ts +18 -2
- package/dist/backend/llvm/expr-dispatch.js +1 -0
- package/dist/backend/llvm/expr-dispatch.js.map +1 -1
- package/dist/backend/llvm/expr-dynamic.js +9 -0
- package/dist/backend/llvm/expr-dynamic.js.map +1 -1
- package/dist/backend/llvm/expr-primitives.d.ts +1 -1
- package/dist/backend/llvm/expr-primitives.js +38 -9
- package/dist/backend/llvm/expr-primitives.js.map +1 -1
- package/dist/backend/llvm/expr-primitives.test.d.ts +1 -0
- package/dist/backend/llvm/expr-primitives.test.js +38 -0
- package/dist/backend/llvm/expr-primitives.test.js.map +1 -0
- package/dist/backend/llvm/expr-records.js +3 -3
- package/dist/backend/llvm/expr-records.js.map +1 -1
- package/dist/backend/llvm/expr-stream-bridges.js +2 -1
- package/dist/backend/llvm/expr-stream-bridges.js.map +1 -1
- package/dist/backend/llvm/expr-stream-callbacks.d.ts +6 -0
- package/dist/backend/llvm/expr-stream-callbacks.js +122 -0
- package/dist/backend/llvm/expr-stream-callbacks.js.map +1 -1
- package/dist/backend/llvm/lib-dispatch.js +22 -0
- package/dist/backend/llvm/lib-dispatch.js.map +1 -1
- package/dist/backend/llvm/lib-filesystem.js +68 -10
- package/dist/backend/llvm/lib-filesystem.js.map +1 -1
- package/dist/backend/llvm/lib-network.js +18 -2
- package/dist/backend/llvm/lib-network.js.map +1 -1
- package/dist/backend/llvm/lib-process.js +206 -11
- package/dist/backend/llvm/lib-process.js.map +1 -1
- package/dist/backend/llvm/lib-shared.js +82 -0
- package/dist/backend/llvm/lib-shared.js.map +1 -1
- package/dist/backend/llvm/lib-stream.js +23 -0
- package/dist/backend/llvm/lib-stream.js.map +1 -1
- package/dist/backend/llvm/shapes.js +10 -8
- package/dist/backend/llvm/shapes.js.map +1 -1
- package/dist/backend/llvm/walkers.js +7 -5
- package/dist/backend/llvm/walkers.js.map +1 -1
- package/dist/backend/native-link-info.d.ts +2 -1
- package/dist/backend/native-link-info.js +4 -0
- package/dist/backend/native-link-info.js.map +1 -1
- package/dist/backend/native-link-info.test.js +24 -1
- package/dist/backend/native-link-info.test.js.map +1 -1
- package/dist/backend/native-toolchain.d.ts +11 -6
- package/dist/backend/native-toolchain.js +30 -13
- package/dist/backend/native-toolchain.js.map +1 -1
- package/dist/backend/native-toolchain.test.js +36 -1
- package/dist/backend/native-toolchain.test.js.map +1 -1
- package/dist/backend/runtime-pack-targets.test.js +1 -1
- package/dist/backend/runtime-pack-targets.test.js.map +1 -1
- package/dist/backend/runtime-pack.test.js +29 -10
- package/dist/backend/runtime-pack.test.js.map +1 -1
- package/dist/backend/targets.d.ts +9 -0
- package/dist/backend/targets.js +22 -0
- package/dist/backend/targets.js.map +1 -1
- package/dist/backend/targets.test.js +13 -1
- package/dist/backend/targets.test.js.map +1 -1
- package/dist/coverage/surface-manifest.js +9 -0
- package/dist/coverage/surface-manifest.js.map +1 -1
- package/dist/diagnostics/diagnostic.js +4 -4
- package/dist/diagnostics/diagnostic.js.map +1 -1
- package/dist/executable/executable-cache.d.ts +3 -0
- package/dist/executable/executable-cache.js +4 -0
- package/dist/executable/executable-cache.js.map +1 -1
- package/dist/executable/executable-cache.test.js +1 -0
- package/dist/executable/executable-cache.test.js.map +1 -1
- package/dist/frontend/fork-target.d.ts +17 -0
- package/dist/frontend/fork-target.js +256 -0
- package/dist/frontend/fork-target.js.map +1 -0
- package/dist/frontend/lowering/abstract-equality.d.ts +6 -0
- package/dist/frontend/lowering/abstract-equality.js +250 -0
- package/dist/frontend/lowering/abstract-equality.js.map +1 -0
- package/dist/frontend/lowering/containers/bytes.d.ts +0 -4
- package/dist/frontend/lowering/containers/bytes.js +112 -28
- package/dist/frontend/lowering/containers/bytes.js.map +1 -1
- package/dist/frontend/lowering/lower-assert.js +87 -12
- package/dist/frontend/lowering/lower-assert.js.map +1 -1
- package/dist/frontend/lowering/lower-builtins.d.ts +72 -44
- package/dist/frontend/lowering/lower-builtins.js +1323 -165
- package/dist/frontend/lowering/lower-builtins.js.map +1 -1
- package/dist/frontend/lowering/lower-calls.d.ts +37 -27
- package/dist/frontend/lowering/lower-calls.js +682 -132
- package/dist/frontend/lowering/lower-calls.js.map +1 -1
- package/dist/frontend/lowering/lower-classes.js +39 -8
- package/dist/frontend/lowering/lower-classes.js.map +1 -1
- package/dist/frontend/lowering/lower-containers.js +162 -8
- package/dist/frontend/lowering/lower-containers.js.map +1 -1
- package/dist/frontend/lowering/lower-event-emitter.js +212 -21
- package/dist/frontend/lowering/lower-event-emitter.js.map +1 -1
- package/dist/frontend/lowering/lower-exprs.js +238 -87
- package/dist/frontend/lowering/lower-exprs.js.map +1 -1
- package/dist/frontend/lowering/lower-inspect.d.ts +4 -0
- package/dist/frontend/lowering/lower-inspect.js +8 -1
- package/dist/frontend/lowering/lower-inspect.js.map +1 -1
- package/dist/frontend/lowering/lower-island.d.ts +6 -3
- package/dist/frontend/lowering/lower-island.js +165 -6
- package/dist/frontend/lowering/lower-island.js.map +1 -1
- package/dist/frontend/lowering/lower-modules.d.ts +6 -0
- package/dist/frontend/lowering/lower-modules.js +192 -38
- package/dist/frontend/lowering/lower-modules.js.map +1 -1
- package/dist/frontend/lowering/lower-namespaces.js +7 -0
- package/dist/frontend/lowering/lower-namespaces.js.map +1 -1
- package/dist/frontend/lowering/lower-server.d.ts +1 -1
- package/dist/frontend/lowering/lower-server.js +130 -27
- package/dist/frontend/lowering/lower-server.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.d.ts +5 -4
- package/dist/frontend/lowering/lower-stmts.js +141 -21
- package/dist/frontend/lowering/lower-stmts.js.map +1 -1
- package/dist/frontend/lowering/lower-stream.d.ts +3 -0
- package/dist/frontend/lowering/lower-stream.js +7 -0
- package/dist/frontend/lowering/lower-stream.js.map +1 -1
- package/dist/frontend/lowering/lowerer.d.ts +90 -13
- package/dist/frontend/lowering/lowerer.js +416 -76
- package/dist/frontend/lowering/lowerer.js.map +1 -1
- package/dist/frontend/lowering/surfaces.d.ts +31 -3
- package/dist/frontend/lowering/surfaces.js +173 -90
- package/dist/frontend/lowering/surfaces.js.map +1 -1
- package/dist/frontend/npm-static-declarations.d.ts +4 -0
- package/dist/frontend/npm-static-declarations.js +83 -14
- package/dist/frontend/npm-static-declarations.js.map +1 -1
- package/dist/frontend/npm-static-declarations.test.js +33 -2
- package/dist/frontend/npm-static-declarations.test.js.map +1 -1
- package/dist/frontend/npm-static.js +6 -5
- package/dist/frontend/npm-static.js.map +1 -1
- package/dist/frontend/npm.d.ts +15 -3
- package/dist/frontend/npm.js +80 -8
- package/dist/frontend/npm.js.map +1 -1
- package/dist/frontend/npm.test.js +76 -9
- package/dist/frontend/npm.test.js.map +1 -1
- package/dist/frontend/program.js +110 -12
- package/dist/frontend/program.js.map +1 -1
- package/dist/frontend/resolve.d.ts +28 -7
- package/dist/frontend/resolve.js +90 -26
- package/dist/frontend/resolve.js.map +1 -1
- package/dist/frontend/resolve.test.js +21 -1
- package/dist/frontend/resolve.test.js.map +1 -1
- package/dist/frontend/type-mapper.d.ts +5 -0
- package/dist/frontend/type-mapper.js +115 -33
- package/dist/frontend/type-mapper.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +30 -3
- package/dist/index.js.map +1 -1
- package/dist/ir/analysis.js +1 -0
- package/dist/ir/analysis.js.map +1 -1
- package/dist/ir/ir.d.ts +155 -66
- package/dist/ir/ir.js +143 -6
- package/dist/ir/ir.js.map +1 -1
- package/dist/ir/ir.test.js +14 -1
- package/dist/ir/ir.test.js.map +1 -1
- package/dist/ir/serialize.d.ts +1 -1
- package/dist/ir/serialize.js +1 -1
- package/dist/ir/serialize.js.map +1 -1
- package/dist/ir/validate.js +242 -18
- package/dist/ir/validate.js.map +1 -1
- package/dist/library/int-infer.test.js +4 -4
- package/dist/library/int-infer.test.js.map +1 -1
- package/dist/library/library-cache.d.ts +1 -0
- package/dist/library/library-cache.js +1 -0
- package/dist/library/library-cache.js.map +1 -1
- package/dist/library/library-cache.test.js +18 -5
- package/dist/library/library-cache.test.js.map +1 -1
- package/package.json +17 -17
- package/surface-manifest.json +163 -54
package/dist/ir/ir.d.ts
CHANGED
|
@@ -12,6 +12,14 @@ export type IrBytesElem = "u8" | "u32" | "i32" | "f32";
|
|
|
12
12
|
export type IrType = {
|
|
13
13
|
kind: "f64";
|
|
14
14
|
}
|
|
15
|
+
/** An ECMAScript bigint primitive. Runtime values are immutable,
|
|
16
|
+
* arbitrary-precision signed integers (ScrBigInt) whose numeric value,
|
|
17
|
+
* not pointer identity, defines equality. The heap representation is an
|
|
18
|
+
* implementation detail: bigint remains a JS primitive for truthiness,
|
|
19
|
+
* typeof, comparison, inspection, and container semantics. */
|
|
20
|
+
| {
|
|
21
|
+
kind: "bigint";
|
|
22
|
+
}
|
|
15
23
|
/** The supported ES Date value slice: a scalar TimeClip'd millisecond
|
|
16
24
|
* value. Getters and toISOString observe only this slot, so copying it
|
|
17
25
|
* through locals/params/fields is exact while Date mutation and object
|
|
@@ -216,6 +224,13 @@ export type IrType = {
|
|
|
216
224
|
| {
|
|
217
225
|
kind: "childStream";
|
|
218
226
|
}
|
|
227
|
+
/** A piped child-input stream (child.stdin — spawn with a piped stdin
|
|
228
|
+
* slot; scr_child.c). Heap, refcounted, and mutable: writes queue into
|
|
229
|
+
* the platform pipe without blocking the JavaScript thread, and
|
|
230
|
+
* drain/finish/error listeners drop when the writer settles. */
|
|
231
|
+
| {
|
|
232
|
+
kind: "childWriter";
|
|
233
|
+
}
|
|
219
234
|
/** A process output stream as a FIRST-CLASS value (process.stdout /
|
|
220
235
|
* process.stderr flowing into a `NodeJS.WritableStream` slot — the
|
|
221
236
|
* prefixStream idiom). Representation is the raw FD as a double (1 or
|
|
@@ -245,21 +260,31 @@ export type IrType = {
|
|
|
245
260
|
| {
|
|
246
261
|
kind: "secureCtx";
|
|
247
262
|
}
|
|
248
|
-
/**
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
263
|
+
/** A node:crypto Hash or Hmac handle (scr_lib.c): heap, refcounted,
|
|
264
|
+
* MUTABLE until digest(), then permanently finalized. The two TypeScript
|
|
265
|
+
* surfaces share one runtime representation but stay distinct IR kinds so
|
|
266
|
+
* Hash.copy() cannot accidentally appear on Hmac values. The incremental
|
|
267
|
+
* digest state owns no script values and cannot participate in a cycle. */
|
|
268
|
+
| {
|
|
269
|
+
kind: "cryptoHash";
|
|
270
|
+
} | {
|
|
271
|
+
kind: "cryptoHmac";
|
|
272
|
+
}
|
|
273
|
+
/** Heap, refcounted closure. `rest` marks a variadic function value.
|
|
274
|
+
* `restAbi: "typed"` spells one trailing typed array in `params`; static
|
|
275
|
+
* call sites pack their surplus arguments into it before `callValue`.
|
|
276
|
+
* `restAbi: "jsval"` similarly spells one trailing engine array for an
|
|
277
|
+
* island host callback. An absent `restAbi` is the legacy checked-dynamic
|
|
278
|
+
* JS form: `params` stays the declared non-rest list and the lifted
|
|
279
|
+
* function has one hidden trailing ScrDyn array filled by its boxed call
|
|
280
|
+
* thunk. The backends therefore still see one fixed native closure ABI;
|
|
281
|
+
* only the frontend's call completion observes variadic source arity. */
|
|
257
282
|
| {
|
|
258
283
|
kind: "func";
|
|
259
284
|
params: IrType[];
|
|
260
285
|
ret: IrType;
|
|
261
286
|
rest?: true;
|
|
262
|
-
restAbi?: "jsval";
|
|
287
|
+
restAbi?: "jsval" | "typed";
|
|
263
288
|
} | {
|
|
264
289
|
kind: "object";
|
|
265
290
|
className: string;
|
|
@@ -283,6 +308,15 @@ export type IrType = {
|
|
|
283
308
|
kind: "classval";
|
|
284
309
|
className: string;
|
|
285
310
|
}
|
|
311
|
+
/** An ECMAScript module namespace object for one statically-known module.
|
|
312
|
+
* `moduleId` is a canonical compiled source-file or builtin identity.
|
|
313
|
+
* Runtime representation is an interned immortal string token: identity
|
|
314
|
+
* is pointer identity, while member reads resolve to live module globals
|
|
315
|
+
* or builtin lowering tables rather than snapshotting export values. */
|
|
316
|
+
| {
|
|
317
|
+
kind: "moduleNs";
|
|
318
|
+
moduleId: string;
|
|
319
|
+
}
|
|
286
320
|
/** Structural record shape (object literal / interface / type alias over
|
|
287
321
|
* data properties). `shapeId` indexes IrModule.records; the frontend
|
|
288
322
|
* interns shapes structurally, so equal shapeId ⇔ equal shape and
|
|
@@ -388,13 +422,13 @@ interface IrKindSet<K extends IrType["kind"]> extends ReadonlySet<IrType["kind"]
|
|
|
388
422
|
}
|
|
389
423
|
/** The opaque runtime handle kinds. procStream is the one scalar handle;
|
|
390
424
|
* every other handle has pointer representation. */
|
|
391
|
-
declare const HANDLE_KIND_LIST: readonly ["stats", "fileHandle", "spawnRes", "child", "netServer", "netSocket", "http2Session", "http2Stream", "dgramSocket", "testCtx", "httpReq", "httpRes", "httpClientReq", "secureCtx", "fsWatcher", "childStream", "procStream"];
|
|
425
|
+
declare const HANDLE_KIND_LIST: readonly ["stats", "fileHandle", "spawnRes", "child", "netServer", "netSocket", "http2Session", "http2Stream", "dgramSocket", "testCtx", "httpReq", "httpRes", "httpClientReq", "secureCtx", "cryptoHash", "cryptoHmac", "fsWatcher", "childStream", "childWriter", "procStream"];
|
|
392
426
|
export type HandleKind = typeof HANDLE_KIND_LIST[number];
|
|
393
|
-
export declare const HANDLE_KINDS: IrKindSet<"child" | "childStream" | "dgramSocket" | "fileHandle" | "fsWatcher" | "http2Session" | "http2Stream" | "httpClientReq" | "httpReq" | "httpRes" | "netServer" | "netSocket" | "procStream" | "secureCtx" | "spawnRes" | "stats" | "testCtx">;
|
|
427
|
+
export declare const HANDLE_KINDS: IrKindSet<"child" | "childStream" | "childWriter" | "cryptoHash" | "cryptoHmac" | "dgramSocket" | "fileHandle" | "fsWatcher" | "http2Session" | "http2Stream" | "httpClientReq" | "httpReq" | "httpRes" | "netServer" | "netSocket" | "procStream" | "secureCtx" | "spawnRes" | "stats" | "testCtx">;
|
|
394
428
|
/** The IR kinds represented as pointers in both native backends. */
|
|
395
|
-
declare const POINTER_KIND_LIST: readonly ["string", "array", "map", "set", "regex", "bytes", "url", "searchParams", "symbol", "stats", "fileHandle", "spawnRes", "child", "netServer", "netSocket", "http2Session", "http2Stream", "dgramSocket", "testCtx", "httpReq", "httpRes", "httpClientReq", "secureCtx", "fsWatcher", "childStream", "func", "object", "classval", "record", "union", "dyn", "jsval", "caught", "promise", "generator"];
|
|
429
|
+
declare const POINTER_KIND_LIST: readonly ["string", "bigint", "array", "map", "set", "regex", "bytes", "url", "searchParams", "symbol", "stats", "fileHandle", "spawnRes", "child", "netServer", "netSocket", "http2Session", "http2Stream", "dgramSocket", "testCtx", "httpReq", "httpRes", "httpClientReq", "secureCtx", "cryptoHash", "cryptoHmac", "fsWatcher", "childStream", "childWriter", "func", "object", "classval", "moduleNs", "record", "union", "dyn", "jsval", "caught", "promise", "generator"];
|
|
396
430
|
export type PointerKind = typeof POINTER_KIND_LIST[number];
|
|
397
|
-
export declare const POINTER_KINDS: IrKindSet<"array" | "bytes" | "caught" | "child" | "childStream" | "classval" | "dgramSocket" | "dyn" | "fileHandle" | "fsWatcher" | "func" | "generator" | "http2Session" | "http2Stream" | "httpClientReq" | "httpReq" | "httpRes" | "jsval" | "map" | "netServer" | "netSocket" | "object" | "promise" | "record" | "regex" | "searchParams" | "secureCtx" | "set" | "spawnRes" | "stats" | "string" | "symbol" | "testCtx" | "union" | "url">;
|
|
431
|
+
export declare const POINTER_KINDS: IrKindSet<"array" | "bigint" | "bytes" | "caught" | "child" | "childStream" | "childWriter" | "classval" | "cryptoHash" | "cryptoHmac" | "dgramSocket" | "dyn" | "fileHandle" | "fsWatcher" | "func" | "generator" | "http2Session" | "http2Stream" | "httpClientReq" | "httpReq" | "httpRes" | "jsval" | "map" | "moduleNs" | "netServer" | "netSocket" | "object" | "promise" | "record" | "regex" | "searchParams" | "secureCtx" | "set" | "spawnRes" | "stats" | "string" | "symbol" | "testCtx" | "union" | "url">;
|
|
398
432
|
/** Runtime RC symbol stem for each IR type kind. An empty stem means the
|
|
399
433
|
* kind is scalar/unit or uses an emitted per-shape helper (object/record).
|
|
400
434
|
* Keeping this exhaustive makes a new runtime handle kind a compile error
|
|
@@ -409,6 +443,7 @@ export declare function runtimeRcStem(t: IrType): string | null;
|
|
|
409
443
|
* arms with `true`. */
|
|
410
444
|
export declare const REF_TRUTHY_KINDS: ReadonlySet<string>;
|
|
411
445
|
export declare const F64: IrType;
|
|
446
|
+
export declare const BIGINT_T: IrType;
|
|
412
447
|
export declare const DATE_T: IrType;
|
|
413
448
|
export declare const BYTES_U8: IrType;
|
|
414
449
|
export declare const STRING: IrType;
|
|
@@ -431,8 +466,11 @@ export declare const HTTPREQ_T: IrType;
|
|
|
431
466
|
export declare const HTTPRES_T: IrType;
|
|
432
467
|
export declare const HTTPCLIENTREQ_T: IrType;
|
|
433
468
|
export declare const SECURECTX_T: IrType;
|
|
469
|
+
export declare const CRYPTOHASH_T: IrType;
|
|
470
|
+
export declare const CRYPTOHMAC_T: IrType;
|
|
434
471
|
export declare const FSWATCHER_T: IrType;
|
|
435
472
|
export declare const CHILDSTREAM_T: IrType;
|
|
473
|
+
export declare const CHILDWRITER_T: IrType;
|
|
436
474
|
export declare const PROCSTREAM_T: IrType;
|
|
437
475
|
export declare const VOID: IrType;
|
|
438
476
|
export declare const DYN: IrType;
|
|
@@ -520,7 +558,7 @@ export declare function typeEquals(a: IrType, b: IrType): boolean;
|
|
|
520
558
|
export declare function isRefCounted(t: IrType): boolean;
|
|
521
559
|
export interface IrModule {
|
|
522
560
|
/** Bumped on any breaking IR change; serialize.ts refuses mismatches. */
|
|
523
|
-
irVersion:
|
|
561
|
+
irVersion: 11;
|
|
524
562
|
sourceFile: string;
|
|
525
563
|
functions: IrFunction[];
|
|
526
564
|
/** Class shapes. Constructors and methods are ordinary module functions
|
|
@@ -1754,7 +1792,7 @@ export type IrLibFn =
|
|
|
1754
1792
|
* value / string) — both THROW Node's TypeErrors on non-file schemes,
|
|
1755
1793
|
* encoded slashes, and non-empty hosts. url.pathToFileURL resolves the
|
|
1756
1794
|
* path (getcwd) and never throws. */
|
|
1757
|
-
| "url.new" | "url.protocol" | "url.host" | "url.hostname" | "url.pathname" | "url.href" | "url.fileURLToPathUrl" | "url.fileURLToPathStr" | "url.pathToFileURL"
|
|
1795
|
+
| "url.new" | "url.protocol" | "url.origin" | "url.username" | "url.password" | "url.host" | "url.hostname" | "url.port" | "url.pathname" | "url.href" | "url.fileURLToPathUrl" | "url.fileURLToPathStr" | "url.pathToFileURL"
|
|
1758
1796
|
/** pathToFileURL under a win32 TARGET: the same scr_url_from_path call
|
|
1759
1797
|
* (the runtime selects the win32 arm by _WIN32), but a distinct IR name
|
|
1760
1798
|
* because that arm THROWS for malformed UNC inputs — may-throw seeds on
|
|
@@ -1777,7 +1815,7 @@ export type IrLibFn =
|
|
|
1777
1815
|
* bools; sp.size/sp.toString are pure reads. sp.keyAt/sp.valAt are
|
|
1778
1816
|
* the for-of/forEach desugar's index reads (live — the loop re-reads
|
|
1779
1817
|
* sp.size each pass). */
|
|
1780
|
-
| "sp.new" | "sp.parse" | "sp.copy" | "sp.fromPairs" | "sp.with" | "url.searchParams" | "url.search" | "sp.get" | "sp.getAll" | "sp.append" | "sp.set" | "sp.delete" | "sp.deleteValue" | "sp.has" | "sp.hasValue" | "sp.sort" | "sp.size" | "sp.toString" | "sp.keyAt" | "sp.valAt"
|
|
1818
|
+
| "sp.new" | "sp.parse" | "sp.copy" | "sp.fromPairs" | "sp.with" | "url.searchParams" | "url.search" | "url.hash" | "sp.get" | "sp.getAll" | "sp.append" | "sp.set" | "sp.delete" | "sp.deleteValue" | "sp.has" | "sp.hasValue" | "sp.sort" | "sp.size" | "sp.toString" | "sp.keyAt" | "sp.valAt"
|
|
1781
1819
|
/** node:querystring (scr_qs.c — link-gated by moduleUsesQs; NOT
|
|
1782
1820
|
* URLSearchParams: the legacy codec's escaping and '+' rules differ).
|
|
1783
1821
|
* qs.escape is Node's qsEscape, which encodes exactly the component
|
|
@@ -1815,9 +1853,14 @@ export type IrLibFn =
|
|
|
1815
1853
|
* (the runtime returns +1-or-NULL; the backend builds the union arms —
|
|
1816
1854
|
* the child.stdout pattern). None of these throw. */
|
|
1817
1855
|
| "sym.new" | "sym.newAnon" | "sym.for" | "sym.keyFor" | "sym.desc" | "sym.toString"
|
|
1856
|
+
/** Engine-free arbitrary-precision bigint operations (scr_bigint.c).
|
|
1857
|
+
* parse accepts the ECMAScript BigInt string grammar; fromF64 accepts
|
|
1858
|
+
* finite integral Numbers. Arithmetic returns fresh immutable values.
|
|
1859
|
+
* cmp returns -1/0/1 as f64; toString accepts a numeric radix. */
|
|
1860
|
+
| "bigint.parse" | "bigint.fromF64" | "bigint.neg" | "bigint.not" | "bigint.add" | "bigint.sub" | "bigint.mul" | "bigint.div" | "bigint.mod" | "bigint.pow" | "bigint.and" | "bigint.or" | "bigint.xor" | "bigint.shl" | "bigint.shr" | "bigint.eq" | "bigint.eqString" | "bigint.cmp" | "bigint.cmpNumber" | "bigint.truthy" | "bigint.toString" | "bigint.inspect" | "bigint.toF64" | "bigint.asUintN" | "bigint.asIntN" | "bigint.bufferRead" | "bigint.bufferWrite" | "bigint.dataViewGet" | "bigint.dataViewSet"
|
|
1818
1861
|
/** fs.statSync → a Stats value (may throw, like the other sync fs
|
|
1819
1862
|
* calls); the stats.* getters are pure reads on it. */
|
|
1820
|
-
| "fs.statSync" | "stats.isFile" | "stats.isDirectory" | "stats.size"
|
|
1863
|
+
| "fs.statSync" | "stats.isFile" | "stats.isDirectory" | "stats.size" | "stats.dev" | "stats.ino"
|
|
1821
1864
|
/** child_process.spawnSync (scr_child.c): posix_spawn + waitpid + piped
|
|
1822
1865
|
* utf8 capture — cmd borrowed, args one borrowed string[] (the frontend
|
|
1823
1866
|
* completes an omitted list to an empty literal), result an owned (+1)
|
|
@@ -1836,17 +1879,18 @@ export type IrLibFn =
|
|
|
1836
1879
|
* the backend (the envGet convention). Never throws. */
|
|
1837
1880
|
| "spawnRes.error"
|
|
1838
1881
|
/** child_process.spawn (scr_child.c + the scr_async.c loop): posix_spawnp
|
|
1839
|
-
* with
|
|
1840
|
-
*
|
|
1841
|
-
*
|
|
1842
|
-
* timers (kqueue is the follow-up; SEMANTICS.md documents the polling).
|
|
1882
|
+
* with per-slot ignore/inherit/pipe modes (and number output fds), the
|
|
1883
|
+
* all-piped Node default, and the child registered with the event loop,
|
|
1884
|
+
* which polls waitpid(WNOHANG) at quiescence like timers.
|
|
1843
1885
|
* NEVER throws: spawn failure defers to the "error" event, Node-exact
|
|
1844
1886
|
* (the error message is Node's "spawn <cmd> <ERRNO-NAME>"; an "error"
|
|
1845
1887
|
* event with no listener prints it and exits 1 like an EventEmitter).
|
|
1846
1888
|
* cmd/args borrowed; result an owned (+1) child handle. The loop will
|
|
1847
1889
|
* not exhaust while any spawned child is unreaped — Node's keep-alive.
|
|
1848
1890
|
*
|
|
1849
|
-
* child.onExit / child.
|
|
1891
|
+
* child.onExit / child.onClose / child.onError — terminal listener
|
|
1892
|
+
* registration through child.on/once. Close uses the exit adapter shape
|
|
1893
|
+
* but fires only after every piped stdio handle reaches EOF. The
|
|
1850
1894
|
* receiver is borrowed, the CALLBACK MOVES into the child's listener
|
|
1851
1895
|
* registry (released after the terminal event fires, or at reap for
|
|
1852
1896
|
* the event that never fires). Both are void (chaining is fenced).
|
|
@@ -1858,7 +1902,16 @@ export type IrLibFn =
|
|
|
1858
1902
|
* shape — scr_error_new needs no program types). "exit" fires once
|
|
1859
1903
|
* with the code (f64 arm) or null (signal death); "error" fires only
|
|
1860
1904
|
* for spawn failure, exactly Node's split. */
|
|
1861
|
-
| "cp.spawn"
|
|
1905
|
+
| "cp.spawn"
|
|
1906
|
+
/** Static-native fork startup and IPC. process.forkTarget initializes a
|
|
1907
|
+
* re-executed child's inherited channel and returns its embedded target id
|
|
1908
|
+
* (-1 in the parent). The remaining entries mirror Node's JSON channel. */
|
|
1909
|
+
| "process.forkTarget" | "cp.fork" | "child.connected" | "child.send" | "child.sendCb" | "child.disconnect" | "child.onMessage" | "child.onDisconnect" | "process.connected" | "process.send" | "process.sendCb" | "process.disconnect" | "process.onMessage" | "process.onDisconnect"
|
|
1910
|
+
/** child_process.execFile's callback slice: starts an all-piped child,
|
|
1911
|
+
* captures stdout/stderr, and moves the error-first callback into the
|
|
1912
|
+
* child registry. The callback shape is program-dependent and checked
|
|
1913
|
+
* by the validator/backends. */
|
|
1914
|
+
| "cp.execFile" | "child.onExit" | "child.onClose" | "child.onError"
|
|
1862
1915
|
/** The ChildProcess lifecycle members (scr_child.c), Node's shapes
|
|
1863
1916
|
* exactly (SEMANTICS.md has the pinned matrix). child.pid is the
|
|
1864
1917
|
* checker's `number | undefined` (undefined = spawn failure) and
|
|
@@ -1881,12 +1934,19 @@ export type IrLibFn =
|
|
|
1881
1934
|
* arm). stream.onData/onEnd register 'data'/'end' listeners (receiver
|
|
1882
1935
|
* borrowed, CALLBACK MOVES, trailing once-flag, void — chaining
|
|
1883
1936
|
* fenced): 'data' fires one Buffer chunk per read (zero-param and
|
|
1884
|
-
* Buffer
|
|
1937
|
+
* Buffer/string adapters are runtime-provided; setEncoding threads
|
|
1938
|
+
* split multibyte sequences through the shared StringDecoder core. A
|
|
1939
|
+
* union-param listener —
|
|
1885
1940
|
* ngrok's `Buffer | string` — gets a compiler-emitted adapter wrapping
|
|
1886
1941
|
* the chunk at its Buffer arm), 'end' fires once at EOF, always BEFORE
|
|
1887
1942
|
* the child's 'exit' (the pinned ordering). A flowing stream keeps the
|
|
1888
1943
|
* loop alive: usesTimers. */
|
|
1889
|
-
| "child.stdout" | "child.stderr" | "stream.onData" | "stream.onEnd"
|
|
1944
|
+
| "child.stdout" | "child.stderr" | "stream.onData" | "stream.onDataStr" | "stream.onEnd" | "stream.childSetEncoding"
|
|
1945
|
+
/** The piped-input writer (stdio mode 3 on fd 0). child.stdin answers
|
|
1946
|
+
* `Writable | null`; writes copy borrowed data into the nonblocking
|
|
1947
|
+
* queue, end/destroy settle it, writable is a pure state read, and
|
|
1948
|
+
* listener callbacks move into the writer registry. */
|
|
1949
|
+
| "child.stdin" | "writer.writeString" | "writer.writeBytes" | "writer.end" | "writer.destroy" | "writer.writable" | "writer.onDrain" | "writer.onFinish" | "writer.onError"
|
|
1890
1950
|
/** The first-class WritableStream write (`output.write(line)` — the
|
|
1891
1951
|
* prefixStream idiom): the receiver IS the fd scalar (process.stdout/
|
|
1892
1952
|
* stderr reads mint 1/2), dispatched onto the exact stdoutWrite/
|
|
@@ -2033,11 +2093,9 @@ export type IrLibFn =
|
|
|
2033
2093
|
* for end-before-head, chunked after an explicit writeHead/write). */
|
|
2034
2094
|
| "http.createServer"
|
|
2035
2095
|
/** http.createServer() / http.Server() with no handler — the
|
|
2036
|
-
* on("request") route;
|
|
2037
|
-
*
|
|
2038
|
-
|
|
2039
|
-
* joinDuplicateHeaders joins repeated request-header reads ", "). */
|
|
2040
|
-
| "http.createServerEmpty" | "http.serverJoinDupHeaders"
|
|
2096
|
+
* on("request") route; option helpers set parser behavior on a fresh
|
|
2097
|
+
* server before the constructor/factory result is returned. */
|
|
2098
|
+
| "http.createServerEmpty" | "http.serverJoinDupHeaders" | "http.serverAllowMissingHostHeader"
|
|
2041
2099
|
/** The five writable numeric http.Server timeout fields use one
|
|
2042
2100
|
* selector ABI: 0 timeout, 1 keepAliveTimeout, 2 headersTimeout,
|
|
2043
2101
|
* 3 requestTimeout, 4 keepAliveTimeoutBuffer. These calls store/read
|
|
@@ -2054,9 +2112,9 @@ export type IrLibFn =
|
|
|
2054
2112
|
* the callback fires deferred, Node's 'finish' emit). writeHead's
|
|
2055
2113
|
* statusMessage forms compose in interned helpers: resStatusMsgSet
|
|
2056
2114
|
* then the ordinary writeHead entry. */
|
|
2057
|
-
| "http.resStatusGet" | "http.resStatusSet" | "http.resStatusMsgGet" | "http.resStatusMsgSet" | "http.resGetHeader" | "http.resHasHeader" | "http.resRemoveHeader" | "http.resOnFinish" | "http.reqUrl" | "http.reqMethod" | "http.reqHeader" | "http.reqOnData" | "http.reqOnEnd" | "http.resSetHeader" | "http.resWriteHead" | "http.resWriteHeadN" | "http.resWrite" | "http.resWriteBytes" | "http.resEnd" | "http.resEndStr" | "http.resEndBytes"
|
|
2115
|
+
| "http.resStatusGet" | "http.resStatusSet" | "http.resStatusMsgGet" | "http.resStatusMsgSet" | "http.resGetHeader" | "http.resHasHeader" | "http.resRemoveHeader" | "http.resOnFinish" | "http.reqUrl" | "http.reqMethod" | "http.reqHeader" | "http.reqTrailer" | "http.reqHeaderValues" | "http.reqTrailerValues" | "http.reqOnData" | "http.reqOnEnd" | "http.resSetHeader" | "http.resWriteHead" | "http.resWriteHeadN" | "http.resWrite" | "http.resWriteBytes" | "http.resEnd" | "http.resEndStr" | "http.resEndBytes"
|
|
2058
2116
|
/** The checked-dynamic chunk twins (the net.sockWriteDyn story). */
|
|
2059
|
-
| "http.resWriteDyn" | "http.resEndDyn" | "http.resHeadersSent"
|
|
2117
|
+
| "http.resWriteDyn" | "http.resEndDyn" | "http.resHeadersSent" | "http.resFlushHeaders" | "http.resAddTrailers" | "http.resCork" | "http.resUncork" | "http.resWritableCorked"
|
|
2060
2118
|
/** The server-surface member follow-ups: reqStatusCode answers the
|
|
2061
2119
|
* interned `number | undefined` union (negative = the undefined arm —
|
|
2062
2120
|
* a SERVER request, where Node's statusCode is undefined; every client
|
|
@@ -2079,11 +2137,11 @@ export type IrLibFn =
|
|
|
2079
2137
|
* line carried none), the undefined arm on server requests (the
|
|
2080
2138
|
* statusCode split). sockDestroyed is socket.destroyed — true once the
|
|
2081
2139
|
* fd is gone (destroy() or full close). */
|
|
2082
|
-
| "http.reqRawHeaders" | "http.reqStatusMessage"
|
|
2140
|
+
| "http.reqRawHeaders" | "http.reqRawTrailers" | "http.reqStatusMessage"
|
|
2083
2141
|
/** The `{ ...req.headers }` snapshot feed: [lowercased name, value,
|
|
2084
2142
|
* ...] pairs in arrival order — the interned %headers.snapshot helper
|
|
2085
2143
|
* builds the record over it, exactly the process.envPairs pattern. */
|
|
2086
|
-
| "http.reqHeaderPairs" | "net.sockDestroyed"
|
|
2144
|
+
| "http.reqHeaderPairs" | "http.reqTrailerPairs" | "net.sockDestroyed"
|
|
2087
2145
|
/** socket.writable — the write half is open: no end() yet, no FIN sent,
|
|
2088
2146
|
* fd alive (connecting sockets answer true; writes queue). Node's
|
|
2089
2147
|
* stream flag. Borrows; never throws. */
|
|
@@ -2318,7 +2376,7 @@ export type IrLibFn =
|
|
|
2318
2376
|
* idiom reads it through a cast). */
|
|
2319
2377
|
| "net.sockEncrypted" | "http.clientWrite" | "http.clientWriteBytes" | "http.clientEnd" | "http.clientEndStr" | "http.clientEndBytes"
|
|
2320
2378
|
/** The checked-dynamic chunk twins (the net.sockWriteDyn story). */
|
|
2321
|
-
| "http.clientWriteDyn" | "http.clientEndDyn"
|
|
2379
|
+
| "http.clientWriteDyn" | "http.clientEndDyn" | "http.clientFlushHeaders" | "http.clientAddTrailers" | "http.clientCork" | "http.clientUncork" | "http.clientWritableCorked"
|
|
2322
2380
|
/** request/get with a URL-STRING first argument: the runtime parses it
|
|
2323
2381
|
* (WHATWG) and dials — throws catchably on an unparsable input or a
|
|
2324
2382
|
* non-http scheme. */
|
|
@@ -2329,18 +2387,19 @@ export type IrLibFn =
|
|
|
2329
2387
|
* these are in the may-throw seed. readFile is utf8-fenced like
|
|
2330
2388
|
* readFileSync. The non-interleaving divergence is documented in
|
|
2331
2389
|
* SEMANTICS.md. */
|
|
2332
|
-
/** node:crypto
|
|
2333
|
-
*
|
|
2334
|
-
*
|
|
2335
|
-
* randomBytesToString THROWS Node's RangeError on out-of-range sizes. */
|
|
2390
|
+
/** node:crypto randomness: randomUUID plus randomBytes as either a real
|
|
2391
|
+
* Buffer or the fused randomBytes(n).toString("hex"|"base64") path.
|
|
2392
|
+
* The size-taking forms throw Node's RangeError on invalid values. */
|
|
2336
2393
|
| "crypto.randomUUID" | "crypto.randomBytesToString"
|
|
2337
|
-
/** The
|
|
2338
|
-
*
|
|
2339
|
-
*
|
|
2340
|
-
* both compile-time literals (frontend-fenced). Strings hash their
|
|
2341
|
-
* UTF-8 bytes (Node's default input encoding); the bytes form hashes a
|
|
2342
|
-
* Buffer/typed array's bytes. Pure; never throw. */
|
|
2394
|
+
/** The fused createHash(alg).update(data).digest(enc) fast path and the
|
|
2395
|
+
* one-shot crypto.hash implementation. First-class Hash/Hmac handles use
|
|
2396
|
+
* the entries below; all paths share the incremental runtime core. */
|
|
2343
2397
|
| "crypto.hashDigestStr" | "crypto.hashDigestBytes"
|
|
2398
|
+
/** First-class static Hash/Hmac handles. Constructors validate the
|
|
2399
|
+
* runtime algorithm string (md5/sha1/sha256); update returns the same
|
|
2400
|
+
* handle by retained identity, copy snapshots Hash state, and digest
|
|
2401
|
+
* finalizes the handle and returns either a Buffer or encoded string. */
|
|
2402
|
+
| "crypto.hashNew" | "crypto.hmacNewStr" | "crypto.hmacNewBytes" | "crypto.hashUpdateStr" | "crypto.hashUpdateBytes" | "crypto.hmacUpdateStr" | "crypto.hmacUpdateBytes" | "crypto.hashCopy" | "crypto.hashDigestString" | "crypto.hashDigestBuffer" | "crypto.hmacDigestString" | "crypto.hmacDigestBuffer" | "crypto.timingSafeEqual" | "crypto.randomFill" | "crypto.randomFillRest" | "crypto.randomInt" | "crypto.pbkdf2" | "crypto.randomBytesCb" | "crypto.pbkdf2Cb"
|
|
2344
2403
|
/** crypto.randomBytes(n) → a real u8 Buffer (+1). THROWS Node's
|
|
2345
2404
|
* RangeError on out-of-range sizes, exactly like the composed
|
|
2346
2405
|
* randomBytesToString (which keeps its one-libCall lowering — the two
|
|
@@ -2413,11 +2472,15 @@ export type IrLibFn =
|
|
|
2413
2472
|
* pair THROWS catchably on failure exactly like the utf8 forms. */
|
|
2414
2473
|
| "fs.readFileSyncBytes" | "fs.writeFileSyncBytes" | "fsp.readFileBytes"
|
|
2415
2474
|
/** node:zlib (scr_zlib.c — native-toolchain.ts compiles/links it ONLY when these
|
|
2416
|
-
* appear on the IR, the regex/libcurl gating precedent):
|
|
2417
|
-
*
|
|
2418
|
-
* throws (OOM aborts);
|
|
2419
|
-
* catchably. */
|
|
2420
|
-
| "zlib.deflateSync" | "zlib.inflateSync"
|
|
2475
|
+
* appear on the IR, the regex/libcurl gating precedent): one-shot zlib,
|
|
2476
|
+
* raw-DEFLATE, gzip, and auto-detect codecs over u8 bytes with Node's
|
|
2477
|
+
* default options. Compression never throws (OOM aborts); decompression
|
|
2478
|
+
* of corrupt input THROWS Node's error catchably. */
|
|
2479
|
+
| "zlib.deflateSync" | "zlib.inflateSync" | "zlib.deflateRawSync" | "zlib.inflateRawSync" | "zlib.gzipSync" | "zlib.gunzipSync" | "zlib.unzipSync"
|
|
2480
|
+
/** The default-options callback twins run on the executable's shared
|
|
2481
|
+
* native work pool and deliver (Error | null, Buffer) on a later loop
|
|
2482
|
+
* turn. crc32 validates its optional uint32 seed synchronously. */
|
|
2483
|
+
| "zlib.deflateCb" | "zlib.inflateCb" | "zlib.deflateRawCb" | "zlib.inflateRawCb" | "zlib.gzipCb" | "zlib.gunzipCb" | "zlib.unzipCb" | "zlib.crc32"
|
|
2421
2484
|
/** The Buffer overloads of the raw stream writes — same promptly
|
|
2422
2485
|
* submitted streams as process.stdoutWrite/stderrWrite, constantly true.
|
|
2423
2486
|
* The encoding arg is evaluated but ignored for bytes, like Node. The Cb
|
|
@@ -2430,7 +2493,12 @@ export type IrLibFn =
|
|
|
2430
2493
|
* literal { recursive?, mode? } options (the mkdirSync matrix behind
|
|
2431
2494
|
* settled promises), unlink, chmod. Failures REJECT (catchable at the
|
|
2432
2495
|
* await), like the rest of the fsp family. */
|
|
2433
|
-
| "fsp.mkdirMode" | "fsp.mkdirRecursive" | "fsp.mkdirRecursiveMode" | "fsp.unlink" | "fsp.chmod" | "fsp.rename" | "fsp.readdir"
|
|
2496
|
+
| "fsp.mkdirMode" | "fsp.mkdirRecursive" | "fsp.mkdirRecursiveMode" | "fsp.unlink" | "fsp.chmod" | "fsp.rename" | "fsp.readdir"
|
|
2497
|
+
/** `fs.promises.readdir(path, { withFileTypes: true })` — the settled-
|
|
2498
|
+
* promise twin of fs.readdirTypesSync. The backends assemble the same
|
|
2499
|
+
* call-site-shaped Dirent rows, then move the array into a promise;
|
|
2500
|
+
* scandir failure becomes its rejection. */
|
|
2501
|
+
| "fsp.readdirTypes" | "fsp.rm" | "fsp.stat" | "fsp.realpath" | "fsp.lstat"
|
|
2434
2502
|
/** fs/promises.open and the statically represented FileHandle surface.
|
|
2435
2503
|
* Every operation returns an already-settled promise; syscall failures
|
|
2436
2504
|
* become rejections rather than escaping synchronously. read/write
|
|
@@ -2451,7 +2519,11 @@ export type IrLibFn =
|
|
|
2451
2519
|
* (the frontend's interned %env.snapshot helper keyed-writes the pairs
|
|
2452
2520
|
* into a fresh `{ [k: string]: string | undefined }` record). Fresh +1
|
|
2453
2521
|
* array; never throws. */
|
|
2454
|
-
| "process.envPairs" | "process.exit"
|
|
2522
|
+
| "process.envPairs" | "process.exit"
|
|
2523
|
+
/** Numeric process.exitCode write (integer validation, implicit exit status). */
|
|
2524
|
+
| "process.setExitCode"
|
|
2525
|
+
/** The code for process.exit() with no argument, or zero when unset. */
|
|
2526
|
+
| "process.currentExitCode" | "process.cwd"
|
|
2455
2527
|
/** getpid(2) / getuid(2): zero args → f64. POSIX-only target, so both
|
|
2456
2528
|
* always answer (the checker's `getuid?` optionality covers Windows —
|
|
2457
2529
|
* `process.getuid?.()` lowers as the plain call). Never throw. */
|
|
@@ -2655,6 +2727,11 @@ export type IrLibFn =
|
|
|
2655
2727
|
* render "null"/"undefined") — the WHATWG USVString conversions
|
|
2656
2728
|
* (URLSearchParams names/values). Borrowed dyn; +1 string. May-throw. */
|
|
2657
2729
|
| "dyn.toStringCoerce"
|
|
2730
|
+
/** JS ToNumber over a dyn value WITH the object protocol (number-hint
|
|
2731
|
+
* valueOf/toString ordering; user throws propagate). Borrowed dyn;
|
|
2732
|
+
* f64 result, or a throw. Used by statically lowered numeric coercions
|
|
2733
|
+
* whose checker type remained any. */
|
|
2734
|
+
| "dyn.toNumberCoerce"
|
|
2658
2735
|
/** A read of a `declare`d const NOTHING defines (the bundler-define
|
|
2659
2736
|
* pattern — __VERSION__): always throws the catchable ReferenceError
|
|
2660
2737
|
* Node raises at the access ("<name> is not defined"). args[0] is the
|
|
@@ -2781,7 +2858,7 @@ export type IrLibFn =
|
|
|
2781
2858
|
* the had-listeners bool. emitter.emitError: emit('error', err) —
|
|
2782
2859
|
* throws err when unhandled. count/countFn/names/listeners/getMax/
|
|
2783
2860
|
* setMax/setDefaultMax/getDefaultMax are the introspection surface. */
|
|
2784
|
-
| "emitter.new" | "emitter.ctor" | "emitter.on" | "emitter.off" | "emitter.checkListener" | "emitter.onDyn" | "emitter.offDyn" | "emitter.removeAll" | "emitter.emit" | "emitter.emitError" | "emitter.count" | "emitter.countFn" | "emitter.names" | "emitter.listeners" | "emitter.setMax" | "emitter.getMax"
|
|
2861
|
+
| "emitter.new" | "emitter.ctor" | "emitter.on" | "emitter.off" | "emitter.checkListener" | "emitter.onDyn" | "emitter.onFlex" | "emitter.offDyn" | "emitter.removeAll" | "emitter.emit" | "emitter.emitFlex" | "emitter.emitError" | "emitter.count" | "emitter.countFn" | "emitter.names" | "emitter.listeners" | "emitter.setMax" | "emitter.getMax"
|
|
2785
2862
|
/** Stream-'data' registration twins of emitter.on/onDyn (same args):
|
|
2786
2863
|
* chosen at registration sites whose receiver is stream-rooted, so the
|
|
2787
2864
|
* backend emits DATA thunks — the runtime's 'data' emission carries
|
|
@@ -2894,8 +2971,8 @@ export type IrLibFn =
|
|
|
2894
2971
|
*
|
|
2895
2972
|
* assert.ok: (pass, message) — the frontend computed the truthiness AND
|
|
2896
2973
|
* the full message (the user's, or the compile-time source-text form —
|
|
2897
|
-
* assert.fail lowers here too with pass=false). assert.eqF64/
|
|
2898
|
-
* eqBool: (a, b, negated, deep, msg, hasMsg) — Object.is comparison,
|
|
2974
|
+
* assert.fail lowers here too with pass=false). assert.eqF64/eqBigInt/
|
|
2975
|
+
* eqStr/eqBool: (a, b, negated, deep, msg, hasMsg) — Object.is comparison,
|
|
2899
2976
|
* covering strictEqual/notStrictEqual and the scalar deepStrictEqual
|
|
2900
2977
|
* pair; msg is a typed dummy ("" literal) when hasMsg is false (Node
|
|
2901
2978
|
* distinguishes an omitted message from an empty one per operator).
|
|
@@ -2941,7 +3018,7 @@ export type IrLibFn =
|
|
|
2941
3018
|
* the value's inspection) — the frontend routes null/undefined to a
|
|
2942
3019
|
* no-op and everything else here (Node throws for falsy values too).
|
|
2943
3020
|
* All arguments are borrowed. */
|
|
2944
|
-
| "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"
|
|
3021
|
+
| "assert.ok" | "assert.eqF64" | "assert.eqBigInt" | "assert.eqStr" | "assert.eqBool" | "assert.eqSym" | "assert.eqDyn" | "assert.looseResult" | "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"
|
|
2945
3022
|
/** Node's expectsError over an error-INSTANCE expected (assert.throws/
|
|
2946
3023
|
* rejects second argument): walk the expected dyn error's keys (name,
|
|
2947
3024
|
* message, code — the %error marker skipped) and deep-compare each
|
|
@@ -3095,7 +3172,9 @@ export type IrLibFn =
|
|
|
3095
3172
|
* ToInteger truncation of fractional ms) and THROWS Node's "Invalid
|
|
3096
3173
|
* time value" RangeError on NaN / out-of-range input (may-throw seed).
|
|
3097
3174
|
* Results: f64 / owned (+1) string. */
|
|
3098
|
-
| "date.now" | "date.newNow" | "date.newMs" | "date.newString"
|
|
3175
|
+
| "date.now" | "date.newNow" | "date.newMs" | "date.newString"
|
|
3176
|
+
/** Date.parse(dateString), with its own reach witness for exact fences. */
|
|
3177
|
+
| "date.parse" | "date.getTime" | "date.valueOf" | "date.toISOString" | "date.toISOStringValue" | "date.getFullYear" | "date.getUTCFullYear" | "date.getMonth" | "date.getUTCMonth" | "date.getDate" | "date.getUTCDate" | "date.getDay" | "date.getUTCDay" | "date.getHours" | "date.getUTCHours" | "date.getMinutes" | "date.getUTCMinutes" | "date.getSeconds" | "date.getUTCSeconds" | "date.getMilliseconds" | "date.getUTCMilliseconds" | "date.getTimezoneOffset"
|
|
3099
3178
|
/** The composed `new Date(dateString).getTime()` read: one borrowed
|
|
3100
3179
|
* string, f64 milliseconds since epoch. The parsed grammar is BOUNDED
|
|
3101
3180
|
* (documented divergence — V8's parser accepts far more): the ASN.1
|
|
@@ -3196,7 +3275,7 @@ export type IrLibFn =
|
|
|
3196
3275
|
* uv_fs_copyfile behavior); its errors carry BOTH paths — Node's
|
|
3197
3276
|
* "copyfile 'src' -> 'dest'". lstatSync is statSync without following
|
|
3198
3277
|
* a trailing symlink (Node reports lstat); stats.isSymbolicLink /
|
|
3199
|
-
* stats.blocks / nlink / atimeMs / mtimeMs are pure reads on the widened
|
|
3278
|
+
* stats.dev / ino / blocks / nlink / atimeMs / mtimeMs / ctimeMs are pure reads on the widened
|
|
3200
3279
|
* snapshot (blocks is allocated 512-byte units; the times are milliseconds
|
|
3201
3280
|
* with their sub-second fractions, Node's arithmetic).
|
|
3202
3281
|
* writeFileModeSync is writeFileSync(path, data, { mode }): the mode
|
|
@@ -3209,7 +3288,7 @@ export type IrLibFn =
|
|
|
3209
3288
|
/** renameSync is the direct two-path syscall wrapper. renameCb defers
|
|
3210
3289
|
* the operation to the loop and fires a program-shaped Error | null
|
|
3211
3290
|
* callback through a backend-emitted adapter. */
|
|
3212
|
-
| "fs.renameSync" | "fs.renameCb" | "fs.lstatSync"
|
|
3291
|
+
| "fs.renameSync" | "fs.renameCb" | "fs.lstatSync" | "fs.fstatSync" | "fs.fchmodSync" | "fs.fsyncSync" | "fs.linkSync"
|
|
3213
3292
|
/** fs.openSync(path, flags) → the raw fd as f64; fs.readSync/fs.writeSync
|
|
3214
3293
|
* over Buffer windows perform sequential I/O when position is -1 and
|
|
3215
3294
|
* offset-preserving positioned I/O otherwise; fs.writeStrSync is the
|
|
@@ -3220,7 +3299,7 @@ export type IrLibFn =
|
|
|
3220
3299
|
* Node's ERR_INVALID_ARG_VALUE TypeError text). All throw Node-shaped
|
|
3221
3300
|
* fs errors (openSync ENOENT/EACCES..., readSync EBADF/range errors,
|
|
3222
3301
|
* closeSync EBADF). */
|
|
3223
|
-
| "fs.openSync" | "fs.readSync" | "fs.writeSync" | "fs.writeStrSync" | "fs.closeSync"
|
|
3302
|
+
| "fs.openSync" | "fs.openNumericSync" | "fs.readSync" | "fs.writeSync" | "fs.writeStrSync" | "fs.closeSync"
|
|
3224
3303
|
/** fs.watch(path, listener?) → an FSWatcher handle (scr_watch.c —
|
|
3225
3304
|
* linked, and scr_watch_install() emitted, only when these appear on
|
|
3226
3305
|
* the IR; moduleUsesFsWatch is the switch). The path opens NOW —
|
|
@@ -3243,7 +3322,7 @@ export type IrLibFn =
|
|
|
3243
3322
|
* ASN1_TIME_print shape ("Jul 1 00:00:00 2026 GMT" — %2d space-padded
|
|
3244
3323
|
* day). Same input contract and PEM error as the fingerprint pair
|
|
3245
3324
|
* (may-throw). */
|
|
3246
|
-
| "crypto.x509ValidFrom" | "crypto.x509ValidFromStr" | "crypto.x509ValidTo" | "crypto.x509ValidToStr" | "stats.isSymbolicLink" | "stats.blocks" | "stats.nlink" | "stats.atimeMs" | "stats.mtimeMs" | "fs.writeFileModeSync" | "fs.mkdirModeSync" | "fs.mkdirRecursiveModeSync"
|
|
3325
|
+
| "crypto.x509ValidFrom" | "crypto.x509ValidFromStr" | "crypto.x509ValidTo" | "crypto.x509ValidToStr" | "stats.isSymbolicLink" | "stats.blocks" | "stats.nlink" | "stats.atimeMs" | "stats.mtimeMs" | "stats.ctimeMs" | "fs.writeFileModeSync" | "fs.mkdirModeSync" | "fs.mkdirRecursiveModeSync"
|
|
3247
3326
|
/** spawnSync with options (scr_child.c): the cp.spawnSync core plus the
|
|
3248
3327
|
* option slice portless-class CLIs pass — timeout (killSignal fires at
|
|
3249
3328
|
* the deadline and the result carries error: ETIMEDOUT + the signal,
|
|
@@ -3309,6 +3388,13 @@ export type IrExpr =
|
|
|
3309
3388
|
value: string;
|
|
3310
3389
|
type: IrType;
|
|
3311
3390
|
loc: SrcLoc;
|
|
3391
|
+
}
|
|
3392
|
+
/** The singleton namespace token for one compiled or builtin module. */
|
|
3393
|
+
| {
|
|
3394
|
+
kind: "moduleNsRef";
|
|
3395
|
+
moduleId: string;
|
|
3396
|
+
type: IrType;
|
|
3397
|
+
loc: SrcLoc;
|
|
3312
3398
|
} | {
|
|
3313
3399
|
kind: "boolLit";
|
|
3314
3400
|
value: boolean;
|
|
@@ -3400,8 +3486,8 @@ export type IrExpr =
|
|
|
3400
3486
|
type: IrType;
|
|
3401
3487
|
loc: SrcLoc;
|
|
3402
3488
|
}
|
|
3403
|
-
/** JS ToBoolean: f64 is false iff 0, -0, or NaN; string is false iff empty
|
|
3404
|
-
*
|
|
3489
|
+
/** JS ToBoolean: f64 is false iff 0, -0, or NaN; string is false iff empty;
|
|
3490
|
+
* dyn asks its runtime kind. The other operand form is a UNION — the ARM
|
|
3405
3491
|
* value's ToBoolean via a per-union interned helper (unit arms false;
|
|
3406
3492
|
* f64/string/bool arms per-value; ref arms — arrays, records, objects,
|
|
3407
3493
|
* functions, maps, sets, promises, ... — always true; jsval arms ask the
|
|
@@ -5124,6 +5210,10 @@ export declare function moduleUsesNet(mod: IrModule): boolean;
|
|
|
5124
5210
|
* fence still emits release calls that need the unit linked. Symbol-free
|
|
5125
5211
|
* programs pay zero bytes and keep their exact link line. */
|
|
5126
5212
|
export declare function moduleUsesSymbol(mod: IrModule): boolean;
|
|
5213
|
+
/** True when bigint runtime operations or bigint-typed storage appears in
|
|
5214
|
+
* the IR. The type check keeps retain/release references link-safe even
|
|
5215
|
+
* when a producing statement was replaced by a runtime fence. */
|
|
5216
|
+
export declare function moduleUsesBigInt(mod: IrModule): boolean;
|
|
5127
5217
|
/** True when the module uses the URLSearchParams surface — sp.* libCalls,
|
|
5128
5218
|
* the url.searchParams getter, or a searchParams-kind type anywhere on
|
|
5129
5219
|
* the IR (a fenced statement can leave a typed local whose release call
|
|
@@ -5215,8 +5305,7 @@ export declare function moduleLibNondeterministicSurface(mod: IrModule): string
|
|
|
5215
5305
|
/** The may-throw seed: libCall members that can raise. Every fs.* member
|
|
5216
5306
|
* EXCEPT existsSync (which, like Node's, swallows errors and returns false)
|
|
5217
5307
|
* throws a catchable error on failure; json.parse throws a catchable
|
|
5218
|
-
* SyntaxError-shaped string on malformed input
|
|
5219
|
-
* throw. Backends' may-throw analyses must treat a function containing one
|
|
5308
|
+
* SyntaxError-shaped string on malformed input. Backends' may-throw analyses must treat a function containing one
|
|
5220
5309
|
* of these as throwing, exactly like a `throw` statement (and must ALSO
|
|
5221
5310
|
* seed on `dynCheck` and `awaitExpr` nodes, which throw on validation
|
|
5222
5311
|
* failure / promise rejection). */
|