@scriptc/compiler 0.2.1 → 0.2.3
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 +158 -31
- package/dist/backend/cycle-analysis.js +63 -50
- package/dist/backend/cycle-analysis.js.map +1 -1
- package/dist/backend/cycle-analysis.test.js +51 -0
- package/dist/backend/cycle-analysis.test.js.map +1 -1
- package/dist/backend/llvm/borrowed-receivers.d.ts +9 -0
- package/dist/backend/llvm/borrowed-receivers.js +58 -0
- package/dist/backend/llvm/borrowed-receivers.js.map +1 -0
- package/dist/backend/llvm/call-lifetimes.d.ts +20 -0
- package/dist/backend/llvm/call-lifetimes.js +179 -0
- package/dist/backend/llvm/call-lifetimes.js.map +1 -0
- package/dist/backend/llvm/call-lifetimes.test.d.ts +1 -0
- package/dist/backend/llvm/call-lifetimes.test.js +205 -0
- package/dist/backend/llvm/call-lifetimes.test.js.map +1 -0
- package/dist/backend/llvm/dyn.d.ts +5 -2
- package/dist/backend/llvm/dyn.js +163 -47
- package/dist/backend/llvm/dyn.js.map +1 -1
- package/dist/backend/llvm/emitter.d.ts +37 -1
- package/dist/backend/llvm/emitter.js +209 -21
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/backend/llvm/emitter.test.js +29 -2
- package/dist/backend/llvm/emitter.test.js.map +1 -1
- package/dist/backend/llvm/expr-async.js +1 -1
- package/dist/backend/llvm/expr-async.js.map +1 -1
- package/dist/backend/llvm/expr-calls.js +42 -5
- package/dist/backend/llvm/expr-calls.js.map +1 -1
- package/dist/backend/llvm/expr-containers.js +75 -13
- package/dist/backend/llvm/expr-containers.js.map +1 -1
- package/dist/backend/llvm/expr-dynamic.js +31 -6
- package/dist/backend/llvm/expr-dynamic.js.map +1 -1
- package/dist/backend/llvm/expr-primitives.js +6 -5
- package/dist/backend/llvm/expr-primitives.js.map +1 -1
- package/dist/backend/llvm/expr-records.js +1 -1
- package/dist/backend/llvm/expr-records.js.map +1 -1
- package/dist/backend/llvm/expr-stream-bridges.js +75 -19
- package/dist/backend/llvm/expr-stream-bridges.js.map +1 -1
- package/dist/backend/llvm/expr-stream-callbacks.d.ts +2 -2
- package/dist/backend/llvm/expr-stream-callbacks.js +7 -57
- package/dist/backend/llvm/expr-stream-callbacks.js.map +1 -1
- package/dist/backend/llvm/lib-dispatch.js +41 -3
- package/dist/backend/llvm/lib-dispatch.js.map +1 -1
- package/dist/backend/llvm/lib-filesystem.js +12 -9
- package/dist/backend/llvm/lib-filesystem.js.map +1 -1
- package/dist/backend/llvm/lib-shared.js +70 -2
- package/dist/backend/llvm/lib-shared.js.map +1 -1
- package/dist/backend/llvm/local-array-reads.d.ts +44 -0
- package/dist/backend/llvm/local-array-reads.js +313 -0
- package/dist/backend/llvm/local-array-reads.js.map +1 -0
- package/dist/backend/llvm/local-array-reads.test.d.ts +1 -0
- package/dist/backend/llvm/local-array-reads.test.js +446 -0
- package/dist/backend/llvm/local-array-reads.test.js.map +1 -0
- package/dist/backend/llvm/map-read-lifetimes.d.ts +36 -0
- package/dist/backend/llvm/map-read-lifetimes.js +128 -0
- package/dist/backend/llvm/map-read-lifetimes.js.map +1 -0
- package/dist/backend/llvm/map-read-lifetimes.test.d.ts +1 -0
- package/dist/backend/llvm/map-read-lifetimes.test.js +123 -0
- package/dist/backend/llvm/map-read-lifetimes.test.js.map +1 -0
- package/dist/backend/llvm/shapes.js +1 -0
- package/dist/backend/llvm/shapes.js.map +1 -1
- package/dist/backend/llvm/split.js +15 -5
- package/dist/backend/llvm/split.js.map +1 -1
- package/dist/backend/llvm/split.test.js +17 -0
- package/dist/backend/llvm/split.test.js.map +1 -1
- package/dist/backend/llvm/stack-unions.d.ts +20 -0
- package/dist/backend/llvm/stack-unions.js +61 -0
- package/dist/backend/llvm/stack-unions.js.map +1 -0
- package/dist/backend/llvm/stack-unions.test.d.ts +1 -0
- package/dist/backend/llvm/stack-unions.test.js +241 -0
- package/dist/backend/llvm/stack-unions.test.js.map +1 -0
- package/dist/backend/llvm/string-lifetimes.d.ts +12 -0
- package/dist/backend/llvm/string-lifetimes.js +70 -0
- package/dist/backend/llvm/string-lifetimes.js.map +1 -0
- package/dist/backend/llvm/string-lifetimes.test.d.ts +1 -0
- package/dist/backend/llvm/string-lifetimes.test.js +230 -0
- package/dist/backend/llvm/string-lifetimes.test.js.map +1 -0
- package/dist/backend/mangle.d.ts +2 -0
- package/dist/backend/mangle.js +4 -0
- package/dist/backend/mangle.js.map +1 -1
- package/dist/backend/may-throw.js +71 -29
- package/dist/backend/may-throw.js.map +1 -1
- package/dist/backend/may-throw.test.js +104 -1
- package/dist/backend/may-throw.test.js.map +1 -1
- package/dist/backend/native-codegen.d.ts +1 -1
- package/dist/backend/native-codegen.js +4 -3
- package/dist/backend/native-codegen.js.map +1 -1
- package/dist/backend/native-codegen.test.js +11 -0
- package/dist/backend/native-codegen.test.js.map +1 -1
- package/dist/backend/native-toolchain.d.ts +2 -2
- package/dist/backend/native-toolchain.js +2 -0
- package/dist/backend/native-toolchain.js.map +1 -1
- package/dist/backend/target-diagnostics.d.ts +5 -0
- package/dist/backend/target-diagnostics.js +72 -1
- package/dist/backend/target-diagnostics.js.map +1 -1
- package/dist/backend/target-diagnostics.test.d.ts +1 -0
- package/dist/backend/target-diagnostics.test.js +68 -0
- package/dist/backend/target-diagnostics.test.js.map +1 -0
- package/dist/coverage/surface-manifest.js +5 -3
- package/dist/coverage/surface-manifest.js.map +1 -1
- package/dist/executable/executable-cache.d.ts +7 -3
- package/dist/executable/executable-cache.js +47 -11
- package/dist/executable/executable-cache.js.map +1 -1
- package/dist/executable/executable-cache.test.js +109 -2
- package/dist/executable/executable-cache.test.js.map +1 -1
- package/dist/executable/prepare.js +2 -1
- package/dist/executable/prepare.js.map +1 -1
- package/dist/frontend/builtin-modules.d.ts +1 -1
- package/dist/frontend/builtin-modules.js +1 -1
- package/dist/frontend/builtin-modules.js.map +1 -1
- package/dist/frontend/function-completion.d.ts +6 -0
- package/dist/frontend/function-completion.js +50 -0
- package/dist/frontend/function-completion.js.map +1 -0
- package/dist/frontend/input-tracker.js +3 -3
- package/dist/frontend/input-tracker.js.map +1 -1
- package/dist/frontend/input-tracker.test.js +38 -2
- package/dist/frontend/input-tracker.test.js.map +1 -1
- package/dist/frontend/lowering/abstract-equality.js +5 -1
- package/dist/frontend/lowering/abstract-equality.js.map +1 -1
- package/dist/frontend/lowering/checked-iterable-spread.d.ts +4 -0
- package/dist/frontend/lowering/checked-iterable-spread.js +30 -0
- package/dist/frontend/lowering/checked-iterable-spread.js.map +1 -0
- package/dist/frontend/lowering/checked-promise-all.d.ts +5 -0
- package/dist/frontend/lowering/checked-promise-all.js +31 -0
- package/dist/frontend/lowering/checked-promise-all.js.map +1 -0
- package/dist/frontend/lowering/class-callbacks.d.ts +1 -1
- package/dist/frontend/lowering/class-callbacks.js +7 -6
- package/dist/frontend/lowering/class-callbacks.js.map +1 -1
- package/dist/frontend/lowering/class-construction.d.ts +2 -0
- package/dist/frontend/lowering/class-construction.js +34 -5
- package/dist/frontend/lowering/class-construction.js.map +1 -1
- package/dist/frontend/lowering/class-descriptors.d.ts +1 -1
- package/dist/frontend/lowering/class-descriptors.js +12 -5
- package/dist/frontend/lowering/class-descriptors.js.map +1 -1
- package/dist/frontend/lowering/class-dynamic-dispatch.d.ts +25 -0
- package/dist/frontend/lowering/class-dynamic-dispatch.js +597 -78
- package/dist/frontend/lowering/class-dynamic-dispatch.js.map +1 -1
- package/dist/frontend/lowering/class-dynamic-dispatch.test.js +64 -2
- package/dist/frontend/lowering/class-dynamic-dispatch.test.js.map +1 -1
- package/dist/frontend/lowering/class-instance-constructor.d.ts +1 -1
- package/dist/frontend/lowering/class-instance-constructor.js +11 -41
- package/dist/frontend/lowering/class-instance-constructor.js.map +1 -1
- package/dist/frontend/lowering/class-method-values.d.ts +16 -0
- package/dist/frontend/lowering/class-method-values.js +60 -29
- package/dist/frontend/lowering/class-method-values.js.map +1 -1
- package/dist/frontend/lowering/class-prototypes.d.ts +5 -1
- package/dist/frontend/lowering/class-prototypes.js +69 -10
- package/dist/frontend/lowering/class-prototypes.js.map +1 -1
- package/dist/frontend/lowering/class-runtime-statics.d.ts +4 -4
- package/dist/frontend/lowering/class-runtime-statics.js +26 -8
- package/dist/frontend/lowering/class-runtime-statics.js.map +1 -1
- package/dist/frontend/lowering/class-static-data.d.ts +1 -0
- package/dist/frontend/lowering/class-static-data.js +4 -2
- package/dist/frontend/lowering/class-static-data.js.map +1 -1
- package/dist/frontend/lowering/collection-ingestion.d.ts +31 -0
- package/dist/frontend/lowering/collection-ingestion.js +215 -0
- package/dist/frontend/lowering/collection-ingestion.js.map +1 -0
- package/dist/frontend/lowering/containers/bytes.js +19 -4
- package/dist/frontend/lowering/containers/bytes.js.map +1 -1
- package/dist/frontend/lowering/containers/string-and-regexp.js +6 -1
- package/dist/frontend/lowering/containers/string-and-regexp.js.map +1 -1
- package/dist/frontend/lowering/deferred-module-initializers.d.ts +13 -0
- package/dist/frontend/lowering/deferred-module-initializers.js +410 -0
- package/dist/frontend/lowering/deferred-module-initializers.js.map +1 -0
- package/dist/frontend/lowering/deferred-module-initializers.test.d.ts +1 -0
- package/dist/frontend/lowering/deferred-module-initializers.test.js +92 -0
- package/dist/frontend/lowering/deferred-module-initializers.test.js.map +1 -0
- package/dist/frontend/lowering/expressions/object-literals.js +31 -1
- package/dist/frontend/lowering/expressions/object-literals.js.map +1 -1
- package/dist/frontend/lowering/expressions/optional-chains.js +3 -3
- package/dist/frontend/lowering/expressions/optional-chains.js.map +1 -1
- package/dist/frontend/lowering/import-meta.d.ts +10 -0
- package/dist/frontend/lowering/import-meta.js +52 -0
- package/dist/frontend/lowering/import-meta.js.map +1 -0
- package/dist/frontend/lowering/lower-assert.js +105 -41
- package/dist/frontend/lowering/lower-assert.js.map +1 -1
- package/dist/frontend/lowering/lower-builtin-values.d.ts +2 -0
- package/dist/frontend/lowering/lower-builtin-values.js +22 -1
- package/dist/frontend/lowering/lower-builtin-values.js.map +1 -1
- package/dist/frontend/lowering/lower-builtins.d.ts +7 -22
- package/dist/frontend/lowering/lower-builtins.js +439 -95
- package/dist/frontend/lowering/lower-builtins.js.map +1 -1
- package/dist/frontend/lowering/lower-calls.js +289 -76
- package/dist/frontend/lowering/lower-calls.js.map +1 -1
- package/dist/frontend/lowering/lower-classes.d.ts +5 -0
- package/dist/frontend/lowering/lower-classes.js +443 -29
- package/dist/frontend/lowering/lower-classes.js.map +1 -1
- package/dist/frontend/lowering/lower-containers.d.ts +6 -2
- package/dist/frontend/lowering/lower-containers.js +79 -20
- package/dist/frontend/lowering/lower-containers.js.map +1 -1
- package/dist/frontend/lowering/lower-exprs.d.ts +10 -6
- package/dist/frontend/lowering/lower-exprs.js +329 -170
- package/dist/frontend/lowering/lower-exprs.js.map +1 -1
- package/dist/frontend/lowering/lower-generators.js +5 -1
- package/dist/frontend/lowering/lower-generators.js.map +1 -1
- package/dist/frontend/lowering/lower-inspect.js +58 -1
- package/dist/frontend/lowering/lower-inspect.js.map +1 -1
- package/dist/frontend/lowering/lower-island.js +4 -0
- package/dist/frontend/lowering/lower-island.js.map +1 -1
- package/dist/frontend/lowering/lower-island.test.d.ts +1 -0
- package/dist/frontend/lowering/lower-island.test.js +51 -0
- package/dist/frontend/lowering/lower-island.test.js.map +1 -0
- package/dist/frontend/lowering/lower-modules.d.ts +1 -3
- package/dist/frontend/lowering/lower-modules.js +186 -82
- package/dist/frontend/lowering/lower-modules.js.map +1 -1
- package/dist/frontend/lowering/lower-modules.test.js +69 -1
- package/dist/frontend/lowering/lower-modules.test.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.js +172 -103
- package/dist/frontend/lowering/lower-stmts.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.test.d.ts +1 -0
- package/dist/frontend/lowering/lower-stmts.test.js +77 -0
- package/dist/frontend/lowering/lower-stmts.test.js.map +1 -0
- package/dist/frontend/lowering/lower-stream.js +2 -0
- package/dist/frontend/lowering/lower-stream.js.map +1 -1
- package/dist/frontend/lowering/lower-system-errors.d.ts +6 -0
- package/dist/frontend/lowering/lower-system-errors.js +29 -0
- package/dist/frontend/lowering/lower-system-errors.js.map +1 -0
- package/dist/frontend/lowering/lower-url.d.ts +2 -1
- package/dist/frontend/lowering/lower-url.js +32 -9
- package/dist/frontend/lowering/lower-url.js.map +1 -1
- package/dist/frontend/lowering/lowerer.d.ts +30 -12
- package/dist/frontend/lowering/lowerer.js +268 -49
- package/dist/frontend/lowering/lowerer.js.map +1 -1
- package/dist/frontend/lowering/lowerer.test.js +38 -0
- package/dist/frontend/lowering/lowerer.test.js.map +1 -1
- package/dist/frontend/lowering/module-namespace-elements.d.ts +7 -0
- package/dist/frontend/lowering/module-namespace-elements.js +54 -0
- package/dist/frontend/lowering/module-namespace-elements.js.map +1 -0
- package/dist/frontend/lowering/object-factory-new.d.ts +4 -3
- package/dist/frontend/lowering/object-factory-new.js +27 -14
- package/dist/frontend/lowering/object-factory-new.js.map +1 -1
- package/dist/frontend/lowering/surfaces.d.ts +3 -2
- package/dist/frontend/lowering/surfaces.js +93 -33
- package/dist/frontend/lowering/surfaces.js.map +1 -1
- package/dist/frontend/lowering/text-decoder-encoding.js +3 -0
- package/dist/frontend/lowering/text-decoder-encoding.js.map +1 -1
- package/dist/frontend/lowering/text-decoder-encoding.test.js +2 -1
- package/dist/frontend/lowering/text-decoder-encoding.test.js.map +1 -1
- package/dist/frontend/module-syntax.d.ts +1 -1
- package/dist/frontend/module-syntax.js +8 -1
- package/dist/frontend/module-syntax.js.map +1 -1
- package/dist/frontend/module-syntax.test.js +10 -0
- package/dist/frontend/module-syntax.test.js.map +1 -1
- package/dist/frontend/npm.d.ts +4 -0
- package/dist/frontend/npm.js +86 -33
- package/dist/frontend/npm.js.map +1 -1
- package/dist/frontend/npm.test.js +103 -0
- package/dist/frontend/npm.test.js.map +1 -1
- package/dist/frontend/pipeline-native.js +2 -1
- package/dist/frontend/pipeline-native.js.map +1 -1
- package/dist/frontend/program.js +4 -2
- package/dist/frontend/program.js.map +1 -1
- package/dist/frontend/services-node.js +3 -2
- package/dist/frontend/services-node.js.map +1 -1
- package/dist/frontend/services.d.ts +5 -1
- package/dist/frontend/services.js +9 -1
- package/dist/frontend/services.js.map +1 -1
- package/dist/frontend/services.test.js +21 -0
- package/dist/frontend/services.test.js.map +1 -1
- package/dist/frontend/ts7/ast-node.d.ts +2 -0
- package/dist/frontend/ts7/ast-node.js +30 -4
- package/dist/frontend/ts7/ast-node.js.map +1 -1
- package/dist/frontend/ts7/ast-node.test.js +60 -1
- package/dist/frontend/ts7/ast-node.test.js.map +1 -1
- package/dist/frontend/type-mapper.js +89 -14
- package/dist/frontend/type-mapper.js.map +1 -1
- package/dist/frontend/union-discriminants.js +22 -7
- package/dist/frontend/union-discriminants.js.map +1 -1
- package/dist/index.js +19 -12
- 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/integer-loops.d.ts +7 -0
- package/dist/ir/integer-loops.js +23 -0
- package/dist/ir/integer-loops.js.map +1 -1
- package/dist/ir/integer-loops.test.d.ts +1 -0
- package/dist/ir/integer-loops.test.js +41 -0
- package/dist/ir/integer-loops.test.js.map +1 -0
- package/dist/ir/ir.d.ts +44 -26
- package/dist/ir/ir.js +69 -11
- package/dist/ir/ir.js.map +1 -1
- package/dist/ir/ir.test.js +18 -0
- package/dist/ir/ir.test.js.map +1 -1
- package/dist/ir/serialize.js +21 -1
- package/dist/ir/serialize.js.map +1 -1
- package/dist/ir/serialize.test.js +21 -0
- package/dist/ir/serialize.test.js.map +1 -1
- package/dist/ir/traverse.d.ts +0 -3
- package/dist/ir/traverse.js +33 -20
- package/dist/ir/traverse.js.map +1 -1
- package/dist/ir/validate.js +216 -80
- package/dist/ir/validate.js.map +1 -1
- package/dist/ir/validate.test.js +244 -1
- package/dist/ir/validate.test.js.map +1 -1
- package/dist/library/compiler-self-identity.js +1 -1
- package/dist/library/compiler-self-identity.test.js +2 -2
- package/dist/library/compiler-self-identity.test.js.map +1 -1
- package/dist/library/fence-eval.js +9 -2
- package/dist/library/fence-eval.js.map +1 -1
- package/dist/library/fence-eval.test.d.ts +1 -0
- package/dist/library/fence-eval.test.js +21 -0
- package/dist/library/fence-eval.test.js.map +1 -0
- package/dist/library/int-infer.d.ts +2 -2
- package/dist/library/int-infer.js +10 -7
- package/dist/library/int-infer.js.map +1 -1
- package/dist/library/int-infer.test.js +44 -0
- package/dist/library/int-infer.test.js.map +1 -1
- package/dist/library/prepare.js +2 -1
- package/dist/library/prepare.js.map +1 -1
- package/dist/native/runtime-typescript.d.ts +4 -0
- package/dist/native/runtime-typescript.js +61 -0
- package/dist/native/runtime-typescript.js.map +1 -0
- package/dist/native/runtime-typescript.test.d.ts +1 -0
- package/dist/native/runtime-typescript.test.js +41 -0
- package/dist/native/runtime-typescript.test.js.map +1 -0
- package/package.json +20 -20
- package/surface-manifest.json +385 -29
package/dist/ir/ir.d.ts
CHANGED
|
@@ -805,6 +805,10 @@ export interface IrClassDef {
|
|
|
805
805
|
prototypeDataHelper?: string;
|
|
806
806
|
/** Native instance to its actual prototype, including factory captures and subclasses. */
|
|
807
807
|
instancePrototypeHelper?: string;
|
|
808
|
+
/** Public JavaScript fields record their creation in the shared property
|
|
809
|
+
* bag. Its descriptors preserve presence and insertion order independently
|
|
810
|
+
* of native layout order; field values remain in their native slots. */
|
|
811
|
+
tracksOwnFields?: boolean;
|
|
808
812
|
/** Stable module symbol identities for public instance layout fields. */
|
|
809
813
|
symbolFields?: {
|
|
810
814
|
field: string;
|
|
@@ -991,6 +995,9 @@ export interface IrFunction {
|
|
|
991
995
|
/** Original TS name (mangling is a backend concern). Lifted lambdas get
|
|
992
996
|
* synthetic '%'-prefixed names ('%' can't appear in a TS identifier). */
|
|
993
997
|
name: string;
|
|
998
|
+
/** Generated reflection dispatch contains speculative source-member edges.
|
|
999
|
+
* Target-only host operations behind those edges retain runtime refusals. */
|
|
1000
|
+
speculativeDispatch?: boolean;
|
|
994
1001
|
params: IrParam[];
|
|
995
1002
|
returnType: IrType;
|
|
996
1003
|
/** All locals including params, pre-collected and scope-flat: ids are
|
|
@@ -1455,7 +1462,7 @@ export type IrSetIntrinsicMethod = "add" | "has" | "delete" | "size" | "clear" |
|
|
|
1455
1462
|
* halves become U+FFFD, divergence 2). `padStart`/`padEnd` take (target
|
|
1456
1463
|
* length, fill) — the frontend completes an omitted fill to " ", Node's
|
|
1457
1464
|
* default. `trimStart`/`trimEnd` are trim's one-sided halves. */
|
|
1458
|
-
export type IrStrIntrinsicMethod = "length" | "charCodeAt" | "charAt" | "indexOf" | "includes" | "startsWith" | "endsWith" | "slice" | "substring" | "repeat" | "trim" | "trimStart" | "trimEnd" | "split" | "padStart" | "padEnd" | "toLowerCase" | "toUpperCase" | "isWellFormed" | "toWellFormed" | "cpAt";
|
|
1465
|
+
export type IrStrIntrinsicMethod = "length" | "charCodeAt" | "charAt" | "indexOf" | "includes" | "startsWith" | "endsWith" | "slice" | "substring" | "repeat" | "trim" | "trimStart" | "trimEnd" | "split" | "padStart" | "padEnd" | "toLowerCase" | "toUpperCase" | "normalize" | "isWellFormed" | "toWellFormed" | "cpAt";
|
|
1459
1466
|
/** The typed-array/Buffer method surface (bytesIntrinsic). Receiver/arg
|
|
1460
1467
|
* conventions (validated): `length`/`byteLength` are property reads → f64;
|
|
1461
1468
|
* `get` takes one f64 index → f64 (trap on any invalid index, like
|
|
@@ -1602,7 +1609,7 @@ export type IrLibFn = "ffi.argument" | "ffi.memoryModule" | "intl.segmenterNew"
|
|
|
1602
1609
|
* answers once the response head arrives; the response body readers
|
|
1603
1610
|
* consume the native body stream. AbortSignal and ReadableStream values
|
|
1604
1611
|
* are opaque checked-dynamic handles. */
|
|
1605
|
-
| "fetch.start" | "fetch.input" | "fetch.function" | "fetch.requestNew" | "fetch.headersNew" | "fetch.responseNew" | "fetch.responseArrayBuffer" | "fetch.responseJson" | "fetch.responseText" | "fetch.responseBytes" | "fetch.abortControllerNew" | "fetch.abortTimeout" | "fetch.abortNow" | "fetch.abortAny" | "fetch.webIs" | "fetch.streamIs" | "fetch.streamNew" | "fetch.streamFrom" | "fetch.readerRead" | "island.eval"
|
|
1612
|
+
| "fetch.start" | "fetch.input" | "fetch.function" | "fetch.requestNew" | "fetch.headersNew" | "fetch.responseNew" | "fetch.responseArrayBuffer" | "fetch.responseJson" | "fetch.responseText" | "fetch.responseBytes" | "fetch.abortControllerNew" | "fetch.abortTimeout" | "fetch.abortNow" | "fetch.abortAny" | "abort.controllerNew" | "abort.timeout" | "abort.now" | "abort.any" | "fetch.webIs" | "fetch.streamIs" | "fetch.streamNew" | "fetch.streamFrom" | "fetch.readerRead" | "island.eval"
|
|
1606
1613
|
/** Load an embedded npm package's runtime entry in the island (cached by
|
|
1607
1614
|
* the engine's module registry) and take one export: args are the entry
|
|
1608
1615
|
* KEY (an embedded module's key, from IrModule.embedded) and the export
|
|
@@ -1676,7 +1683,7 @@ export type IrLibFn = "ffi.argument" | "ffi.memoryModule" | "intl.segmenterNew"
|
|
|
1676
1683
|
* descriptors and non-object targets/descriptors throw catchably
|
|
1677
1684
|
* (Node's TypeError texts; accessors the loud unsupported Error). In
|
|
1678
1685
|
* the may-throw seed set. */
|
|
1679
|
-
| "dyn.defineProps" | "dyn.defineProperty" | "dyn.getOwnPropertyDescriptor" | "dyn.arrayProtoCall"
|
|
1686
|
+
| "dyn.defineProps" | "dyn.defineProperty" | "dyn.getOwnPropertyDescriptor" | "dyn.arrayProtoCall" | "dyn.promiseAll"
|
|
1680
1687
|
/** Bare `typeof v` on a dyn value AS A STRING (arg: the dyn value,
|
|
1681
1688
|
* borrowed; result: an owned string) — the dyn kind's JS answer:
|
|
1682
1689
|
* undefined→"undefined", null/object/array/bytes→"object" (JS's oldest
|
|
@@ -1859,14 +1866,21 @@ export type IrLibFn = "ffi.argument" | "ffi.memoryModule" | "intl.segmenterNew"
|
|
|
1859
1866
|
* result is constant true there). Borrows the name; never throws. */
|
|
1860
1867
|
| "process.envUnset"
|
|
1861
1868
|
/** node:url + the URL class (scr_url.c). url.new parses one absolute
|
|
1862
|
-
* URL string into
|
|
1869
|
+
* URL string into a mutable URL value (+1) — invalid input THROWS a
|
|
1863
1870
|
* catchable TypeError ("Invalid URL"), like Node's constructor. The
|
|
1864
1871
|
* getters (borrowed receiver, +1 string) never throw; url.href doubles
|
|
1865
1872
|
* as toString(). fileURLToPath has one libFn per receiver form (URL
|
|
1866
1873
|
* value / string) — both THROW Node's TypeErrors on non-file schemes,
|
|
1867
1874
|
* encoded slashes, and non-empty hosts. url.pathToFileURL resolves the
|
|
1868
1875
|
* path (getcwd) and never throws. */
|
|
1869
|
-
| "url.new" | "url.newBase"
|
|
1876
|
+
| "url.new" | "url.newBase"
|
|
1877
|
+
/** Factories consume already-converted input/base strings. canParse
|
|
1878
|
+
* answers a boolean; parse returns a checked native URL or null (+1).
|
|
1879
|
+
* Parser failures are suppressed; conversion occurs before these calls. */
|
|
1880
|
+
| "url.canParse" | "url.canParseBase" | "url.parse" | "url.parseBase" | "url.protocol" | "url.origin" | "url.username" | "url.password" | "url.host" | "url.hostname" | "url.port" | "url.pathname" | "url.href"
|
|
1881
|
+
/** Selected component writes borrow the receiver and converted string.
|
|
1882
|
+
* href replaces its parsed fields while retaining cached params identity. */
|
|
1883
|
+
| "url.set" | "url.setChecked" | "url.fileURLToPathUrl" | "url.fileURLToPathChecked" | "url.fileURLToPathOptions" | "url.fileURLToPathBuffer" | "url.pathToFileURLChecked" | "url.fileURLToPathStr" | "url.pathToFileURL"
|
|
1870
1884
|
/** Explicit path syntax from the options.windows argument, independent
|
|
1871
1885
|
* of the executable's host platform. Windows UNC input can throw. */
|
|
1872
1886
|
| "url.pathToFileURLPlatform"
|
|
@@ -1919,7 +1933,7 @@ export type IrLibFn = "ffi.argument" | "ffi.memoryModule" | "intl.segmenterNew"
|
|
|
1919
1933
|
* checked-dynamic ParsedResults tree out. Statically typed member reads
|
|
1920
1934
|
* validate their values when leaving that tree. The native parser may
|
|
1921
1935
|
* throw Node's coded validation/grammar TypeErrors. */
|
|
1922
|
-
| "util.parseArgs"
|
|
1936
|
+
| "util.parseArgs" | "util.parseEnv" | "util.getSystemErrorName" | "util.getSystemErrorMessage" | "util.systemErrorEntries" | "util.stripVTControlCharacters" | "util.toUSVString" | "util.isDeepStrictEqual" | "util.styleText" | "util.typeIs" | "util.typeValue"
|
|
1923
1937
|
/** ES Symbol values (scr_symbol.c — link-gated by moduleUsesSymbol).
|
|
1924
1938
|
* sym.new: `Symbol(desc)` — a fresh runtime-unique identity (+1) whose
|
|
1925
1939
|
* one arg is the description string (borrowed); sym.newAnon is the
|
|
@@ -2478,10 +2492,10 @@ export type IrLibFn = "ffi.argument" | "ffi.memoryModule" | "intl.segmenterNew"
|
|
|
2478
2492
|
* the entries below; all paths share the incremental runtime core. */
|
|
2479
2493
|
| "crypto.hashDigestStr" | "crypto.hashDigestBytes"
|
|
2480
2494
|
/** First-class static Hash/Hmac handles. Constructors validate the
|
|
2481
|
-
* runtime algorithm string (
|
|
2495
|
+
* runtime algorithm string (MD5, SHA-1, or SHA-2); update returns the same
|
|
2482
2496
|
* handle by retained identity, copy snapshots Hash state, and digest
|
|
2483
2497
|
* finalizes the handle and returns either a Buffer or encoded string. */
|
|
2484
|
-
| "crypto.native" | "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"
|
|
2498
|
+
| "crypto.native" | "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" | "crypto.hkdf" | "crypto.hkdfCb" | "crypto.scrypt" | "crypto.scryptCb"
|
|
2485
2499
|
/** crypto.randomBytes(n) → a real u8 Buffer (+1). THROWS Node's
|
|
2486
2500
|
* RangeError on out-of-range sizes, exactly like the composed
|
|
2487
2501
|
* randomBytesToString (which keeps its one-libCall lowering — the two
|
|
@@ -2584,7 +2598,7 @@ export type IrLibFn = "ffi.argument" | "ffi.memoryModule" | "intl.segmenterNew"
|
|
|
2584
2598
|
* literal { recursive?, mode? } options (the mkdirSync matrix behind
|
|
2585
2599
|
* settled promises), unlink, chmod. Failures REJECT (catchable at the
|
|
2586
2600
|
* await), like the rest of the fsp family. */
|
|
2587
|
-
| "fsp.mkdirMode" | "fsp.mkdirRecursive" | "fsp.mkdirRecursiveMode" | "fsp.unlink" | "fsp.chmod" | "fsp.rename" | "fsp.readdir"
|
|
2601
|
+
| "fsp.mkdirMode" | "fsp.mkdirRecursive" | "fsp.mkdirRecursiveMode" | "fsp.unlink" | "fsp.chmod" | "fsp.link" | "fsp.symlink" | "fsp.readlink" | "fsp.statfs" | "fsp.readlinkStr" | "fsp.readlinkBuffer" | "fsp.utimes" | "fsp.lutimes" | "fsp.rename" | "fsp.readdir"
|
|
2588
2602
|
/** `fs.promises.readdir(path, { withFileTypes: true })` — the settled-
|
|
2589
2603
|
* promise twin of fs.readdirTypesSync. The backends assemble the same
|
|
2590
2604
|
* call-site-shaped Dirent rows, then move the array into a promise;
|
|
@@ -2595,7 +2609,7 @@ export type IrLibFn = "ffi.argument" | "ffi.memoryModule" | "intl.segmenterNew"
|
|
|
2595
2609
|
* become rejections rather than escaping synchronously. read/write
|
|
2596
2610
|
* results are call-site record shapes ({ bytesRead/bytesWritten,
|
|
2597
2611
|
* buffer }) assembled by the backends around the fixed runtime ABI. */
|
|
2598
|
-
| "fsp.open" | "fileHandle.fd" | "fileHandle.close" | "fileHandle.read" | "fileHandle.writeBytes" | "fileHandle.writeStr" | "fileHandle.readFile" | "fileHandle.readFileBytes" | "fileHandle.writeFile" | "fileHandle.writeFileBytes" | "fileHandle.stat" | "process.argv" | "process.platform"
|
|
2612
|
+
| "fsp.open" | "fileHandle.fd" | "fileHandle.close" | "fileHandle.sync" | "fileHandle.datasync" | "fileHandle.truncate" | "fileHandle.chmod" | "fileHandle.utimes" | "fileHandle.readv" | "fileHandle.writev" | "fileHandle.read" | "fileHandle.writeBytes" | "fileHandle.writeStr" | "fileHandle.readFile" | "fileHandle.readFileBytes" | "fileHandle.writeFile" | "fileHandle.writeFileBytes" | "fileHandle.stat" | "process.argv" | "process.platform"
|
|
2599
2613
|
/** getenv(3): one string key arg → the interned `string | undefined`
|
|
2600
2614
|
* union (present: +1 string wrapped into the string arm; absent: the
|
|
2601
2615
|
* interned undefined-arm instance). BOTH source forms — `process.env.FOO`
|
|
@@ -2648,7 +2662,7 @@ export type IrLibFn = "ffi.argument" | "ffi.memoryModule" | "intl.segmenterNew"
|
|
|
2648
2662
|
| "process.umask"
|
|
2649
2663
|
/** chdir(2) — throws Node's fs-shaped error (ENOENT/EACCES/ENOTDIR,
|
|
2650
2664
|
* syscall "chdir") on failure. */
|
|
2651
|
-
| "process.chdir"
|
|
2665
|
+
| "process.chdir" | "process.loadEnvFile"
|
|
2652
2666
|
/** process._exiting: true once the exit sequence began (exit listeners
|
|
2653
2667
|
* running) — the runtime flag scr_run_exit_listeners/process.exit set.
|
|
2654
2668
|
* Never throws. */
|
|
@@ -2908,14 +2922,14 @@ export type IrLibFn = "ffi.argument" | "ffi.memoryModule" | "intl.segmenterNew"
|
|
|
2908
2922
|
* drives the real iterator protocol, whose failure describes the VALUE
|
|
2909
2923
|
* ("object null is not iterable (cannot read property
|
|
2910
2924
|
* Symbol(Symbol.iterator))"). The frontend picks by position. */
|
|
2911
|
-
| "dyn.packPushSpreadIter" | "dyn.assignAll" | "dyn.reflectApply"
|
|
2925
|
+
| "dyn.packPushSpreadIter" | "dyn.assignAll" | "dyn.reflectApply" | "dyn.reflectGet" | "dyn.reflectSet" | "dyn.reflectDefine" | "dyn.abstractEq"
|
|
2912
2926
|
/** `Object.create(null)` (scr_json.c): a fresh NULL-PROTOTYPE dyn
|
|
2913
2927
|
* dictionary. The checked-dynamic tree's OBJ dispatch is already own-member-only —
|
|
2914
2928
|
* Node's null-proto answer — so the flag's whole job is the observations
|
|
2915
2929
|
* that SEE the prototype: inspect's "[Object: null prototype]" prefix
|
|
2916
2930
|
* and deepStrictEqual's prototype gate. Never throws. Static builds
|
|
2917
2931
|
* only; --dynamic routes Object.create through the engine instead. */
|
|
2918
|
-
| "dyn.objCreateNullProto" | "dyn.arrayPrototype" | "dyn.objectPrototype" | "dyn.functionApply" | "dyn.builtinMethod" | "dyn.classPrototype" | "dyn.classBasePrototype" | "dyn.classInherit" | "dyn.classSuper" | "dyn.assignPrototype" | "dyn.objCreate" | "dyn.objCreateWithProperties" | "dyn.getPrototype" | "dyn.setPrototype" | "dyn.getOwnPropertyNames" | "dyn.ownKeys" | "dyn.getOwnPropertySymbols" | "dyn.getOwnPropertyDescriptors" | "dyn.preventExtensions" | "dyn.isExtensible" | "dyn.seal" | "dyn.isSealed" | "dyn.objValues" | "dyn.objEntries"
|
|
2932
|
+
| "dyn.objCreateNullProto" | "dyn.arrayPrototype" | "dyn.arrayConstructor" | "dyn.objectPrototype" | "dyn.functionApply" | "dyn.builtinMethod" | "dyn.classPrototype" | "dyn.classBasePrototype" | "dyn.classInherit" | "dyn.classSuper" | "dyn.assignPrototype" | "dyn.definePrototypeProps" | "dyn.bagGet" | "dyn.bagSet" | "dyn.objCreate" | "dyn.objCreateWithProperties" | "dyn.getPrototype" | "dyn.setPrototype" | "dyn.getOwnPropertyNames" | "dyn.ownKeys" | "dyn.getOwnPropertySymbols" | "dyn.getOwnPropertyDescriptors" | "dyn.preventExtensions" | "dyn.isExtensible" | "dyn.seal" | "dyn.isSealed" | "dyn.objValues" | "dyn.objEntries"
|
|
2919
2933
|
/** structuredClone over the checked-dynamic tree (scr_json.c): the JSON-safe subset plus
|
|
2920
2934
|
* bytes (a fresh copy — a Buffer clones as a plain Uint8Array, like
|
|
2921
2935
|
* Node), deep. Functions and handle kinds throw the spec's catchable
|
|
@@ -3122,7 +3136,7 @@ export type IrLibFn = "ffi.argument" | "ffi.memoryModule" | "intl.segmenterNew"
|
|
|
3122
3136
|
* the value's inspection) — the frontend routes null/undefined to a
|
|
3123
3137
|
* no-op and everything else here (Node throws for falsy values too).
|
|
3124
3138
|
* All arguments are borrowed. */
|
|
3125
|
-
| "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"
|
|
3139
|
+
| "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" | "assert.unwantedError" | "assert.noErrorPredicate" | "assert.regexDynTest"
|
|
3126
3140
|
/** Node's expectsError over an error-INSTANCE expected (assert.throws/
|
|
3127
3141
|
* rejects second argument): walk the expected dyn error's keys (name,
|
|
3128
3142
|
* message, code — the %error marker skipped) and deep-compare each
|
|
@@ -3372,7 +3386,7 @@ export type IrLibFn = "ffi.argument" | "ffi.memoryModule" | "intl.segmenterNew"
|
|
|
3372
3386
|
* mapping tables are generated from the pinned Node 24 oracle, keeping
|
|
3373
3387
|
* output portable without an ICU/iconv dependency. Borrowed args; owned
|
|
3374
3388
|
* (+1) string; never throws. */
|
|
3375
|
-
| "text.decodeLegacy" | "text.decoderEncoding"
|
|
3389
|
+
| "text.decodeLegacy" | "text.decoderEncoding" | "text.decoderName" | "text.encodeInto" | "buffer.isAscii" | "buffer.isUtf8" | "buffer.transcode"
|
|
3376
3390
|
/** The wider sync fs slice (scr_lib.c), all throwing catchably with
|
|
3377
3391
|
* Node's errno message shapes and `.code` stamped like the rest of
|
|
3378
3392
|
* sync fs. unlink/chmod/chown wrap the syscalls 1:1 (Node reports the
|
|
@@ -3394,7 +3408,7 @@ export type IrLibFn = "ffi.argument" | "ffi.memoryModule" | "intl.segmenterNew"
|
|
|
3394
3408
|
/** renameSync is the direct two-path syscall wrapper. renameCb defers
|
|
3395
3409
|
* the operation to the loop and fires a program-shaped Error | null
|
|
3396
3410
|
* callback through a backend-emitted adapter. */
|
|
3397
|
-
| "fs.renameSync" | "fs.renameCb" | "fs.lstatSync" | "fs.fstatSync" | "fs.fchmodSync" | "fs.fsyncSync" | "fs.linkSync"
|
|
3411
|
+
| "fs.renameSync" | "fs.renameCb" | "fs.lstatSync" | "fs.fstatSync" | "fs.fchmodSync" | "fs.fsyncSync" | "fs.fdatasyncSync" | "fs.ftruncateSync" | "fs.utimesSync" | "fs.futimesSync" | "fs.lutimesSync" | "fs.readvSync" | "fs.writevSync" | "fs.linkSync" | "fs.symlinkSync" | "fs.readlinkSync" | "fs.statfsSync" | "fs.readlinkSyncStr" | "fs.readlinkSyncBuffer"
|
|
3398
3412
|
/** fs.openSync(path, flags) → the raw fd as f64; fs.readSync/fs.writeSync
|
|
3399
3413
|
* over Buffer windows perform sequential I/O when position is -1 and
|
|
3400
3414
|
* offset-preserving positioned I/O otherwise; fs.writeStrSync is the
|
|
@@ -3974,12 +3988,10 @@ export type IrExpr =
|
|
|
3974
3988
|
}
|
|
3975
3989
|
/** `new Set<T>()` — allocate an empty set. `type` is the set type (the
|
|
3976
3990
|
* element fence already enforced by the frontend); the result is owned
|
|
3977
|
-
* (+1). `seed`
|
|
3978
|
-
*
|
|
3979
|
-
*
|
|
3980
|
-
*
|
|
3981
|
-
* SameValueZero — exactly JS). Non-array seeds (another Set, general
|
|
3982
|
-
* iterables) stay frontend-fenced. */
|
|
3991
|
+
* (+1). `seed` is one borrowed array whose elements add() in order
|
|
3992
|
+
* (duplicates collapse, first insertion position wins, SameValueZero).
|
|
3993
|
+
* The frontend materializes supported non-array seeds, including Sets,
|
|
3994
|
+
* strings, tuples, and collection iterators, before constructing this IR. */
|
|
3983
3995
|
| {
|
|
3984
3996
|
kind: "setNew";
|
|
3985
3997
|
seed?: IrExpr;
|
|
@@ -4436,6 +4448,7 @@ export type IrExpr =
|
|
|
4436
4448
|
callee: IrExpr;
|
|
4437
4449
|
receiver?: IrExpr;
|
|
4438
4450
|
calleeName: string;
|
|
4451
|
+
calleeNameValue?: IrExpr;
|
|
4439
4452
|
args: IrExpr[];
|
|
4440
4453
|
spreads?: {
|
|
4441
4454
|
arg: number;
|
|
@@ -4462,6 +4475,7 @@ export type IrExpr =
|
|
|
4462
4475
|
recv: IrExpr;
|
|
4463
4476
|
method: string;
|
|
4464
4477
|
calleeName: string;
|
|
4478
|
+
calleeNameValue?: IrExpr;
|
|
4465
4479
|
args: IrExpr[];
|
|
4466
4480
|
type: IrType;
|
|
4467
4481
|
loc: SrcLoc;
|
|
@@ -4901,6 +4915,7 @@ export type IrExpr =
|
|
|
4901
4915
|
args: IrExpr[];
|
|
4902
4916
|
type: IrType;
|
|
4903
4917
|
loc: SrcLoc;
|
|
4918
|
+
prototypeIdentityOnly?: true;
|
|
4904
4919
|
}
|
|
4905
4920
|
/** `JSON.stringify(v)` — type-DIRECTED serialization: `value`'s static IR
|
|
4906
4921
|
* type must be JSON-safe (f64/string/bool/record/array/union of those,
|
|
@@ -4938,10 +4953,13 @@ export type IrExpr =
|
|
|
4938
4953
|
* The dyn operand is borrowed; the result is owned (+1). This is
|
|
4939
4954
|
* scriptc-specific behavior — JS `as` never checks (SEMANTICS.md
|
|
4940
4955
|
* documents it as the headline divergence: a lying cast throws instead of
|
|
4941
|
-
* corrupting memory).
|
|
4956
|
+
* corrupting memory). `preserveRefs` refuses structural copies of native
|
|
4957
|
+
* references, including references nested in newly materialized arrays or
|
|
4958
|
+
* tuples; collection seeds use it to preserve key identity. */
|
|
4942
4959
|
| {
|
|
4943
4960
|
kind: "dynCheck";
|
|
4944
4961
|
value: IrExpr;
|
|
4962
|
+
preserveRefs?: true;
|
|
4945
4963
|
type: IrType;
|
|
4946
4964
|
loc: SrcLoc;
|
|
4947
4965
|
}
|
|
@@ -5416,9 +5434,9 @@ export declare function moduleUsesSearchParams(mod: IrModule): boolean;
|
|
|
5416
5434
|
* loop hooks, cross-compiles everywhere). qs-free programs keep their
|
|
5417
5435
|
* exact link line. Same generic-walk shape as moduleUsesZlib. */
|
|
5418
5436
|
export declare function moduleUsesQs(mod: IrModule): boolean;
|
|
5419
|
-
/** True when the module uses native util
|
|
5420
|
-
*
|
|
5421
|
-
*
|
|
5437
|
+
/** True when the module uses native util parsing, comparison, or styling.
|
|
5438
|
+
* The utility units also follow their required symbol, inspection, and
|
|
5439
|
+
* warning features, independently of the island's node:util shim. */
|
|
5422
5440
|
export declare function moduleUsesParseArgs(mod: IrModule): boolean;
|
|
5423
5441
|
/** True when the module contains any fs.watch/watcher.* libCall — the
|
|
5424
5442
|
* link switch that pulls scr_watch.c into the binary and has the emitted
|
package/dist/ir/ir.js
CHANGED
|
@@ -1086,6 +1086,7 @@ function canBoxDynComposite(t, getRecord, getUnion, visiting = new Set()) {
|
|
|
1086
1086
|
}
|
|
1087
1087
|
function canBoxDynCompositeAt(t, getRecord, getUnion, visiting) {
|
|
1088
1088
|
switch (t.kind) {
|
|
1089
|
+
case "procStream":
|
|
1089
1090
|
case "f64":
|
|
1090
1091
|
case "bigint":
|
|
1091
1092
|
case "symbol":
|
|
@@ -1111,7 +1112,9 @@ function canBoxDynCompositeAt(t, getRecord, getUnion, visiting) {
|
|
|
1111
1112
|
case "object":
|
|
1112
1113
|
return RUNTIME_ERROR_CLASSES.has(t.className) || isDynTypedRefType(t);
|
|
1113
1114
|
case "array":
|
|
1114
|
-
|
|
1115
|
+
// Process streams have scalar storage only in fields, closures and
|
|
1116
|
+
// unions. A direct procStream array has no native ScrArr layout.
|
|
1117
|
+
return t.elem.kind !== "procStream" && canBoxDynComposite(t.elem, getRecord, getUnion, visiting);
|
|
1115
1118
|
case "record": {
|
|
1116
1119
|
const shape = getRecord(t.shapeId);
|
|
1117
1120
|
if (!shape)
|
|
@@ -1181,6 +1184,8 @@ function clearDynConversionResults(visiting) {
|
|
|
1181
1184
|
}
|
|
1182
1185
|
}
|
|
1183
1186
|
function canDynCheckToAt(t, getRecord, getUnion, visiting) {
|
|
1187
|
+
if (t.kind === "procStream")
|
|
1188
|
+
return true;
|
|
1184
1189
|
// Unknown fields keep an owned dyn subtree; checking the surrounding
|
|
1185
1190
|
// record/array still validates its layout. This is broader than the
|
|
1186
1191
|
// stringify/island JSON domain, which cannot assume opaque slots are
|
|
@@ -1207,6 +1212,8 @@ function canDynCheckToAt(t, getRecord, getUnion, visiting) {
|
|
|
1207
1212
|
if (isDynTypedRefType(t))
|
|
1208
1213
|
return true;
|
|
1209
1214
|
if (t.kind === "array") {
|
|
1215
|
+
if (t.elem.kind === "procStream")
|
|
1216
|
+
return false;
|
|
1210
1217
|
const key = typeKey(t);
|
|
1211
1218
|
if (visiting.has(key))
|
|
1212
1219
|
return false;
|
|
@@ -1334,10 +1341,11 @@ export function canExitIslandToType(t, getRecord, getUnion) {
|
|
|
1334
1341
|
const DYN_ASYNC_LIB_FNS = new Set([
|
|
1335
1342
|
"fs.callbackValue", "fs.callbackCall",
|
|
1336
1343
|
"async.awaitDyn", "timers.immediatePromise", "crypto.native",
|
|
1344
|
+
"dyn.promiseAll",
|
|
1337
1345
|
"process.onUncaughtException", "process.offUncaughtException",
|
|
1338
1346
|
"process.onUnhandledRejection", "process.offUnhandledRejection",
|
|
1339
1347
|
"process.onRejectionHandled", "process.offRejectionHandled",
|
|
1340
|
-
"process.onWarning", "process.offWarning", "process.emitWarning",
|
|
1348
|
+
"process.onWarning", "process.offWarning", "process.emitWarning", "util.styleText",
|
|
1341
1349
|
"als.new", "als.get", "als.run", "als.exitRun", "als.enterWith", "als.disable",
|
|
1342
1350
|
"dc.chanBindStore", "dc.chanUnbindStore", "dc.chanRunStores",
|
|
1343
1351
|
]);
|
|
@@ -1364,7 +1372,7 @@ function scanRuntimeFeatures(mod, stopAt) {
|
|
|
1364
1372
|
const expr = (node) => {
|
|
1365
1373
|
if (node.kind === "libCall") {
|
|
1366
1374
|
const fn = node.fn;
|
|
1367
|
-
if (fn === "regexp.escape" || fn === "dyn.nativeRegexIs")
|
|
1375
|
+
if (fn === "regexp.escape" || fn === "dyn.nativeRegexIs" || fn === "util.stripVTControlCharacters")
|
|
1368
1376
|
features.regex = true;
|
|
1369
1377
|
if (fn === "text.decodeLegacy" || fn === "text.decodeLegacyOptions" || fn === "text.decodeStream")
|
|
1370
1378
|
features.legacyTextDecoder = true;
|
|
@@ -1385,11 +1393,11 @@ function scanRuntimeFeatures(mod, stopAt) {
|
|
|
1385
1393
|
features.dc = true;
|
|
1386
1394
|
if (fn.startsWith("assert."))
|
|
1387
1395
|
features.assert = true;
|
|
1388
|
-
if (fn === "dyn.defineProps" || fn === "dyn.defineProperty" || fn === "dyn.objCreateWithProperties" || fn === "dyn.arrayProtoCall" || fn === "dyn.arrayPrototype" || fn === "dyn.functionApply" || fn === "dyn.builtinMethod")
|
|
1396
|
+
if (fn === "dyn.defineProps" || fn === "dyn.definePrototypeProps" || fn === "dyn.defineProperty" || fn === "dyn.objCreateWithProperties" || fn === "dyn.arrayProtoCall" || fn === "dyn.arrayPrototype" || fn === "dyn.functionApply" || fn === "dyn.builtinMethod")
|
|
1389
1397
|
features.dynInvoke = true;
|
|
1390
1398
|
if (DYN_ASYNC_LIB_FNS.has(fn))
|
|
1391
1399
|
features.dynAsync = true;
|
|
1392
|
-
if (fn.startsWith("insp.") || fn === "console.native" || fn === "global.native")
|
|
1400
|
+
if (fn.startsWith("insp.") || fn === "console.native" || fn === "global.native" || fn === "util.styleText")
|
|
1393
1401
|
features.inspect = true;
|
|
1394
1402
|
if (fn.startsWith("cp.") || fn.startsWith("child.") || fn.startsWith("writer.") || fn.startsWith("spawnRes.") ||
|
|
1395
1403
|
fn === "process.forkTarget" || fn === "process.connected" || fn === "process.send" || fn === "process.sendCb" ||
|
|
@@ -1408,7 +1416,7 @@ function scanRuntimeFeatures(mod, stopAt) {
|
|
|
1408
1416
|
}
|
|
1409
1417
|
if (fn.startsWith("http2.") && !HTTP2_LEGACY_FNS.has(fn))
|
|
1410
1418
|
features.http2 = true;
|
|
1411
|
-
if (fn.startsWith("sym."))
|
|
1419
|
+
if (fn.startsWith("sym.") || fn === "util.isDeepStrictEqual")
|
|
1412
1420
|
features.symbol = true;
|
|
1413
1421
|
if (fn === "process.hrtimeValue")
|
|
1414
1422
|
features.bigint = true;
|
|
@@ -1418,8 +1426,10 @@ function scanRuntimeFeatures(mod, stopAt) {
|
|
|
1418
1426
|
features.searchParams = true;
|
|
1419
1427
|
if (fn === "qs.parse" || fn === "qs.stringify" || fn === "qs.unescape")
|
|
1420
1428
|
features.qs = true;
|
|
1421
|
-
if (fn === "util.parseArgs")
|
|
1429
|
+
if (fn === "util.parseArgs" || fn === "util.isDeepStrictEqual" || fn === "util.styleText")
|
|
1422
1430
|
features.parseArgs = true;
|
|
1431
|
+
if (fn === "util.styleText")
|
|
1432
|
+
features.processEvents = true;
|
|
1423
1433
|
if (fn.startsWith("fs.watch") || fn.startsWith("watcher."))
|
|
1424
1434
|
features.fsWatch = true;
|
|
1425
1435
|
if (fn.startsWith("test."))
|
|
@@ -1436,7 +1446,7 @@ function scanRuntimeFeatures(mod, stopAt) {
|
|
|
1436
1446
|
features.regex = true;
|
|
1437
1447
|
break;
|
|
1438
1448
|
case "strIntrinsic":
|
|
1439
|
-
if (node.method === "toLowerCase" || node.method === "toUpperCase")
|
|
1449
|
+
if (node.method === "toLowerCase" || node.method === "toUpperCase" || node.method === "normalize")
|
|
1440
1450
|
features.regex = true;
|
|
1441
1451
|
break;
|
|
1442
1452
|
case "arrIntrinsic":
|
|
@@ -1476,6 +1486,9 @@ function scanRuntimeFeatures(mod, stopAt) {
|
|
|
1476
1486
|
case "fileHandle":
|
|
1477
1487
|
features.fileHandle = true;
|
|
1478
1488
|
break;
|
|
1489
|
+
case "procStream":
|
|
1490
|
+
features.processEvents = true;
|
|
1491
|
+
break;
|
|
1479
1492
|
case "child":
|
|
1480
1493
|
case "childStream":
|
|
1481
1494
|
case "childWriter":
|
|
@@ -1733,9 +1746,9 @@ export function moduleUsesSearchParams(mod) {
|
|
|
1733
1746
|
export function moduleUsesQs(mod) {
|
|
1734
1747
|
return scanRuntimeFeatures(mod, "qs").qs;
|
|
1735
1748
|
}
|
|
1736
|
-
/** True when the module uses native util
|
|
1737
|
-
*
|
|
1738
|
-
*
|
|
1749
|
+
/** True when the module uses native util parsing, comparison, or styling.
|
|
1750
|
+
* The utility units also follow their required symbol, inspection, and
|
|
1751
|
+
* warning features, independently of the island's node:util shim. */
|
|
1739
1752
|
export function moduleUsesParseArgs(mod) {
|
|
1740
1753
|
return scanRuntimeFeatures(mod, "parseArgs").parseArgs;
|
|
1741
1754
|
}
|
|
@@ -2037,11 +2050,19 @@ export function moduleLibNondeterministicSurface(mod) {
|
|
|
2037
2050
|
* seed on `dynCheck` and `awaitExpr` nodes, which throw on validation
|
|
2038
2051
|
* failure / promise rejection). */
|
|
2039
2052
|
export const MAY_THROW_LIB_FNS = new Set([
|
|
2053
|
+
"text.encodeInto",
|
|
2054
|
+
"buffer.isAscii",
|
|
2055
|
+
"buffer.isUtf8",
|
|
2056
|
+
"buffer.transcode",
|
|
2040
2057
|
"cp.spawnDynamic",
|
|
2041
2058
|
"child.onDyn",
|
|
2042
2059
|
"text.decoderEncoding",
|
|
2043
2060
|
"dyn.construct",
|
|
2044
2061
|
"dyn.reflectApply",
|
|
2062
|
+
"dyn.reflectGet",
|
|
2063
|
+
"dyn.reflectSet",
|
|
2064
|
+
"dyn.reflectDefine",
|
|
2065
|
+
"dyn.abstractEq",
|
|
2045
2066
|
"text.decodeOptions",
|
|
2046
2067
|
"text.decodeStream",
|
|
2047
2068
|
"text.decodeLegacyOptions",
|
|
@@ -2093,6 +2114,8 @@ export const MAY_THROW_LIB_FNS = new Set([
|
|
|
2093
2114
|
"fetch.responseNew",
|
|
2094
2115
|
"fetch.abortTimeout",
|
|
2095
2116
|
"fetch.abortAny",
|
|
2117
|
+
"abort.timeout",
|
|
2118
|
+
"abort.any",
|
|
2096
2119
|
"fetch.streamNew",
|
|
2097
2120
|
"fetch.streamFrom",
|
|
2098
2121
|
"num.toFixed",
|
|
@@ -2364,6 +2387,13 @@ export const MAY_THROW_LIB_FNS = new Set([
|
|
|
2364
2387
|
"date.nativeNew",
|
|
2365
2388
|
"date.checkedValue",
|
|
2366
2389
|
"util.parseArgs",
|
|
2390
|
+
"util.parseEnv",
|
|
2391
|
+
"util.getSystemErrorName",
|
|
2392
|
+
"util.getSystemErrorMessage",
|
|
2393
|
+
"util.stripVTControlCharacters",
|
|
2394
|
+
"util.isDeepStrictEqual",
|
|
2395
|
+
"util.styleText",
|
|
2396
|
+
"util.toUSVString",
|
|
2367
2397
|
// decodeURIComponent throws the spec's URIError on bad hex/invalid
|
|
2368
2398
|
// UTF-8 octets (encodeURIComponent never throws — see the IrLibFn doc).
|
|
2369
2399
|
"str.decodeUriComponent",
|
|
@@ -2442,10 +2472,14 @@ export const MAY_THROW_LIB_FNS = new Set([
|
|
|
2442
2472
|
"dyn.toString",
|
|
2443
2473
|
"string.fromCodePoint",
|
|
2444
2474
|
"dyn.defineProps",
|
|
2475
|
+
"dyn.definePrototypeProps",
|
|
2476
|
+
"dyn.bagGet",
|
|
2477
|
+
"dyn.bagSet",
|
|
2445
2478
|
"dyn.defineProperty",
|
|
2446
2479
|
"dyn.getOwnPropertyDescriptor",
|
|
2447
2480
|
"dyn.arrayProtoCall",
|
|
2448
2481
|
"process.chdir",
|
|
2482
|
+
"process.loadEnvFile",
|
|
2449
2483
|
"fs.realpathSync",
|
|
2450
2484
|
"fs.realpathNativeSync",
|
|
2451
2485
|
"fs.readFileSync",
|
|
@@ -2458,8 +2492,13 @@ export const MAY_THROW_LIB_FNS = new Set([
|
|
|
2458
2492
|
"fs.readdirTypesSync",
|
|
2459
2493
|
"url.new",
|
|
2460
2494
|
"url.newBase",
|
|
2495
|
+
"url.set",
|
|
2496
|
+
"url.setChecked",
|
|
2461
2497
|
"url.fileURLToPathUrl",
|
|
2462
2498
|
"url.fileURLToPathChecked",
|
|
2499
|
+
"url.fileURLToPathOptions",
|
|
2500
|
+
"url.fileURLToPathBuffer",
|
|
2501
|
+
"url.pathToFileURLChecked",
|
|
2463
2502
|
"url.fileURLToPathStr",
|
|
2464
2503
|
// The win32-target flavor of pathToFileURL (same runtime entry point —
|
|
2465
2504
|
// the bridge dispatches by the binary's platform): Node's win32 arm
|
|
@@ -2496,6 +2535,10 @@ export const MAY_THROW_LIB_FNS = new Set([
|
|
|
2496
2535
|
"crypto.pbkdf2",
|
|
2497
2536
|
"crypto.randomBytesCb",
|
|
2498
2537
|
"crypto.pbkdf2Cb",
|
|
2538
|
+
"crypto.hkdf",
|
|
2539
|
+
"crypto.hkdfCb",
|
|
2540
|
+
"crypto.scrypt",
|
|
2541
|
+
"crypto.scryptCb",
|
|
2499
2542
|
"buffer.concat",
|
|
2500
2543
|
"buffer.concatLen",
|
|
2501
2544
|
"buffer.fromDyn",
|
|
@@ -2574,6 +2617,9 @@ export const MAY_THROW_LIB_FNS = new Set([
|
|
|
2574
2617
|
"assert.throwsRegex",
|
|
2575
2618
|
"assert.shapeEnd",
|
|
2576
2619
|
"assert.unwantedRejection",
|
|
2620
|
+
"assert.unwantedError",
|
|
2621
|
+
"assert.noErrorPredicate",
|
|
2622
|
+
"assert.regexDynTest",
|
|
2577
2623
|
"assert.expectsErrDyn",
|
|
2578
2624
|
"assert.ifErrorErr",
|
|
2579
2625
|
"assert.ifErrorF64",
|
|
@@ -2593,7 +2639,19 @@ export const MAY_THROW_LIB_FNS = new Set([
|
|
|
2593
2639
|
"fs.fstatSync",
|
|
2594
2640
|
"fs.fchmodSync",
|
|
2595
2641
|
"fs.fsyncSync",
|
|
2642
|
+
"fs.fdatasyncSync",
|
|
2643
|
+
"fs.ftruncateSync",
|
|
2644
|
+
"fs.utimesSync",
|
|
2645
|
+
"fs.futimesSync",
|
|
2646
|
+
"fs.lutimesSync",
|
|
2647
|
+
"fs.readvSync",
|
|
2648
|
+
"fs.writevSync",
|
|
2596
2649
|
"fs.linkSync",
|
|
2650
|
+
"fs.symlinkSync",
|
|
2651
|
+
"fs.readlinkSync",
|
|
2652
|
+
"fs.statfsSync",
|
|
2653
|
+
"fs.readlinkSyncStr",
|
|
2654
|
+
"fs.readlinkSyncBuffer",
|
|
2597
2655
|
"fs.writeFileModeSync",
|
|
2598
2656
|
"fs.mkdirModeSync",
|
|
2599
2657
|
"fs.mkdirRecursiveModeSync",
|