@scriptc/compiler 0.2.10 → 0.3.1
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 +7 -38
- package/ambient/scriptc-overrides.d.ts +1 -25
- package/ambient/scriptc.d.ts +1 -9
- package/dist/backend/cycle-analysis.test.js +1 -1
- package/dist/backend/cycle-mutability.d.ts +1 -1
- package/dist/backend/cycle-mutability.js +1 -18
- package/dist/backend/cycle-mutability.js.map +1 -1
- package/dist/backend/executable-features.d.ts +1 -1
- package/dist/backend/executable-features.js +3 -8
- package/dist/backend/executable-features.js.map +1 -1
- package/dist/backend/immutability.d.ts +1 -1
- package/dist/backend/immutability.js +1 -1
- package/dist/backend/immutability.test.js +1 -1
- package/dist/backend/library-pack.js +0 -2
- package/dist/backend/library-pack.js.map +1 -1
- package/dist/backend/linker.js +1 -1
- package/dist/backend/linker.js.map +1 -1
- package/dist/backend/llvm/bigint-wrap.d.ts +4 -0
- package/dist/backend/llvm/bigint-wrap.js +590 -0
- package/dist/backend/llvm/bigint-wrap.js.map +1 -0
- package/dist/backend/llvm/blocks.d.ts +2 -0
- package/dist/backend/llvm/blocks.js +4 -0
- package/dist/backend/llvm/blocks.js.map +1 -1
- package/dist/backend/llvm/call-lifetimes.js +15 -4
- package/dist/backend/llvm/call-lifetimes.js.map +1 -1
- package/dist/backend/llvm/call-lifetimes.test.js +14 -3
- package/dist/backend/llvm/call-lifetimes.test.js.map +1 -1
- package/dist/backend/llvm/checked-narrows.test.js +2 -2
- package/dist/backend/llvm/checked-narrows.test.js.map +1 -1
- package/dist/backend/llvm/classes.js +60 -21
- package/dist/backend/llvm/classes.js.map +1 -1
- package/dist/backend/llvm/classes.test.js +11 -11
- package/dist/backend/llvm/classes.test.js.map +1 -1
- package/dist/backend/llvm/common.d.ts +7 -5
- package/dist/backend/llvm/common.js +7 -5
- package/dist/backend/llvm/common.js.map +1 -1
- package/dist/backend/llvm/constant-callbacks.d.ts +1 -1
- package/dist/backend/llvm/constant-callbacks.js +13 -31
- package/dist/backend/llvm/constant-callbacks.js.map +1 -1
- package/dist/backend/llvm/constant-callbacks.test.js +1 -1
- package/dist/backend/llvm/dense-array-access.js +133 -45
- package/dist/backend/llvm/dense-array-access.js.map +1 -1
- package/dist/backend/llvm/dense-array-access.test.js +54 -2
- package/dist/backend/llvm/dense-array-access.test.js.map +1 -1
- package/dist/backend/llvm/dyn.d.ts +2 -1
- package/dist/backend/llvm/dyn.js +4 -73
- package/dist/backend/llvm/dyn.js.map +1 -1
- package/dist/backend/llvm/emitter.d.ts +123 -23
- package/dist/backend/llvm/emitter.js +729 -258
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/backend/llvm/emitter.test.js +17 -10
- package/dist/backend/llvm/emitter.test.js.map +1 -1
- package/dist/backend/llvm/expr-async.js +120 -43
- package/dist/backend/llvm/expr-async.js.map +1 -1
- package/dist/backend/llvm/expr-async.test.js +2 -2
- package/dist/backend/llvm/expr-async.test.js.map +1 -1
- package/dist/backend/llvm/expr-bytes.js +51 -36
- package/dist/backend/llvm/expr-bytes.js.map +1 -1
- package/dist/backend/llvm/expr-callbacks.js +72 -3
- package/dist/backend/llvm/expr-callbacks.js.map +1 -1
- package/dist/backend/llvm/expr-calls.d.ts +1 -1
- package/dist/backend/llvm/expr-calls.js +159 -30
- package/dist/backend/llvm/expr-calls.js.map +1 -1
- package/dist/backend/llvm/expr-calls.test.js +132 -0
- package/dist/backend/llvm/expr-calls.test.js.map +1 -0
- package/dist/backend/llvm/expr-containers.js +25 -8
- package/dist/backend/llvm/expr-containers.js.map +1 -1
- package/dist/backend/llvm/expr-context.d.ts +2 -0
- package/dist/backend/llvm/expr-control.js +4 -107
- package/dist/backend/llvm/expr-control.js.map +1 -1
- package/dist/backend/llvm/expr-dispatch.d.ts +1 -2
- package/dist/backend/llvm/expr-dispatch.js +3 -41
- package/dist/backend/llvm/expr-dispatch.js.map +1 -1
- package/dist/backend/llvm/expr-dynamic.d.ts +1 -1
- package/dist/backend/llvm/expr-dynamic.js +39 -31
- package/dist/backend/llvm/expr-dynamic.js.map +1 -1
- package/dist/backend/llvm/expr-primitives.d.ts +7 -0
- package/dist/backend/llvm/expr-primitives.js +80 -22
- package/dist/backend/llvm/expr-primitives.js.map +1 -1
- package/dist/backend/llvm/expr-primitives.test.js +97 -7
- package/dist/backend/llvm/expr-primitives.test.js.map +1 -1
- package/dist/backend/llvm/expr-records.d.ts +9 -0
- package/dist/backend/llvm/expr-records.js +134 -16
- package/dist/backend/llvm/expr-records.js.map +1 -1
- package/dist/backend/llvm/expr-stream-bridges.d.ts +1 -1
- package/dist/backend/llvm/expr-stream-bridges.js +80 -1
- package/dist/backend/llvm/expr-stream-bridges.js.map +1 -1
- package/dist/backend/llvm/expr-stream-bridges.test.js +51 -2
- package/dist/backend/llvm/expr-stream-bridges.test.js.map +1 -1
- package/dist/backend/llvm/int32-abi.d.ts +31 -0
- package/dist/backend/llvm/int32-abi.js +62 -0
- package/dist/backend/llvm/int32-abi.js.map +1 -0
- package/dist/backend/llvm/int32-abi.test.js +107 -0
- package/dist/backend/llvm/int32-abi.test.js.map +1 -0
- package/dist/backend/llvm/int32-locals.d.ts +30 -0
- package/dist/backend/llvm/int32-locals.js +95 -0
- package/dist/backend/llvm/int32-locals.js.map +1 -0
- package/dist/backend/llvm/integer-values.d.ts +4 -0
- package/dist/backend/llvm/integer-values.js +30 -1
- package/dist/backend/llvm/integer-values.js.map +1 -1
- package/dist/backend/llvm/integer-views.d.ts +8 -1
- package/dist/backend/llvm/integer-views.js +47 -2
- package/dist/backend/llvm/integer-views.js.map +1 -1
- package/dist/backend/llvm/lazy-captures.d.ts +16 -0
- package/dist/backend/llvm/lazy-captures.js +88 -2
- package/dist/backend/llvm/lazy-captures.js.map +1 -1
- package/dist/backend/llvm/lazy-captures.test.js +48 -0
- package/dist/backend/llvm/lazy-captures.test.js.map +1 -1
- package/dist/backend/llvm/lib-dispatch.js +14 -1
- package/dist/backend/llvm/lib-dispatch.js.map +1 -1
- package/dist/backend/llvm/lib-filesystem.js +3 -13
- package/dist/backend/llvm/lib-filesystem.js.map +1 -1
- package/dist/backend/llvm/lib-shared.js +7 -8
- package/dist/backend/llvm/lib-shared.js.map +1 -1
- package/dist/backend/llvm/local-array-reads.js +21 -2
- package/dist/backend/llvm/local-array-reads.js.map +1 -1
- package/dist/backend/llvm/local-array-reads.test.js +4 -3
- package/dist/backend/llvm/local-array-reads.test.js.map +1 -1
- package/dist/backend/llvm/local-union-storage.test.js +3 -3
- package/dist/backend/llvm/local-union-storage.test.js.map +1 -1
- package/dist/backend/llvm/map-number-lookup.d.ts +7 -0
- package/dist/backend/llvm/map-number-lookup.js +16 -2
- package/dist/backend/llvm/map-number-lookup.js.map +1 -1
- package/dist/backend/llvm/map-read-lifetimes.js +7 -1
- package/dist/backend/llvm/map-read-lifetimes.js.map +1 -1
- package/dist/backend/llvm/map-read-lifetimes.test.js +25 -8
- package/dist/backend/llvm/map-read-lifetimes.test.js.map +1 -1
- package/dist/backend/llvm/reference-effects.js +2 -0
- package/dist/backend/llvm/reference-effects.js.map +1 -1
- package/dist/backend/llvm/reference-writes.d.ts +3 -0
- package/dist/backend/llvm/reference-writes.js +10 -2
- package/dist/backend/llvm/reference-writes.js.map +1 -1
- package/dist/backend/llvm/regex-matchers.d.ts +39 -0
- package/dist/backend/llvm/regex-matchers.js +1649 -0
- package/dist/backend/llvm/regex-matchers.js.map +1 -0
- package/dist/backend/llvm/regex-matchers.test.js +96 -0
- package/dist/backend/llvm/regex-matchers.test.js.map +1 -0
- package/dist/backend/llvm/shapes.d.ts +36 -1
- package/dist/backend/llvm/shapes.js +128 -16
- package/dist/backend/llvm/shapes.js.map +1 -1
- package/dist/backend/llvm/shapes.test.js +3 -3
- package/dist/backend/llvm/stack-unions.test.js +2 -2
- package/dist/backend/llvm/stack-unions.test.js.map +1 -1
- package/dist/backend/llvm/string-construction.test.js +3 -3
- package/dist/backend/llvm/string-construction.test.js.map +1 -1
- package/dist/backend/llvm/string-lifetimes.test.js +6 -6
- package/dist/backend/llvm/string-lifetimes.test.js.map +1 -1
- package/dist/backend/llvm/string-literal-equality.d.ts +22 -0
- package/dist/backend/llvm/string-literal-equality.js +78 -0
- package/dist/backend/llvm/string-literal-equality.js.map +1 -0
- package/dist/backend/llvm/switch-dispatch.js +59 -13
- package/dist/backend/llvm/switch-dispatch.js.map +1 -1
- package/dist/backend/llvm/switch-dispatch.test.js +72 -7
- package/dist/backend/llvm/switch-dispatch.test.js.map +1 -1
- package/dist/backend/llvm/union-retype.test.d.ts +1 -0
- package/dist/backend/llvm/union-retype.test.js +229 -0
- package/dist/backend/llvm/union-retype.test.js.map +1 -0
- package/dist/backend/llvm/wrapping-sums.d.ts +17 -0
- package/dist/backend/llvm/wrapping-sums.js +113 -0
- package/dist/backend/llvm/wrapping-sums.js.map +1 -0
- package/dist/backend/loop-polls.js +1 -0
- package/dist/backend/loop-polls.js.map +1 -1
- package/dist/backend/mangle.d.ts +9 -0
- package/dist/backend/mangle.js +15 -0
- package/dist/backend/mangle.js.map +1 -1
- package/dist/backend/may-throw.js +6 -12
- package/dist/backend/may-throw.js.map +1 -1
- package/dist/backend/may-throw.test.js +1 -1
- package/dist/backend/native/artifact-stamps.js +0 -2
- package/dist/backend/native/artifact-stamps.js.map +1 -1
- package/dist/backend/native/cache-warm.d.ts +1 -1
- package/dist/backend/native/cache-warm.js +2 -3
- package/dist/backend/native/cache-warm.js.map +1 -1
- package/dist/backend/native/compiler-fingerprint.d.ts +1 -1
- package/dist/backend/native/compiler-fingerprint.js +4 -7
- package/dist/backend/native/compiler-fingerprint.js.map +1 -1
- package/dist/backend/native/contracts.d.ts +3 -28
- package/dist/backend/native/driver.js +1 -3
- package/dist/backend/native/driver.js.map +1 -1
- package/dist/backend/native/executable.d.ts +0 -15
- package/dist/backend/native/executable.js +17 -172
- package/dist/backend/native/executable.js.map +1 -1
- package/dist/backend/native/tool-identity.js +0 -1
- package/dist/backend/native/tool-identity.js.map +1 -1
- package/dist/backend/native/vendor.d.ts +1 -1
- package/dist/backend/native/vendor.js +1 -1
- package/dist/backend/native/vendor.js.map +1 -1
- package/dist/backend/native-link-info-core.d.ts +0 -2
- package/dist/backend/native-link-info-core.js.map +1 -1
- package/dist/backend/native-toolchain.test.js +23 -33
- package/dist/backend/native-toolchain.test.js.map +1 -1
- package/dist/backend/publication.test.js +1 -1
- package/dist/backend/runtime-abi.d.ts +2 -2
- package/dist/backend/runtime-abi.js +2 -2
- package/dist/backend/runtime-pack-core.d.ts +1 -2
- package/dist/backend/runtime-pack-core.js +5 -14
- package/dist/backend/runtime-pack-core.js.map +1 -1
- package/dist/backend/runtime-pack-targets.test.js +3 -8
- package/dist/backend/runtime-pack-targets.test.js.map +1 -1
- package/dist/backend/runtime-pack.test.js +22 -19
- package/dist/backend/runtime-pack.test.js.map +1 -1
- package/dist/backend/target-diagnostics.d.ts +0 -5
- package/dist/backend/target-diagnostics.js +1 -11
- package/dist/backend/target-diagnostics.js.map +1 -1
- package/dist/backend/target-diagnostics.test.js +1 -1
- package/dist/backend/vendor-archives.d.ts +1 -7
- package/dist/backend/vendor-archives.js +9 -189
- package/dist/backend/vendor-archives.js.map +1 -1
- package/dist/backend/vendor-inputs.d.ts +0 -1
- package/dist/backend/vendor-inputs.js +0 -1
- package/dist/backend/vendor-inputs.js.map +1 -1
- package/dist/backend/warm-cache.js +3 -5
- package/dist/backend/warm-cache.js.map +1 -1
- package/dist/cli/command.js +4 -8
- package/dist/cli/command.js.map +1 -1
- package/dist/cli/host.d.ts +1 -1
- package/dist/cli/usage.d.ts +1 -5
- package/dist/cli/usage.js +4 -9
- package/dist/cli/usage.js.map +1 -1
- package/dist/compat/fetch-profile.d.ts +2 -2
- package/dist/compat/fetch-profile.js +16 -25
- package/dist/compat/fetch-profile.js.map +1 -1
- package/dist/compile-types.d.ts +2 -17
- package/dist/contracts/check.js +6 -6
- package/dist/contracts/check.js.map +1 -1
- package/dist/coverage/report.d.ts +5 -22
- package/dist/coverage/report.js +12 -76
- package/dist/coverage/report.js.map +1 -1
- package/dist/coverage/surface-manifest.d.ts +3 -3
- package/dist/coverage/surface-manifest.js +22 -27
- package/dist/coverage/surface-manifest.js.map +1 -1
- package/dist/coverage/verdict-cache.d.ts +1 -3
- package/dist/coverage/verdict-cache.js +2 -7
- package/dist/coverage/verdict-cache.js.map +1 -1
- package/dist/diagnostics/diagnostic.d.ts +11 -60
- package/dist/diagnostics/diagnostic.js +39 -118
- package/dist/diagnostics/diagnostic.js.map +1 -1
- package/dist/diagnostics/envelope.d.ts +3 -4
- package/dist/diagnostics/envelope.js +0 -9
- package/dist/diagnostics/envelope.js.map +1 -1
- package/dist/diagnostics/envelope.test.js +1 -1
- package/dist/diagnostics/envelope.test.js.map +1 -1
- package/dist/executable/executable-cache.d.ts +0 -3
- package/dist/executable/executable-cache.js +2 -4
- package/dist/executable/executable-cache.js.map +1 -1
- package/dist/executable/executable-cache.test.js +0 -4
- package/dist/executable/executable-cache.test.js.map +1 -1
- package/dist/executable/prepare.js +5 -2
- package/dist/executable/prepare.js.map +1 -1
- package/dist/frontend/analysis.js +10 -10
- package/dist/frontend/analysis.js.map +1 -1
- package/dist/frontend/cjs-syntax.js +0 -88
- package/dist/frontend/cjs-syntax.js.map +1 -1
- package/dist/frontend/dts-paths.d.ts +1 -1
- package/dist/frontend/dts-paths.js +1 -1
- package/dist/frontend/lowering/abstract-equality.js +1 -4
- package/dist/frontend/lowering/abstract-equality.js.map +1 -1
- package/dist/frontend/lowering/array-values.d.ts +14 -0
- package/dist/frontend/lowering/array-values.js +33 -11
- package/dist/frontend/lowering/array-values.js.map +1 -1
- package/dist/frontend/lowering/builtins/arguments.js +0 -13
- package/dist/frontend/lowering/builtins/arguments.js.map +1 -1
- package/dist/frontend/lowering/builtins/crypto.d.ts +0 -4
- package/dist/frontend/lowering/builtins/crypto.js +0 -4
- package/dist/frontend/lowering/builtins/crypto.js.map +1 -1
- package/dist/frontend/lowering/builtins/json.js +1 -39
- package/dist/frontend/lowering/builtins/json.js.map +1 -1
- package/dist/frontend/lowering/builtins/module-resolution.d.ts +0 -15
- package/dist/frontend/lowering/builtins/module-resolution.js +5 -44
- package/dist/frontend/lowering/builtins/module-resolution.js.map +1 -1
- package/dist/frontend/lowering/builtins/numbers.d.ts +0 -6
- package/dist/frontend/lowering/builtins/numbers.js +6 -57
- package/dist/frontend/lowering/builtins/numbers.js.map +1 -1
- package/dist/frontend/lowering/builtins/promises.js +4 -67
- package/dist/frontend/lowering/builtins/promises.js.map +1 -1
- package/dist/frontend/lowering/builtins/workers.js +1 -1
- package/dist/frontend/lowering/builtins/workers.js.map +1 -1
- package/dist/frontend/lowering/call-arguments.d.ts +1 -37
- package/dist/frontend/lowering/call-arguments.js +11 -94
- package/dist/frontend/lowering/call-arguments.js.map +1 -1
- package/dist/frontend/lowering/call-signatures.d.ts +1 -6
- package/dist/frontend/lowering/call-signatures.js +16 -68
- package/dist/frontend/lowering/call-signatures.js.map +1 -1
- package/dist/frontend/lowering/class-dynamic-dispatch.d.ts +19 -4
- package/dist/frontend/lowering/class-dynamic-dispatch.js +168 -98
- package/dist/frontend/lowering/class-dynamic-dispatch.js.map +1 -1
- package/dist/frontend/lowering/class-dynamic-dispatch.test.js +44 -4
- package/dist/frontend/lowering/class-dynamic-dispatch.test.js.map +1 -1
- package/dist/frontend/lowering/class-method-mutations.js +0 -2
- package/dist/frontend/lowering/class-method-mutations.js.map +1 -1
- package/dist/frontend/lowering/class-protocols.js +1 -1
- package/dist/frontend/lowering/class-protocols.js.map +1 -1
- package/dist/frontend/lowering/coercions/function-adapters.js +5 -35
- package/dist/frontend/lowering/coercions/function-adapters.js.map +1 -1
- package/dist/frontend/lowering/coercions/state.d.ts +0 -1
- package/dist/frontend/lowering/coercions/state.js +0 -1
- package/dist/frontend/lowering/coercions/state.js.map +1 -1
- package/dist/frontend/lowering/coercions/structural-plans.js +2 -4
- package/dist/frontend/lowering/coercions/structural-plans.js.map +1 -1
- package/dist/frontend/lowering/coercions/structural.js +2 -12
- package/dist/frontend/lowering/coercions/structural.js.map +1 -1
- package/dist/frontend/lowering/coercions/unions.js +0 -1
- package/dist/frontend/lowering/coercions/unions.js.map +1 -1
- package/dist/frontend/lowering/containers/array-callbacks.js +49 -28
- package/dist/frontend/lowering/containers/array-callbacks.js.map +1 -1
- package/dist/frontend/lowering/containers/array-construction.js +2 -3
- package/dist/frontend/lowering/containers/array-construction.js.map +1 -1
- package/dist/frontend/lowering/containers/array-methods.js +10 -54
- package/dist/frontend/lowering/containers/array-methods.js.map +1 -1
- package/dist/frontend/lowering/containers/array-pipelines.d.ts +54 -0
- package/dist/frontend/lowering/containers/array-pipelines.js +1827 -0
- package/dist/frontend/lowering/containers/array-pipelines.js.map +1 -0
- package/dist/frontend/lowering/containers/bytes.js +0 -1
- package/dist/frontend/lowering/containers/bytes.js.map +1 -1
- package/dist/frontend/lowering/containers/callback-arguments.js +2 -10
- package/dist/frontend/lowering/containers/callback-arguments.js.map +1 -1
- package/dist/frontend/lowering/containers/collection-methods.js +1 -6
- package/dist/frontend/lowering/containers/collection-methods.js.map +1 -1
- package/dist/frontend/lowering/containers/exec-result-uses.d.ts +10 -0
- package/dist/frontend/lowering/containers/exec-result-uses.js +88 -0
- package/dist/frontend/lowering/containers/exec-result-uses.js.map +1 -0
- package/dist/frontend/lowering/containers/indexed-objects.js +0 -2
- package/dist/frontend/lowering/containers/indexed-objects.js.map +1 -1
- package/dist/frontend/lowering/containers/string-and-regexp.d.ts +0 -6
- package/dist/frontend/lowering/containers/string-and-regexp.js +17 -17
- package/dist/frontend/lowering/containers/string-and-regexp.js.map +1 -1
- package/dist/frontend/lowering/containers/string-replacement.d.ts +2 -1
- package/dist/frontend/lowering/containers/string-replacement.js +32 -136
- package/dist/frontend/lowering/containers/string-replacement.js.map +1 -1
- package/dist/frontend/lowering/devirtualize.d.ts +33 -0
- package/dist/frontend/lowering/devirtualize.js +199 -0
- package/dist/frontend/lowering/devirtualize.js.map +1 -0
- package/dist/frontend/lowering/expressions/evaluation-safety.js +0 -3
- package/dist/frontend/lowering/expressions/evaluation-safety.js.map +1 -1
- package/dist/frontend/lowering/expressions/native-proxy.js +1 -1
- package/dist/frontend/lowering/expressions/native-proxy.js.map +1 -1
- package/dist/frontend/lowering/expressions/nullish-assignment.js +55 -8
- package/dist/frontend/lowering/expressions/nullish-assignment.js.map +1 -1
- package/dist/frontend/lowering/expressions/object-literals.d.ts +0 -8
- package/dist/frontend/lowering/expressions/object-literals.js +8 -35
- package/dist/frontend/lowering/expressions/object-literals.js.map +1 -1
- package/dist/frontend/lowering/expressions/optional-chains.d.ts +0 -4
- package/dist/frontend/lowering/expressions/optional-chains.js +3 -66
- package/dist/frontend/lowering/expressions/optional-chains.js.map +1 -1
- package/dist/frontend/lowering/function-context.js +0 -1
- package/dist/frontend/lowering/function-context.js.map +1 -1
- package/dist/frontend/lowering/generic-functions.js +0 -1
- package/dist/frontend/lowering/generic-functions.js.map +1 -1
- package/dist/frontend/lowering/identifier-uses.d.ts +7 -0
- package/dist/frontend/lowering/identifier-uses.js +23 -0
- package/dist/frontend/lowering/identifier-uses.js.map +1 -0
- package/dist/frontend/lowering/iterator-adapters.js +51 -3
- package/dist/frontend/lowering/iterator-adapters.js.map +1 -1
- package/dist/frontend/lowering/lib-boundary.js +10 -77
- package/dist/frontend/lowering/lib-boundary.js.map +1 -1
- package/dist/frontend/lowering/lower-array-sort.js +14 -10
- package/dist/frontend/lowering/lower-array-sort.js.map +1 -1
- package/dist/frontend/lowering/lower-array-sort.test.js +2 -2
- package/dist/frontend/lowering/lower-array-sort.test.js.map +1 -1
- package/dist/frontend/lowering/lower-assert.js +2 -3
- package/dist/frontend/lowering/lower-assert.js.map +1 -1
- package/dist/frontend/lowering/lower-async-iteration.js +1 -1
- package/dist/frontend/lowering/lower-calls.d.ts +2 -27
- package/dist/frontend/lowering/lower-calls.js +111 -493
- package/dist/frontend/lowering/lower-calls.js.map +1 -1
- package/dist/frontend/lowering/lower-classes.js +12 -60
- package/dist/frontend/lowering/lower-classes.js.map +1 -1
- package/dist/frontend/lowering/lower-comptime.js +2 -3
- package/dist/frontend/lowering/lower-comptime.js.map +1 -1
- package/dist/frontend/lowering/lower-console.d.ts +14 -0
- package/dist/frontend/lowering/lower-console.js +195 -0
- package/dist/frontend/lowering/lower-console.js.map +1 -0
- package/dist/frontend/lowering/lower-enums.js +5 -8
- package/dist/frontend/lowering/lower-enums.js.map +1 -1
- package/dist/frontend/lowering/lower-event-emitter.js +3 -4
- package/dist/frontend/lowering/lower-event-emitter.js.map +1 -1
- package/dist/frontend/lowering/lower-expando.js +3 -5
- package/dist/frontend/lowering/lower-expando.js.map +1 -1
- package/dist/frontend/lowering/lower-exprs.d.ts +0 -8
- package/dist/frontend/lowering/lower-exprs.js +180 -905
- package/dist/frontend/lowering/lower-exprs.js.map +1 -1
- package/dist/frontend/lowering/lower-functions.js +9 -8
- package/dist/frontend/lowering/lower-functions.js.map +1 -1
- package/dist/frontend/lowering/lower-generators.d.ts +10 -0
- package/dist/frontend/lowering/lower-generators.js +108 -41
- package/dist/frontend/lowering/lower-generators.js.map +1 -1
- package/dist/frontend/lowering/lower-inspect.js +1 -50
- package/dist/frontend/lowering/lower-inspect.js.map +1 -1
- package/dist/frontend/lowering/lower-modules.d.ts +0 -43
- package/dist/frontend/lowering/lower-modules.js +29 -329
- package/dist/frontend/lowering/lower-modules.js.map +1 -1
- package/dist/frontend/lowering/lower-modules.test.js +5 -5
- package/dist/frontend/lowering/lower-modules.test.js.map +1 -1
- package/dist/frontend/lowering/lower-server.js +0 -30
- package/dist/frontend/lowering/lower-server.js.map +1 -1
- package/dist/frontend/lowering/lower-stdlib.d.ts +98 -0
- package/dist/frontend/lowering/{lower-island.js → lower-stdlib.js} +97 -1160
- package/dist/frontend/lowering/lower-stdlib.js.map +1 -0
- package/dist/frontend/lowering/lower-stmts.d.ts +0 -16
- package/dist/frontend/lowering/lower-stmts.js +58 -1016
- package/dist/frontend/lowering/lower-stmts.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.test.js +1 -1
- package/dist/frontend/lowering/lower-stmts.test.js.map +1 -1
- package/dist/frontend/lowering/lower-stream.js +14 -13
- package/dist/frontend/lowering/lower-stream.js.map +1 -1
- package/dist/frontend/lowering/lowerer.d.ts +42 -155
- package/dist/frontend/lowering/lowerer.js +192 -816
- package/dist/frontend/lowering/lowerer.js.map +1 -1
- package/dist/frontend/lowering/lowerer.test.js +4 -51
- package/dist/frontend/lowering/lowerer.test.js.map +1 -1
- package/dist/frontend/lowering/nan-coded-reads.d.ts +16 -0
- package/dist/frontend/lowering/nan-coded-reads.js +108 -1
- package/dist/frontend/lowering/nan-coded-reads.js.map +1 -1
- package/dist/frontend/lowering/narrowing-stability.js +1 -1
- package/dist/frontend/lowering/narrowing-stability.js.map +1 -1
- package/dist/frontend/lowering/optional-arguments.js +0 -2
- package/dist/frontend/lowering/optional-arguments.js.map +1 -1
- package/dist/frontend/lowering/runtime-optional-bounds.d.ts +4 -0
- package/dist/frontend/lowering/runtime-optional-bounds.js +2 -0
- package/dist/frontend/lowering/runtime-optional-bounds.js.map +1 -1
- package/dist/frontend/lowering/runtime-optional-bounds.test.js +27 -0
- package/dist/frontend/lowering/runtime-optional-bounds.test.js.map +1 -1
- package/dist/frontend/lowering/sanitize-class-types.test.js +2 -2
- package/dist/frontend/lowering/split-consumers.js +2 -18
- package/dist/frontend/lowering/split-consumers.js.map +1 -1
- package/dist/frontend/lowering/strict-equality.js +1 -1
- package/dist/frontend/lowering/strict-equality.js.map +1 -1
- package/dist/frontend/lowering/surfaces.d.ts +6 -45
- package/dist/frontend/lowering/surfaces.js +8 -73
- package/dist/frontend/lowering/surfaces.js.map +1 -1
- package/dist/frontend/lowering/union-retag.d.ts +6 -1
- package/dist/frontend/lowering/union-retag.js +64 -1
- package/dist/frontend/lowering/union-retag.js.map +1 -1
- package/dist/frontend/lowering/union-retag.test.js +46 -0
- package/dist/frontend/lowering/union-retag.test.js.map +1 -1
- package/dist/frontend/module-syntax.d.ts +0 -3
- package/dist/frontend/module-syntax.js.map +1 -1
- package/dist/frontend/npm-node.d.ts +0 -7
- package/dist/frontend/npm-node.js +0 -7
- package/dist/frontend/npm-node.js.map +1 -1
- package/dist/frontend/npm-static-rewrite-syntax.d.ts +1 -1
- package/dist/frontend/npm-static-rewrite-syntax.js +6 -82
- package/dist/frontend/npm-static-rewrite-syntax.js.map +1 -1
- package/dist/frontend/npm-static.d.ts +1 -1
- package/dist/frontend/npm-static.js +6 -71
- package/dist/frontend/npm-static.js.map +1 -1
- package/dist/frontend/npm.d.ts +3 -319
- package/dist/frontend/npm.js +6 -1007
- package/dist/frontend/npm.js.map +1 -1
- package/dist/frontend/npm.test.js +2 -197
- package/dist/frontend/npm.test.js.map +1 -1
- package/dist/frontend/pipeline-native.js +1 -2
- package/dist/frontend/pipeline-native.js.map +1 -1
- package/dist/frontend/pipeline.d.ts +3 -11
- package/dist/frontend/pipeline.js +37 -56
- package/dist/frontend/pipeline.js.map +1 -1
- package/dist/frontend/pipeline.test.js +12 -6
- package/dist/frontend/pipeline.test.js.map +1 -1
- package/dist/frontend/program.d.ts +0 -34
- package/dist/frontend/program.js +12 -97
- package/dist/frontend/program.js.map +1 -1
- package/dist/frontend/provenance-core.d.ts +0 -4
- package/dist/frontend/provenance-core.js +4 -37
- package/dist/frontend/provenance-core.js.map +1 -1
- package/dist/frontend/provenance-registry.d.ts +0 -4
- package/dist/frontend/provenance-registry.js +0 -20
- package/dist/frontend/provenance-registry.js.map +1 -1
- package/dist/frontend/resolve.d.ts +0 -12
- package/dist/frontend/resolve.js +0 -34
- package/dist/frontend/resolve.js.map +1 -1
- package/dist/frontend/runtime-resolve.js +2 -2
- package/dist/frontend/runtime-resolve.js.map +1 -1
- package/dist/frontend/services-node.js +2 -3
- package/dist/frontend/services-node.js.map +1 -1
- package/dist/frontend/services.d.ts +1 -8
- package/dist/frontend/services.js +2 -22
- package/dist/frontend/services.js.map +1 -1
- package/dist/frontend/services.test.js +0 -38
- package/dist/frontend/services.test.js.map +1 -1
- package/dist/frontend/tsc-codes.js +0 -11
- package/dist/frontend/tsc-codes.js.map +1 -1
- package/dist/frontend/type-mapper.d.ts +2 -27
- package/dist/frontend/type-mapper.js +58 -156
- package/dist/frontend/type-mapper.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -10
- package/dist/index.js.map +1 -1
- package/dist/ir/api.d.ts +1 -1
- package/dist/ir/api.js +1 -1
- package/dist/ir/api.js.map +1 -1
- package/dist/ir/builtin-effects.js +2 -5
- package/dist/ir/builtin-effects.js.map +1 -1
- package/dist/ir/builtin-signatures.d.ts +1 -1
- package/dist/ir/builtin-signatures.js +13 -56
- package/dist/ir/builtin-signatures.js.map +1 -1
- package/dist/ir/constant-globals.test.js +1 -1
- package/dist/ir/constant-tables.test.js +1 -1
- package/dist/ir/final-fields.test.js +1 -1
- package/dist/ir/function-references.d.ts +12 -0
- package/dist/ir/function-references.js +29 -0
- package/dist/ir/function-references.js.map +1 -0
- package/dist/ir/function-references.test.d.ts +1 -0
- package/dist/ir/function-references.test.js +276 -0
- package/dist/ir/function-references.test.js.map +1 -0
- package/dist/ir/initializer-bindings.test.js +1 -1
- package/dist/ir/int32-slots.d.ts +10 -7
- package/dist/ir/int32-slots.js +219 -68
- package/dist/ir/int32-slots.js.map +1 -1
- package/dist/ir/int32-slots.test.js +39 -2
- package/dist/ir/int32-slots.test.js.map +1 -1
- package/dist/ir/integer-ranges.d.ts +4 -4
- package/dist/ir/integer-ranges.js +89 -64
- package/dist/ir/integer-ranges.js.map +1 -1
- package/dist/ir/integer-ranges.test.js +71 -9
- package/dist/ir/integer-ranges.test.js.map +1 -1
- package/dist/ir/intrinsic-signatures.js +1 -0
- package/dist/ir/intrinsic-signatures.js.map +1 -1
- package/dist/ir/ir.d.ts +64 -290
- package/dist/ir/ir.js +11 -259
- package/dist/ir/ir.js.map +1 -1
- package/dist/ir/ir.test.js +2 -7
- package/dist/ir/ir.test.js.map +1 -1
- package/dist/ir/runtime-features.d.ts +3 -30
- package/dist/ir/runtime-features.js +8 -43
- package/dist/ir/runtime-features.js.map +1 -1
- package/dist/ir/scalar-records.test.js +1 -1
- package/dist/ir/serialize.d.ts +1 -1
- package/dist/ir/serialize.js +3 -3
- package/dist/ir/serialize.js.map +1 -1
- package/dist/ir/traverse.js +4 -21
- package/dist/ir/traverse.js.map +1 -1
- package/dist/ir/unshare.test.js +1 -1
- package/dist/ir/validate.js +66 -213
- package/dist/ir/validate.js.map +1 -1
- package/dist/ir/validate.test.js +31 -13
- package/dist/ir/validate.test.js.map +1 -1
- package/dist/library/fence-eval.test.js +1 -1
- package/dist/library/int-infer.test.js +4 -4
- package/dist/library/library-cache.test.js +5 -5
- package/dist/library/prepare.js +5 -20
- package/dist/library/prepare.js.map +1 -1
- package/dist/native/cli.js +0 -2
- package/dist/native/cli.js.map +1 -1
- package/dist/native/compiler.test.js +2 -4
- package/dist/native/compiler.test.js.map +1 -1
- package/dist/native/prepare.js +2 -4
- package/dist/native/prepare.js.map +1 -1
- package/dist/native/sanitizer.js +2 -16
- package/dist/native/sanitizer.js.map +1 -1
- package/dist/native/sanitizer.test.js +0 -3
- package/dist/native/sanitizer.test.js.map +1 -1
- package/dist/startup-cache.js +0 -2
- package/dist/startup-cache.js.map +1 -1
- package/package.json +20 -20
- package/surface-manifest.json +80 -104
- package/dist/backend/llvm/expr-island.d.ts +0 -15
- package/dist/backend/llvm/expr-island.js +0 -709
- package/dist/backend/llvm/expr-island.js.map +0 -1
- package/dist/frontend/lowering/coercions/island.d.ts +0 -37
- package/dist/frontend/lowering/coercions/island.js +0 -350
- package/dist/frontend/lowering/coercions/island.js.map +0 -1
- package/dist/frontend/lowering/lower-island.d.ts +0 -229
- package/dist/frontend/lowering/lower-island.js.map +0 -1
- package/dist/frontend/lowering/lower-island.test.js +0 -56
- package/dist/frontend/lowering/lower-island.test.js.map +0 -1
- package/dist/frontend/npm-fetch-analysis.d.ts +0 -17
- package/dist/frontend/npm-fetch-analysis.js +0 -109
- package/dist/frontend/npm-fetch-analysis.js.map +0 -1
- package/dist/frontend/npm-fetch-analysis.test.js +0 -130
- package/dist/frontend/npm-fetch-analysis.test.js.map +0 -1
- package/dist/frontend/npm-fetch-node.d.ts +0 -2
- package/dist/frontend/npm-fetch-node.js +0 -12
- package/dist/frontend/npm-fetch-node.js.map +0 -1
- package/dist/frontend/npm-fetch-syntax.d.ts +0 -6
- package/dist/frontend/npm-fetch-syntax.js +0 -202
- package/dist/frontend/npm-fetch-syntax.js.map +0 -1
- package/dist/native/runtime-typescript.d.ts +0 -4
- package/dist/native/runtime-typescript.js +0 -74
- package/dist/native/runtime-typescript.js.map +0 -1
- package/dist/native/runtime-typescript.test.js +0 -41
- package/dist/native/runtime-typescript.test.js.map +0 -1
- /package/dist/{frontend/lowering/lower-island.test.d.ts → backend/llvm/expr-calls.test.d.ts} +0 -0
- /package/dist/{frontend/npm-fetch-analysis.test.d.ts → backend/llvm/int32-abi.test.d.ts} +0 -0
- /package/dist/{native/runtime-typescript.test.d.ts → backend/llvm/regex-matchers.test.d.ts} +0 -0
package/dist/ir/ir.d.ts
CHANGED
|
@@ -275,8 +275,7 @@ export type IrType = {
|
|
|
275
275
|
/** Heap, refcounted closure. `rest` marks a variadic function value.
|
|
276
276
|
* `restAbi: "typed"` spells one trailing typed array in `params`; static
|
|
277
277
|
* call sites pack their surplus arguments into it before `callValue`.
|
|
278
|
-
* `restAbi
|
|
279
|
-
* island host callback. An absent `restAbi` is the legacy checked-dynamic
|
|
278
|
+
* An absent `restAbi` is the checked-dynamic
|
|
280
279
|
* JS form: `params` stays the declared non-rest list and the lifted
|
|
281
280
|
* function has one hidden trailing ScrDyn array filled by its boxed call
|
|
282
281
|
* thunk. `argumentsAll` keeps that hidden ABI but fills it with every
|
|
@@ -288,7 +287,7 @@ export type IrType = {
|
|
|
288
287
|
params: IrType[];
|
|
289
288
|
ret: IrType;
|
|
290
289
|
rest?: true;
|
|
291
|
-
restAbi?: "
|
|
290
|
+
restAbi?: "typed";
|
|
292
291
|
argumentsAll?: true;
|
|
293
292
|
} | {
|
|
294
293
|
kind: "object";
|
|
@@ -306,7 +305,7 @@ export type IrType = {
|
|
|
306
305
|
* completion against C's one signature sound. Allowed in locals,
|
|
307
306
|
* globals, params, returns, class/record fields, capture boxes, array
|
|
308
307
|
* elements, Map VALUES, and union arms; fenced out of Map keys, Set
|
|
309
|
-
* elements, JSON,
|
|
308
|
+
* elements, JSON, and ToString. Unknown slots retain
|
|
310
309
|
* class identity and allow an exact typed constructor round trip. */
|
|
311
310
|
| {
|
|
312
311
|
kind: "classval";
|
|
@@ -354,16 +353,6 @@ export type IrType = {
|
|
|
354
353
|
| {
|
|
355
354
|
kind: "dyn";
|
|
356
355
|
}
|
|
357
|
-
/** An island value handle — the type of `any` under --dynamic. Runtime
|
|
358
|
-
* representation is a refcounted cell (ScrJsval) owning one embedded-
|
|
359
|
-
* engine value. It can live in locals, globals, parameters, returns,
|
|
360
|
-
* arrays, class fields, and ambient AbortSignal/AbortController record
|
|
361
|
-
* fields. Operations on jsval compile to engine calls (jsOp) with
|
|
362
|
-
* JS-exact semantics; exits back to static types are validated (jsExit).
|
|
363
|
-
* This kind exists only with the dynamic option. */
|
|
364
|
-
| {
|
|
365
|
-
kind: "jsval";
|
|
366
|
-
}
|
|
367
356
|
/** A catch binding or its closure capture (never parameters, returns,
|
|
368
357
|
* fields, arms or elements). The one global form is a module's recorded
|
|
369
358
|
* evaluation error, written only from that module's catch binding and
|
|
@@ -429,9 +418,9 @@ declare const HANDLE_KIND_LIST: readonly ["stats", "fileHandle", "spawnRes", "ch
|
|
|
429
418
|
export type HandleKind = (typeof HANDLE_KIND_LIST)[number];
|
|
430
419
|
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">;
|
|
431
420
|
/** The IR kinds represented as pointers in native code. */
|
|
432
|
-
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", "
|
|
421
|
+
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", "caught", "promise", "generator"];
|
|
433
422
|
export type PointerKind = (typeof POINTER_KIND_LIST)[number];
|
|
434
|
-
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" | "
|
|
423
|
+
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" | "map" | "moduleNs" | "netServer" | "netSocket" | "object" | "promise" | "record" | "regex" | "searchParams" | "secureCtx" | "set" | "spawnRes" | "stats" | "string" | "symbol" | "testCtx" | "union" | "url">;
|
|
435
424
|
/** Runtime RC symbol stem for each IR type kind. An empty stem means the
|
|
436
425
|
* kind is scalar/unit or uses an emitted per-shape helper (object/record).
|
|
437
426
|
* Keeping this exhaustive makes a new runtime handle kind a compile error
|
|
@@ -477,7 +466,6 @@ export declare const CHILDWRITER_T: IrType;
|
|
|
477
466
|
export declare const PROCSTREAM_T: IrType;
|
|
478
467
|
export declare const VOID: IrType;
|
|
479
468
|
export declare const DYN: IrType;
|
|
480
|
-
export declare const JSVAL: IrType;
|
|
481
469
|
export declare const CAUGHT: IrType;
|
|
482
470
|
export declare const UNDEFINED_T: IrType;
|
|
483
471
|
export declare const NULL_T: IrType;
|
|
@@ -508,7 +496,7 @@ export declare function isSupportedMapKey(t: IrType, unionArms?: IrType[]): bool
|
|
|
508
496
|
/** Set elements and Map keys share storage, equality and ownership rules. */
|
|
509
497
|
export declare function isSupportedSetElem(t: IrType, unionArms?: IrType[]): boolean;
|
|
510
498
|
/** The Map VALUE fence: scalars, supported native references and checked
|
|
511
|
-
* values. Functions require checked-value boxing
|
|
499
|
+
* values. Functions require checked-value boxing.
|
|
512
500
|
* Record/object/union values can point back at the map holding them, which
|
|
513
501
|
* is exactly why ref-valued maps are cycle-capable (see the backend's
|
|
514
502
|
* cycle analysis and docs/memory.md). Shared frontend/validator. */
|
|
@@ -544,7 +532,7 @@ export declare function typeEquals(a: IrType, b: IrType): boolean;
|
|
|
544
532
|
export declare function isRefCounted(t: IrType): boolean;
|
|
545
533
|
export interface IrModule {
|
|
546
534
|
/** Bumped on any breaking IR change; serialize.ts refuses mismatches. */
|
|
547
|
-
irVersion:
|
|
535
|
+
irVersion: 16;
|
|
548
536
|
sourceFile: string;
|
|
549
537
|
functions: IrFunction[];
|
|
550
538
|
/** Class shapes. Constructors and methods are ordinary module functions
|
|
@@ -560,36 +548,6 @@ export interface IrModule {
|
|
|
560
548
|
* per-file `%init.<i>` functions; ids live in a distinct "%g." namespace so
|
|
561
549
|
* they can never collide with function-local ids. */
|
|
562
550
|
globals?: IrGlobal[];
|
|
563
|
-
/** The embedded npm runtime graph (--dynamic builds with npm imports):
|
|
564
|
-
* every reached module's SOURCE, keyed by resolved path, plus the
|
|
565
|
-
* (importer, specifier) → target edges the island's module loader and
|
|
566
|
-
* require shim resolve against. Emitted as static strings — binaries
|
|
567
|
-
* never read node_modules at runtime. Edge targets are module keys or
|
|
568
|
-
* "node:*" builtins (island-shimmed). */
|
|
569
|
-
embedded?: {
|
|
570
|
-
/** `esm` (CommonJS modules only) is the synthesized ESM facade the
|
|
571
|
-
* island loader evaluates when an ES module imports the CJS file:
|
|
572
|
-
* default plus the named exports LEXED from the source at build time
|
|
573
|
-
* (cjs-lexer.ts — the compiler's port of Node's vendored CJS lexer). */
|
|
574
|
-
modules: {
|
|
575
|
-
key: string;
|
|
576
|
-
source: string;
|
|
577
|
-
format: "esm" | "cjs" | "json";
|
|
578
|
-
esm?: string;
|
|
579
|
-
/** Parsed/bound embedded source reaches the engine's global fetch. */
|
|
580
|
-
usesFetch?: true;
|
|
581
|
-
}[];
|
|
582
|
-
/** `kind` picks Node's "exports" condition set per CALL FORM: one
|
|
583
|
-
* (from, specifier) can name a dual package's ESM entry behind an
|
|
584
|
-
* "import" edge AND its CJS entry behind a "require" edge; "any"
|
|
585
|
-
* serves both lookups (relative files, builtins). */
|
|
586
|
-
edges: {
|
|
587
|
-
from: string;
|
|
588
|
-
specifier: string;
|
|
589
|
-
to: string;
|
|
590
|
-
kind: "any" | "import" | "require";
|
|
591
|
-
}[];
|
|
592
|
-
};
|
|
593
551
|
/** Record shapes, in first-seen (`r0`, `r1`, ...) order. Fields are in
|
|
594
552
|
* CANONICAL order (sorted by name) — the shape's identity; a `recordLit`'s
|
|
595
553
|
* fields stay in source order (evaluation order) independently. The
|
|
@@ -1072,7 +1030,8 @@ export interface IrFunction {
|
|
|
1072
1030
|
* completion verdict instead of a build-time-selected member. */
|
|
1073
1031
|
asyncCycleCacheGlobal?: string;
|
|
1074
1032
|
/** Generator (`function*` / `async function*`): the body runs on a fiber created SUSPENDED
|
|
1075
|
-
* (nothing runs until the first `.next()
|
|
1033
|
+
* (nothing runs until the first `.next()`; backends may instead compile a
|
|
1034
|
+
* synchronous body as a stackless coroutine with the same protocol); `returnType` is the
|
|
1076
1035
|
* generator's TReturn (VOID when it carries no value — `return;`
|
|
1077
1036
|
* completes with the undefined arm) while call sites receive the
|
|
1078
1037
|
* generator type `{ async?, yieldT, retT: returnType, nextT }` from an emitted
|
|
@@ -1462,7 +1421,15 @@ export type IrArrIntrinsicMethod =
|
|
|
1462
1421
|
* a value of an `isSortValuesElement` type; the comparator is invoked
|
|
1463
1422
|
* with exactly its declared arity. Returns void; comparator exceptions
|
|
1464
1423
|
* propagate and leave the snapshot unchanged. */
|
|
1465
|
-
| "sortValues"
|
|
1424
|
+
| "sortValues"
|
|
1425
|
+
/** Internal stable comparator sort of a dense array in place: arguments
|
|
1426
|
+
* are [comparator, owned]. Returns false, without calling the comparator,
|
|
1427
|
+
* when the receiver has holes, storage-level undefined or sparse slots, or
|
|
1428
|
+
* is published; the caller then sorts a compacted snapshot. Otherwise the
|
|
1429
|
+
* receiver's values are sorted outside it and written back only after
|
|
1430
|
+
* success, as the spec's sort writes them, and it returns true. `owned`
|
|
1431
|
+
* (a boolean literal) marks a private copy no user code can reach. */
|
|
1432
|
+
| "sortDense" | "length"
|
|
1466
1433
|
/** Internal ToNumber(a[index]) for f64-backed arrays: one numeric index,
|
|
1467
1434
|
* returning the stored number or NaN for a hole/undefined/missing key.
|
|
1468
1435
|
* Borrows the receiver and never traps on missing values. */
|
|
@@ -1496,7 +1463,7 @@ export declare const MAY_THROW_ARR_METHODS: ReadonlySet<IrArrIntrinsicMethod>;
|
|
|
1496
1463
|
/** Element types whose comparator sort can run in the runtime over raw
|
|
1497
1464
|
* slots: numbers, and reference-counted values passed to the comparator by
|
|
1498
1465
|
* pointer. Unions with an undefined arm order undefined last without a
|
|
1499
|
-
* comparator call, and checked
|
|
1466
|
+
* comparator call, and checked values have their own ABI; those
|
|
1500
1467
|
* keep the IR sort helper. */
|
|
1501
1468
|
export declare function isSortValuesElement(elem: IrType, unionArms?: readonly IrType[]): boolean;
|
|
1502
1469
|
/** The Map method/property surface (mirrors ambient/scriptc.d.ts) plus the
|
|
@@ -1645,7 +1612,13 @@ export declare const MAY_THROW_BYTES_METHODS: ReadonlySet<IrBytesIntrinsicMethod
|
|
|
1645
1612
|
export type IrRegexIntrinsicMethod = "test" | "match"
|
|
1646
1613
|
/** exec uses the same string-first operands but keeps the g/y
|
|
1647
1614
|
* lastIndex refusal, independently of global String.match iteration. */
|
|
1648
|
-
| "exec"
|
|
1615
|
+
| "exec"
|
|
1616
|
+
/** exec whose result is read only by null tests and constant-index
|
|
1617
|
+
* element reads: args[1] is a numeric literal whose bit k marks capture k
|
|
1618
|
+
* as read (k < 53). Unmarked captures read as undefined and the result
|
|
1619
|
+
* carries no index/input properties; the match, lastIndex transitions
|
|
1620
|
+
* and null result are exec's. */
|
|
1621
|
+
| "execGroups" | "lastIndex"
|
|
1649
1622
|
/** `s.matchAll(re)` — every match as its honest string[] slice (match's
|
|
1650
1623
|
* rule), drained EAGERLY into a fresh string[][]: the lazy iterator is
|
|
1651
1624
|
* unobservable across the lowered surface (strings are immutable; the
|
|
@@ -1790,8 +1763,7 @@ export type IrExpr =
|
|
|
1790
1763
|
* dyn asks its runtime kind. The other operand form is a UNION — the ARM
|
|
1791
1764
|
* value's ToBoolean via a per-union interned helper (unit arms false;
|
|
1792
1765
|
* f64/string/bool arms per-value; ref arms — arrays, records, objects,
|
|
1793
|
-
* functions, maps, sets, promises, ... — always true
|
|
1794
|
-
* engine). Result is bool. */
|
|
1766
|
+
* functions, maps, sets, promises, ... — always true). Result is bool. */
|
|
1795
1767
|
| {
|
|
1796
1768
|
kind: "toBool";
|
|
1797
1769
|
operand: IrExpr;
|
|
@@ -2296,10 +2268,19 @@ export type IrExpr =
|
|
|
2296
2268
|
* non-suspended generator marks it done and re-throws at the call site.
|
|
2297
2269
|
* Sync generators return that record directly and propagate body errors
|
|
2298
2270
|
* synchronously. Async generators return Promise<record>; requests queue,
|
|
2299
|
-
* and body errors reject the corresponding promise.
|
|
2271
|
+
* and body errors reject the corresponding promise.
|
|
2272
|
+
*
|
|
2273
|
+
* Three record-free modes serve the compiler's own drives of a sync
|
|
2274
|
+
* generator (for-of, spread, yield*), which read only `done` and then the
|
|
2275
|
+
* yielded value: `step` is a valueless next() answering `done` (BOOL;
|
|
2276
|
+
* throws like next); `value` moves the yielded value out, typed as the
|
|
2277
|
+
* yield channel (valid only right after a `step` that answered false;
|
|
2278
|
+
* never throws); `close` is a valueless return() whose result is dropped
|
|
2279
|
+
* (IteratorClose; VOID; throws like return). All three have a null
|
|
2280
|
+
* `arg`. */
|
|
2300
2281
|
| {
|
|
2301
2282
|
kind: "genResume";
|
|
2302
|
-
mode: "next" | "return" | "throw";
|
|
2283
|
+
mode: "next" | "return" | "throw" | "step" | "value" | "close";
|
|
2303
2284
|
gen: IrExpr;
|
|
2304
2285
|
arg: IrExpr | null;
|
|
2305
2286
|
type: IrType;
|
|
@@ -2307,11 +2288,17 @@ export type IrExpr =
|
|
|
2307
2288
|
}
|
|
2308
2289
|
/** Await a promise: parks the current fiber until it settles; a rejected
|
|
2309
2290
|
* promise re-throws into the awaiter (may-throw seed). Result is the
|
|
2310
|
-
* promise's inner value (+1 for refcounted kinds). Only inside async fns.
|
|
2291
|
+
* promise's inner value (+1 for refcounted kinds). Only inside async fns.
|
|
2292
|
+
* `adopt`: the operand of `return` in an async (non-generator) function.
|
|
2293
|
+
* JS resolves the function's promise with the returned promise, which
|
|
2294
|
+
* adopts its settlement through a then job: one microtask turn before
|
|
2295
|
+
* the await proper. Any enclosing finally runs first, and a rejection
|
|
2296
|
+
* leaves the function without reaching its catch handlers. */
|
|
2311
2297
|
| {
|
|
2312
2298
|
kind: "awaitExpr";
|
|
2313
2299
|
value: IrExpr;
|
|
2314
2300
|
type: IrType;
|
|
2301
|
+
adopt?: true;
|
|
2315
2302
|
loc: SrcLoc;
|
|
2316
2303
|
}
|
|
2317
2304
|
/** Await of a promise-or-absent union (`Promise<T> | undefined`, the
|
|
@@ -2594,23 +2581,6 @@ export type IrExpr =
|
|
|
2594
2581
|
type: IrType;
|
|
2595
2582
|
loc: SrcLoc;
|
|
2596
2583
|
}
|
|
2597
|
-
/** Island value → dyn conversion (`type` is always dyn; the operand
|
|
2598
|
-
* is always jsval): the jsval→dyn crossing — an 'any'-typed engine
|
|
2599
|
-
* value flowing into an 'unknown'/'object'/JS-residue slot wraps BY
|
|
2600
|
-
* REFERENCE as the checked-dynamic tree's SCR_DYN_JSVAL kind (scr_dyn_from_jsval).
|
|
2601
|
-
* Engine scalars (number/string/boolean/null/undefined) normalize to
|
|
2602
|
-
* the native dyn kinds at wrap time, so wrapped nodes only ever hold
|
|
2603
|
-
* engine objects/arrays/functions; typeof/truthiness/String()/=== on
|
|
2604
|
-
* the wrapped node route to the engine, un-armed dyn walks fence
|
|
2605
|
-
* loudly, and scr_jsval_from_dyn unwraps the SAME engine value back
|
|
2606
|
-
* (identity round trip). The operand is borrowed; the result is owned
|
|
2607
|
-
* (+1). Never throws. */
|
|
2608
|
-
| {
|
|
2609
|
-
kind: "dynFromJsval";
|
|
2610
|
-
value: IrExpr;
|
|
2611
|
-
type: IrType;
|
|
2612
|
-
loc: SrcLoc;
|
|
2613
|
-
}
|
|
2614
2584
|
/** CALLING a dyn value — `fn(a, b)` where fn is checked-dynamic (an
|
|
2615
2585
|
* implicit-any JS binding, a dyn record member, a dynKeyGet result).
|
|
2616
2586
|
* Arguments are ALREADY dyn-typed (typed values box through dynFrom at
|
|
@@ -2823,8 +2793,7 @@ export type IrExpr =
|
|
|
2823
2793
|
* 'FIRSTPROP' of 'SPELLING' …" when `firstProp` is set (V8 names the
|
|
2824
2794
|
* pattern's first property) — and yields the value unchanged otherwise.
|
|
2825
2795
|
* `spelling` is the RHS's compile-time source spelling. Value and type
|
|
2826
|
-
* are dyn
|
|
2827
|
-
* engine-thrown, catchable like every boundary throw). */
|
|
2796
|
+
* are dyn; the helper throws a catchable error. */
|
|
2828
2797
|
| {
|
|
2829
2798
|
kind: "dynDestrCheck";
|
|
2830
2799
|
value: IrExpr;
|
|
@@ -2837,10 +2806,7 @@ export type IrExpr =
|
|
|
2837
2806
|
* it. Over a dyn value: arrays step by index, strings by code point,
|
|
2838
2807
|
* Buffers by byte; everything else throws V8's exact "<desc> is not
|
|
2839
2808
|
* iterable (cannot read property Symbol(Symbol.iterator))" TypeError.
|
|
2840
|
-
*
|
|
2841
|
-
* protocol (user iterables included, IteratorClose per spec) behind the
|
|
2842
|
-
* same V8 message for non-iterables. The result is a FRESH array (dyn
|
|
2843
|
-
* or engine, matching the operand) of exactly `count` elements
|
|
2809
|
+
* The result is a fresh dyn array of exactly `count` elements
|
|
2844
2810
|
* (undefined-padded past the end) — the empty pattern passes count 0
|
|
2845
2811
|
* and uses only the validation. Value is borrowed; the result is owned
|
|
2846
2812
|
* (+1). */
|
|
@@ -2924,6 +2890,22 @@ export type IrExpr =
|
|
|
2924
2890
|
type: IrType;
|
|
2925
2891
|
loc: SrcLoc;
|
|
2926
2892
|
}
|
|
2893
|
+
/** Identity union conversion: `value` (union `fromId`) currently holds
|
|
2894
|
+
* one of `tags`, and each listed tag names an equal arm at the same index
|
|
2895
|
+
* of the target union `unionId` (`type`). The result is the same value
|
|
2896
|
+
* viewed as the target union: owned (+1), and for two tagged unions the
|
|
2897
|
+
* very same box (unions are immutable and box identity is unobservable).
|
|
2898
|
+
* The operand is therefore a whole-value use: it escapes through the
|
|
2899
|
+
* result, so it can never be a stack box. Never throws. */
|
|
2900
|
+
| {
|
|
2901
|
+
kind: "unionRetype";
|
|
2902
|
+
fromId: string;
|
|
2903
|
+
unionId: string;
|
|
2904
|
+
tags: number[];
|
|
2905
|
+
value: IrExpr;
|
|
2906
|
+
type: IrType;
|
|
2907
|
+
loc: SrcLoc;
|
|
2908
|
+
}
|
|
2927
2909
|
/** Strict identity comparison between a function arm of a union and a
|
|
2928
2910
|
* function value with a potentially different static signature. This is
|
|
2929
2911
|
* non-coercing: closures share one pointer representation, but the value
|
|
@@ -3193,144 +3175,7 @@ export type IrExpr =
|
|
|
3193
3175
|
preserveRefs?: true;
|
|
3194
3176
|
type: IrType;
|
|
3195
3177
|
loc: SrcLoc;
|
|
3196
|
-
}
|
|
3197
|
-
/** Static → island marshal (--dynamic builds only). `value`'s type is
|
|
3198
|
-
* f64/string/bool (marshaled by value) or a JSON-safe composite
|
|
3199
|
-
* (record/array/union — marshaled as a DEEP COPY through the emitted
|
|
3200
|
-
* type-directed JSON serializer and the engine's JSON parser; the
|
|
3201
|
-
* aliasing divergence is documented in SEMANTICS.md). Result is an
|
|
3202
|
-
* owned (+1) jsval; the operand is borrowed. Never throws. */
|
|
3203
|
-
| {
|
|
3204
|
-
kind: "jsMarshal";
|
|
3205
|
-
value: IrExpr;
|
|
3206
|
-
type: IrType;
|
|
3207
|
-
loc: SrcLoc;
|
|
3208
|
-
}
|
|
3209
|
-
/** An operation on island values (--dynamic builds only), executed by
|
|
3210
|
-
* the embedded engine with JS-exact semantics (coercions come from
|
|
3211
|
-
* pinned prelude closures, not C reimplementations). `args` are
|
|
3212
|
-
* jsval-typed and borrowed. Result `type` per op: arithmetic
|
|
3213
|
-
* (add/sub/mul/div/mod/pow), unary neg/plus, getProp/getIdx,
|
|
3214
|
-
* callMethod/callFn/callFnThis/globalGet → jsval (+1); comparisons
|
|
3215
|
-
* (lt/le/gt/ge/eq/neq), truthy, not → bool; typeof, toStr → string (+1);
|
|
3216
|
-
* setProp/setIdx → void. `name` carries the property/method identifier
|
|
3217
|
-
* for getProp/setProp/callMethod/globalGet, absent otherwise. MAY THROW
|
|
3218
|
-
* (engine
|
|
3219
|
-
* exceptions bridge into the exception cell, catchably) — backends'
|
|
3220
|
-
* may-throw analyses must seed on every jsOp like a `throw`. */
|
|
3221
|
-
| {
|
|
3222
|
-
kind: "jsOp";
|
|
3223
|
-
op: IrJsOp;
|
|
3224
|
-
name?: string;
|
|
3225
|
-
args: IrExpr[];
|
|
3226
|
-
type: IrType;
|
|
3227
|
-
loc: SrcLoc;
|
|
3228
|
-
}
|
|
3229
|
-
/** Island → static validated exit (--dynamic builds only): `value` is
|
|
3230
|
-
* jsval-typed, `type` is the static target. STRICT for primitives (a
|
|
3231
|
-
* non-number refuses to exit as number — no coercion); composite
|
|
3232
|
-
* targets round-trip through the engine's JSON.stringify and the
|
|
3233
|
-
* existing dynCheck walker for the target (width-tolerant records,
|
|
3234
|
-
* path-annotated failures — identical semantics to `dyn as T`). MAY
|
|
3235
|
-
* THROW a catchable TypeError-shaped string. The operand is borrowed;
|
|
3236
|
-
* the result is owned (+1) for refcounted targets. */
|
|
3237
|
-
| {
|
|
3238
|
-
kind: "jsExit";
|
|
3239
|
-
value: IrExpr;
|
|
3240
|
-
type: IrType;
|
|
3241
|
-
loc: SrcLoc;
|
|
3242
|
-
}
|
|
3243
|
-
/** Island → static PROMISE bridge (--dynamic builds only): `value` is a
|
|
3244
|
-
* jsval whose declared type is Promise<T> (a package call's promise —
|
|
3245
|
-
* it lives in the engine); the result is a fresh pending static promise
|
|
3246
|
-
* the engine promise settles. `type` is promise-of-jsval (the settled
|
|
3247
|
-
* engine value crosses as a retained handle; typed uses exit like any
|
|
3248
|
-
* jsval) or promise-of-void (T mapped to void — nothing to carry).
|
|
3249
|
-
* Fulfillment wakes parked awaiters through the ready queue; rejection
|
|
3250
|
-
* crosses like a bridged exception (engine Errors become real static
|
|
3251
|
-
* Errors) and re-throws at the await or enters the unhandled ledger.
|
|
3252
|
-
* Bridging one engine promise twice makes two independent static
|
|
3253
|
-
* observers of the same settlement — semantically equivalent, slightly
|
|
3254
|
-
* redundant (SEMANTICS.md). Operand borrowed; result +1. MAY THROW
|
|
3255
|
-
* only on an engine-level surprise minting the subscription — backends
|
|
3256
|
-
* seed may-throw and emit the pending check like other island ops. */
|
|
3257
|
-
| {
|
|
3258
|
-
kind: "jsBridgePromise";
|
|
3259
|
-
value: IrExpr;
|
|
3260
|
-
type: IrType;
|
|
3261
|
-
loc: SrcLoc;
|
|
3262
3178
|
};
|
|
3263
|
-
/** The island operation set. Grouped by result type — see the jsOp node
|
|
3264
|
-
* doc. A closed union: every member has a lowering rule in the frontend,
|
|
3265
|
-
* a validation rule, and a scr_jsval_* implementation in scr_island.c. */
|
|
3266
|
-
export type IrJsOp = "add" | "sub" | "mul" | "div" | "mod" | "pow" | "neg" | "plus" | "lt" | "le" | "gt" | "ge" | "eq" | "neq"
|
|
3267
|
-
/** `v instanceof C` where BOTH sides are island values (a package-
|
|
3268
|
-
* exported class as the RHS): the spec's InstanceofOperator in the
|
|
3269
|
-
* engine, Symbol.hasInstance included; a non-object RHS throws the
|
|
3270
|
-
* engine's own TypeError, bridged catchably. */
|
|
3271
|
-
| "instanceOf" | "truthy" | "not" | "typeof" | "toStr" | "getProp" | "setProp" | "getIdx" | "setIdx" | "callMethod" | "callFn"
|
|
3272
|
-
/** Calls an already-resolved island function with an explicit receiver.
|
|
3273
|
-
* Args are (callee, receiver, ...arguments); this preserves computed
|
|
3274
|
-
* method evaluation order without reading a getter twice. */
|
|
3275
|
-
| "callFnThis"
|
|
3276
|
-
/** Spread application on an island callee — `f(...pre, ...s)`, the
|
|
3277
|
-
* rest-forwarding idiom (`(...args) => g(...args)` under --dynamic).
|
|
3278
|
-
* Args are exactly (callee, pre, spread): `pre` is the engine array of
|
|
3279
|
-
* leading fixed arguments (jsOp arrLit), `spread` the spread source;
|
|
3280
|
-
* `name` carries the spread expression's source spelling (V8's nullish
|
|
3281
|
-
* spread-call TypeError spells it). The prelude helper uses REAL spread
|
|
3282
|
-
* syntax, so iterator protocols are the engine's own, with guards
|
|
3283
|
-
* front-running V8's exact spread-call TypeError texts. May throw. */
|
|
3284
|
-
| "callSpread"
|
|
3285
|
-
/** `new X(...)` where X is jsval-typed (package-declared classes):
|
|
3286
|
-
* JS_CallConstructor — args are the callee then the constructor
|
|
3287
|
-
* arguments, mirroring callFn. */
|
|
3288
|
-
| "construct"
|
|
3289
|
-
/** A member of the engine's global object by name (Math, parseFloat, ...)
|
|
3290
|
-
* — the receiver/callee for the island-backed ambient surface. Zero args;
|
|
3291
|
-
* `name` carries the global's identifier. May-throw for uniformity with
|
|
3292
|
-
* the other engine entries (the emitter's pending check runs after it). */
|
|
3293
|
-
| "globalGet"
|
|
3294
|
-
/** Island-native literals: an object literal / array literal whose
|
|
3295
|
-
* contextual type is `any` builds directly in the engine — objLit args
|
|
3296
|
-
* are alternating key/value jsvals (keys are marshaled strings), arrLit
|
|
3297
|
-
* args are the elements. Never throw. */
|
|
3298
|
-
| "objLit" | "arrLit"
|
|
3299
|
-
/** The engine-native TemplateStringsArray for an ISLAND TAG call: args
|
|
3300
|
-
* are 2n marshaled strings — n cooked then n raw — building a fresh
|
|
3301
|
-
* engine array whose `.raw` carries the raw spellings (tags dispatch on
|
|
3302
|
-
* it). Never throws. */
|
|
3303
|
-
| "tplStrings"
|
|
3304
|
-
/** Spread completion for an island-native object literal: copies
|
|
3305
|
-
* args[1]'s own enumerable properties onto args[0] (the spec's
|
|
3306
|
-
* CopyDataProperties — the engine's own Object.assign; null/undefined
|
|
3307
|
-
* sources spread nothing) and answers args[0] for chaining. May throw
|
|
3308
|
-
* (getters run). */
|
|
3309
|
-
| "objSpread"
|
|
3310
|
-
/** Accessor completion for an island-native object literal: defines a
|
|
3311
|
-
* GETTER property on args[0] (the object) — args are (obj, key string
|
|
3312
|
-
* marshal, getter function handle) — and answers the same object (the
|
|
3313
|
-
* chainable spelling: `defineGetter(objLit(...), k, f)`). The
|
|
3314
|
-
* self-referential doc-printer root-indent shape. Never throws. */
|
|
3315
|
-
| "defineGetter"
|
|
3316
|
-
/** The engine's own undefined / null as island values (zero args, never
|
|
3317
|
-
* throw): the unit arms of a union marshaling IN (`string | undefined`
|
|
3318
|
-
* into an 'any' slot — the undefined arm IS the engine undefined), and
|
|
3319
|
-
* conceptually the unit path of `x?.y` on 'any' (the emitter inlines
|
|
3320
|
-
* that one). */
|
|
3321
|
-
| "undefLit" | "nullLit"
|
|
3322
|
-
/** GetIterator over an island value — the for-of head over 'any' (the
|
|
3323
|
-
* engine's own protocol lookup; V8's not-iterable TypeError on refusal).
|
|
3324
|
-
* The loop drives next() through callMethod and reads value/done with
|
|
3325
|
-
* getProp/truthy. */
|
|
3326
|
-
| "iterNew"
|
|
3327
|
-
/** `o.name?.(...)` — the optional METHOD call on an island receiver: a
|
|
3328
|
-
* nullish member answers the engine's undefined, anything else calls
|
|
3329
|
-
* with `this = o` (JS-exact; non-callables throw in the engine). */
|
|
3330
|
-
| "optCallMethod";
|
|
3331
|
-
/** Result-type rule for each island op (the validator enforces it; the
|
|
3332
|
-
* frontend constructs nodes with exactly these). */
|
|
3333
|
-
export declare function jsOpResultKind(op: IrJsOp): "jsval" | "bool" | "string" | "void";
|
|
3334
3179
|
/** True when a type is a union with an undefined arm — the optional-flavored
|
|
3335
3180
|
* slot marker shared by the frontend (record literals may omit such fields)
|
|
3336
3181
|
* and backends (JSON serializers DROP such fields when they hold undefined,
|
|
@@ -3360,60 +3205,9 @@ export declare function isJsonStringifySafeType(t: IrType, getRecord: (shapeId:
|
|
|
3360
3205
|
/** A JSON-shaped container with unknown payloads needs the runtime JSON
|
|
3361
3206
|
* traversal. Its declared structure can be boxed, but payloads may carry
|
|
3362
3207
|
* omitted values, toJSON methods, or cycles. This predicate does not widen
|
|
3363
|
-
* the type-directed serializer, checked-
|
|
3208
|
+
* the type-directed serializer, checked-value boundary, or root-undefined
|
|
3364
3209
|
* contract; callers must select the checked runtime traversal explicitly. */
|
|
3365
3210
|
export declare function isJsonStringifyDynamicType(t: IrType, getRecord: (shapeId: string) => IrRecordShape | undefined, getUnion: (unionId: string) => IrUnionDef | undefined): boolean;
|
|
3366
|
-
/** THE island boundary predicate: true when a static type can cross into
|
|
3367
|
-
* the island (jsMarshal — primitives by value, composites as deep JSON
|
|
3368
|
-
* copies) and back out (jsExit — strict primitive extraction, composites
|
|
3369
|
-
* through the dynCheck walker). Primitives are JSON-safe, so the rule
|
|
3370
|
-
* coincides with isJsonSafeType; it has its own name because the boundary
|
|
3371
|
-
* is its own concept — the frontend's implicit coercions, the explicit-cast
|
|
3372
|
-
* lowering, and the validator's jsMarshal/jsExit rules all ask this ONE
|
|
3373
|
-
* question, and the boundary rejection messages describe exactly this set. */
|
|
3374
|
-
export declare function canCrossIslandBoundary(t: IrType, getRecord: (shapeId: string) => IrRecordShape | undefined, getUnion: (unionId: string) => IrUnionDef | undefined): boolean;
|
|
3375
|
-
/** True for a closure type that can cross INTO the island as a host
|
|
3376
|
-
* function: every parameter jsval (the engine's arguments pass through as
|
|
3377
|
-
* handles — no per-type extraction exists inside a host call) and the
|
|
3378
|
-
* result jsval, void, or a primitive (which marshals back by value —
|
|
3379
|
-
* `(x) => x * 2` on an 'any' x infers a number return). Contextual typing
|
|
3380
|
-
* produces exactly this shape for callbacks passed to package APIs
|
|
3381
|
-
* (`.action((a, b) => ...)` against `(...args: any[]) => void`). Arity is
|
|
3382
|
-
* capped by the runtime's host-call argument buffer (scr_island.c). */
|
|
3383
|
-
export declare const MAX_ISLAND_CALLBACK_ARITY = 16;
|
|
3384
|
-
export declare function canMarshalFuncIntoIsland(t: IrType): boolean;
|
|
3385
|
-
/** Parameter types a TYPED closure may declare when it crosses INTO the
|
|
3386
|
-
* island as a host function: jsval params take the engine argument as a
|
|
3387
|
-
* handle (the all-'any' shape above); dyn params normalize scalars or retain
|
|
3388
|
-
* engine objects by reference. Every other admitted type converts
|
|
3389
|
-
* AT CALL TIME through the validated-exit machinery — strict primitives,
|
|
3390
|
-
* JSON round-trip composites (the dynCheck walker: width-tolerant records,
|
|
3391
|
-
* path-annotated failures). On top of the jsExit set, a bare `T | undefined`
|
|
3392
|
-
* union is admitted here — an absent or undefined engine argument takes the
|
|
3393
|
-
* undefined arm, exactly the missing-optional-field rule (and exactly the
|
|
3394
|
-
* commander case: `.action((text: string | undefined, opts) => ...)` sees
|
|
3395
|
-
* undefined when the command argument is omitted). */
|
|
3396
|
-
export declare function isIslandCallbackParamType(t: IrType, getRecord: (shapeId: string) => IrRecordShape | undefined, getUnion: (unionId: string) => IrUnionDef | undefined): boolean;
|
|
3397
|
-
/** Classify a typed island callback's RETURN for adapter synthesis: sync
|
|
3398
|
-
* kinds marshal back by value ('void'|'jsval'|'f64'|'bool'|'string' — the
|
|
3399
|
-
* canMarshalFuncIntoIsland set), 'json' marshals a JSON-safe composite
|
|
3400
|
-
* through the type-directed serializer + engine parse (the jsMarshal
|
|
3401
|
-
* composite path — commander's option-argument collectors return arrays
|
|
3402
|
-
* this way), and a Promise of the by-value kinds wraps as an engine
|
|
3403
|
-
* promise settled when the scriptc promise settles (async callbacks —
|
|
3404
|
-
* the `.action(async ...)` case). Null for anything else (Promise of
|
|
3405
|
-
* composites: still fenced). */
|
|
3406
|
-
export declare function islandCallbackRet(t: IrType, getRecord: (shapeId: string) => IrRecordShape | undefined, getUnion: (unionId: string) => IrUnionDef | undefined): {
|
|
3407
|
-
async: boolean;
|
|
3408
|
-
tag: "void" | "jsval" | "f64" | "bool" | "string" | "json" | "dyn";
|
|
3409
|
-
} | null;
|
|
3410
|
-
/** The TYPED extension of canMarshalFuncIntoIsland (a strict superset):
|
|
3411
|
-
* closures whose params are per-argument-convertible at call time
|
|
3412
|
-
* (isIslandCallbackParamType) and whose return classifies
|
|
3413
|
-
* (islandCallbackRet). Same arity cap — the runtime's host-call argument
|
|
3414
|
-
* buffer. Statically typed closure parameters stay fenced; unknown values
|
|
3415
|
-
* enter as checked-dynamic values and are validated at each typed use. */
|
|
3416
|
-
export declare function canMarshalTypedFuncIntoIsland(t: IrType, getRecord: (shapeId: string) => IrRecordShape | undefined, getUnion: (unionId: string) => IrUnionDef | undefined): boolean;
|
|
3417
3211
|
/** The runtime HANDLE kinds that cross the checked-dynamic boundary as
|
|
3418
3212
|
* the checked-dynamic tree's HANDLE kind (SCR_DYN_HANDLE): boxed by REFERENCE (identity —
|
|
3419
3213
|
* stateful I/O objects never copy), unboxed by tag check, members
|
|
@@ -3470,23 +3264,3 @@ export declare function canBoxFuncIntoDyn(t: IrType, getRecord: (shapeId: string
|
|
|
3470
3264
|
* dyn), return void, dyn, or dynCheckable (the adapter validates the dyn
|
|
3471
3265
|
* result). */
|
|
3472
3266
|
export declare function canAdaptDynFuncTo(t: IrType, getRecord: (shapeId: string) => IrRecordShape | undefined, getUnion: (unionId: string) => IrUnionDef | undefined, visiting?: Set<string>): boolean;
|
|
3473
|
-
/** The MARSHAL-direction boundary (jsMarshal): everything that can cross
|
|
3474
|
-
* out and back (canCrossIslandBoundary) plus qualifying closures — those
|
|
3475
|
-
* enter as host functions but never EXIT (jsExit keeps the narrower
|
|
3476
|
-
* predicate). */
|
|
3477
|
-
export declare function canMarshalIntoIsland(t: IrType, getRecord: (shapeId: string) => IrRecordShape | undefined, getUnion: (unionId: string) => IrUnionDef | undefined): boolean;
|
|
3478
|
-
/** The EXIT-direction boundary (jsExit): everything round-trippable
|
|
3479
|
-
* (canCrossIslandBoundary) plus BARE undefined/null-armed unions whose
|
|
3480
|
-
* data arms are all JSON-safe — the engine's undefined takes the
|
|
3481
|
-
* undefined arm before the JSON detour (JSON cannot spell undefined, and
|
|
3482
|
-
* bare undefined-armed unions are JSON-unsafe for exactly that reason),
|
|
3483
|
-
* null and data ride the round trip into the union's dynCheck. The
|
|
3484
|
-
* package-API shape `result.headers` : `Record<string, string> |
|
|
3485
|
-
* undefined` is the motivating case. */
|
|
3486
|
-
/** The static-promise→engine bridge's payload domain: the fulfillment
|
|
3487
|
-
* types a scriptc promise may deliver INTO the island as a real engine
|
|
3488
|
-
* thenable (scr_jsval_from_promise — the async-callback return bridge,
|
|
3489
|
-
* reused by promise VALUES crossing at jsvalIn edges and the island
|
|
3490
|
-
* Promise.all arm). Null = outside the domain (the boundary fence). */
|
|
3491
|
-
export declare function islandPromisePayloadTag(inner: IrType): "void" | "f64" | "bool" | "string" | "jsval" | "jsvalArr" | null;
|
|
3492
|
-
export declare function canExitIslandToType(t: IrType, getRecord: (shapeId: string) => IrRecordShape | undefined, getUnion: (unionId: string) => IrUnionDef | undefined): boolean;
|