@scriptc/compiler 0.2.4 → 0.2.5
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 +915 -215
- package/ambient/scriptc-overrides.d.ts +5 -1
- package/ambient/scriptc.d.ts +22 -2
- package/dist/backend/build-cache.d.ts +4 -0
- package/dist/backend/build-cache.js +16 -2
- package/dist/backend/build-cache.js.map +1 -1
- package/dist/backend/cycle-analysis.js +17 -5
- package/dist/backend/cycle-analysis.js.map +1 -1
- package/dist/backend/cycle-analysis.test.js +50 -11
- package/dist/backend/cycle-analysis.test.js.map +1 -1
- package/dist/backend/debug-symbols.js.map +1 -1
- package/dist/backend/executable-features.js +2 -1
- package/dist/backend/executable-features.js.map +1 -1
- package/dist/backend/external-c.d.ts +13 -6
- package/dist/backend/external-c.js +15 -3
- package/dist/backend/external-c.js.map +1 -1
- package/dist/backend/ffi-callbacks.js +6 -9
- package/dist/backend/ffi-callbacks.js.map +1 -1
- package/dist/backend/library-identity-markers.js.map +1 -1
- package/dist/backend/library-pack.d.ts +1 -1
- package/dist/backend/library-pack.js +81 -24
- package/dist/backend/library-pack.js.map +1 -1
- package/dist/backend/link-plan-core.js +9 -2
- package/dist/backend/link-plan-core.js.map +1 -1
- package/dist/backend/link-plan.d.ts +1 -1
- package/dist/backend/link-plan.js +4 -5
- package/dist/backend/link-plan.js.map +1 -1
- package/dist/backend/linker.d.ts +1 -1
- package/dist/backend/linker.js +42 -23
- package/dist/backend/linker.js.map +1 -1
- package/dist/backend/literals.js +5 -4
- package/dist/backend/literals.js.map +1 -1
- package/dist/backend/literals.test.js +30 -5
- package/dist/backend/literals.test.js.map +1 -1
- package/dist/backend/llvm/blocks.test.js +5 -2
- package/dist/backend/llvm/blocks.test.js.map +1 -1
- package/dist/backend/llvm/borrowed-inputs.js.map +1 -1
- package/dist/backend/llvm/borrowed-receivers.js +43 -19
- package/dist/backend/llvm/borrowed-receivers.js.map +1 -1
- package/dist/backend/llvm/byte-numbers.js +6 -1
- package/dist/backend/llvm/byte-numbers.js.map +1 -1
- package/dist/backend/llvm/bytes-bounds.js +73 -22
- package/dist/backend/llvm/bytes-bounds.js.map +1 -1
- package/dist/backend/llvm/call-lifetimes.d.ts +3 -0
- package/dist/backend/llvm/call-lifetimes.js +60 -17
- package/dist/backend/llvm/call-lifetimes.js.map +1 -1
- package/dist/backend/llvm/call-lifetimes.test.js +159 -28
- package/dist/backend/llvm/call-lifetimes.test.js.map +1 -1
- package/dist/backend/llvm/checked-value-lifetimes.d.ts +4 -0
- package/dist/backend/llvm/checked-value-lifetimes.js +14 -4
- package/dist/backend/llvm/checked-value-lifetimes.js.map +1 -1
- package/dist/backend/llvm/classes.js +16 -12
- package/dist/backend/llvm/classes.js.map +1 -1
- package/dist/backend/llvm/common.js +4 -1
- package/dist/backend/llvm/common.js.map +1 -1
- package/dist/backend/llvm/counted-loops.js +10 -3
- package/dist/backend/llvm/counted-loops.js.map +1 -1
- package/dist/backend/llvm/debug-info.js +33 -13
- package/dist/backend/llvm/debug-info.js.map +1 -1
- package/dist/backend/llvm/debug-info.test.js +28 -6
- package/dist/backend/llvm/debug-info.test.js.map +1 -1
- package/dist/backend/llvm/dyn.js +68 -22
- package/dist/backend/llvm/dyn.js.map +1 -1
- package/dist/backend/llvm/emitter.d.ts +9 -3
- package/dist/backend/llvm/emitter.js +238 -105
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/backend/llvm/emitter.test.js +233 -42
- package/dist/backend/llvm/emitter.test.js.map +1 -1
- package/dist/backend/llvm/expr-async.js +25 -6
- package/dist/backend/llvm/expr-async.js.map +1 -1
- package/dist/backend/llvm/expr-bytes.js +13 -4
- package/dist/backend/llvm/expr-bytes.js.map +1 -1
- package/dist/backend/llvm/expr-callbacks.js +10 -4
- package/dist/backend/llvm/expr-callbacks.js.map +1 -1
- package/dist/backend/llvm/expr-calls.js +20 -9
- package/dist/backend/llvm/expr-calls.js.map +1 -1
- package/dist/backend/llvm/expr-containers.d.ts +2 -0
- package/dist/backend/llvm/expr-containers.js +92 -33
- package/dist/backend/llvm/expr-containers.js.map +1 -1
- package/dist/backend/llvm/expr-control.js +1 -3
- package/dist/backend/llvm/expr-control.js.map +1 -1
- package/dist/backend/llvm/expr-dispatch.js +3 -1
- package/dist/backend/llvm/expr-dispatch.js.map +1 -1
- package/dist/backend/llvm/expr-dynamic.js +19 -4
- package/dist/backend/llvm/expr-dynamic.js.map +1 -1
- package/dist/backend/llvm/expr-island.js +26 -6
- package/dist/backend/llvm/expr-island.js.map +1 -1
- package/dist/backend/llvm/expr-primitives.js +88 -19
- package/dist/backend/llvm/expr-primitives.js.map +1 -1
- package/dist/backend/llvm/expr-primitives.test.js +43 -1
- package/dist/backend/llvm/expr-primitives.test.js.map +1 -1
- package/dist/backend/llvm/expr-records.js +10 -9
- package/dist/backend/llvm/expr-records.js.map +1 -1
- package/dist/backend/llvm/expr-stream-bridges.js +44 -26
- package/dist/backend/llvm/expr-stream-bridges.js.map +1 -1
- package/dist/backend/llvm/expr-stream-bridges.test.js +51 -14
- package/dist/backend/llvm/expr-stream-bridges.test.js.map +1 -1
- package/dist/backend/llvm/expr-stream-callbacks.js +34 -14
- package/dist/backend/llvm/expr-stream-callbacks.js.map +1 -1
- package/dist/backend/llvm/integer-values.js +15 -4
- package/dist/backend/llvm/integer-values.js.map +1 -1
- package/dist/backend/llvm/integer-views.js +23 -7
- package/dist/backend/llvm/integer-views.js.map +1 -1
- package/dist/backend/llvm/integer-views.test.js +42 -7
- package/dist/backend/llvm/integer-views.test.js.map +1 -1
- package/dist/backend/llvm/lib-abi.js +13 -4
- package/dist/backend/llvm/lib-abi.js.map +1 -1
- package/dist/backend/llvm/lib-connect.js +7 -1
- package/dist/backend/llvm/lib-connect.js.map +1 -1
- package/dist/backend/llvm/lib-datagram.js +35 -10
- package/dist/backend/llvm/lib-datagram.js.map +1 -1
- package/dist/backend/llvm/lib-dispatch.js +35 -16
- package/dist/backend/llvm/lib-dispatch.js.map +1 -1
- package/dist/backend/llvm/lib-filesystem.js +33 -18
- package/dist/backend/llvm/lib-filesystem.js.map +1 -1
- package/dist/backend/llvm/lib-http2.js +60 -15
- package/dist/backend/llvm/lib-http2.js.map +1 -1
- package/dist/backend/llvm/lib-lookup.js +12 -5
- package/dist/backend/llvm/lib-lookup.js.map +1 -1
- package/dist/backend/llvm/lib-network.js +97 -31
- package/dist/backend/llvm/lib-network.js.map +1 -1
- package/dist/backend/llvm/lib-process.js +57 -14
- package/dist/backend/llvm/lib-process.js.map +1 -1
- package/dist/backend/llvm/lib-shared.js +107 -31
- package/dist/backend/llvm/lib-shared.js.map +1 -1
- package/dist/backend/llvm/lib-stream.js +33 -14
- package/dist/backend/llvm/lib-stream.js.map +1 -1
- package/dist/backend/llvm/lib-test.js +21 -7
- package/dist/backend/llvm/lib-test.js.map +1 -1
- package/dist/backend/llvm/lib-tls.js +69 -20
- package/dist/backend/llvm/lib-tls.js.map +1 -1
- package/dist/backend/llvm/local-array-reads.d.ts +1 -0
- package/dist/backend/llvm/local-array-reads.js +96 -30
- package/dist/backend/llvm/local-array-reads.js.map +1 -1
- package/dist/backend/llvm/local-array-reads.test.js +368 -60
- package/dist/backend/llvm/local-array-reads.test.js.map +1 -1
- package/dist/backend/llvm/local-union-storage.d.ts +25 -0
- package/dist/backend/llvm/local-union-storage.js +109 -0
- package/dist/backend/llvm/local-union-storage.js.map +1 -0
- package/dist/backend/llvm/local-union-storage.test.d.ts +1 -0
- package/dist/backend/llvm/local-union-storage.test.js +210 -0
- package/dist/backend/llvm/local-union-storage.test.js.map +1 -0
- package/dist/backend/llvm/map-read-lifetimes.d.ts +6 -2
- package/dist/backend/llvm/map-read-lifetimes.js +44 -14
- package/dist/backend/llvm/map-read-lifetimes.js.map +1 -1
- package/dist/backend/llvm/map-read-lifetimes.test.js +89 -17
- package/dist/backend/llvm/map-read-lifetimes.test.js.map +1 -1
- package/dist/backend/llvm/reference-effects.d.ts +3 -2
- package/dist/backend/llvm/reference-effects.js +67 -36
- package/dist/backend/llvm/reference-effects.js.map +1 -1
- package/dist/backend/llvm/reference-effects.test.js +92 -9
- package/dist/backend/llvm/reference-effects.test.js.map +1 -1
- package/dist/backend/llvm/shapes.js +60 -17
- package/dist/backend/llvm/shapes.js.map +1 -1
- package/dist/backend/llvm/shapes.test.js +3 -1
- package/dist/backend/llvm/shapes.test.js.map +1 -1
- package/dist/backend/llvm/split.js +4 -4
- package/dist/backend/llvm/split.js.map +1 -1
- package/dist/backend/llvm/split.test.js +14 -6
- package/dist/backend/llvm/split.test.js.map +1 -1
- package/dist/backend/llvm/stack-unions.js +14 -5
- package/dist/backend/llvm/stack-unions.js.map +1 -1
- package/dist/backend/llvm/stack-unions.test.js +151 -32
- package/dist/backend/llvm/stack-unions.test.js.map +1 -1
- package/dist/backend/llvm/string-construction.js.map +1 -1
- package/dist/backend/llvm/string-construction.test.js +32 -7
- package/dist/backend/llvm/string-construction.test.js.map +1 -1
- package/dist/backend/llvm/string-lifetimes.js +14 -8
- package/dist/backend/llvm/string-lifetimes.js.map +1 -1
- package/dist/backend/llvm/string-lifetimes.test.js +112 -26
- package/dist/backend/llvm/string-lifetimes.test.js.map +1 -1
- package/dist/backend/llvm/switch-dispatch.d.ts +9 -0
- package/dist/backend/llvm/switch-dispatch.js +114 -0
- package/dist/backend/llvm/switch-dispatch.js.map +1 -0
- package/dist/backend/llvm/switch-dispatch.test.d.ts +1 -0
- package/dist/backend/llvm/switch-dispatch.test.js +83 -0
- package/dist/backend/llvm/switch-dispatch.test.js.map +1 -0
- package/dist/backend/llvm/unsupported.js.map +1 -1
- package/dist/backend/llvm/walkers.js +6 -3
- package/dist/backend/llvm/walkers.js.map +1 -1
- package/dist/backend/mangle.js +9 -3
- package/dist/backend/mangle.js.map +1 -1
- package/dist/backend/may-throw.js +18 -8
- package/dist/backend/may-throw.js.map +1 -1
- package/dist/backend/may-throw.test.js +118 -22
- package/dist/backend/may-throw.test.js.map +1 -1
- package/dist/backend/native/artifact-stamps.d.ts +39 -0
- package/dist/backend/native/artifact-stamps.js +371 -0
- package/dist/backend/native/artifact-stamps.js.map +1 -0
- package/dist/backend/native/cache-warm.d.ts +24 -0
- package/dist/backend/native/cache-warm.js +80 -0
- package/dist/backend/native/cache-warm.js.map +1 -0
- package/dist/backend/native/compiler-fingerprint.d.ts +19 -0
- package/dist/backend/native/compiler-fingerprint.js +357 -0
- package/dist/backend/native/compiler-fingerprint.js.map +1 -0
- package/dist/backend/native/contracts.d.ts +314 -0
- package/dist/backend/native/contracts.js +2 -0
- package/dist/backend/native/contracts.js.map +1 -0
- package/dist/backend/native/dependency-files.d.ts +5 -0
- package/dist/backend/native/dependency-files.js +83 -0
- package/dist/backend/native/dependency-files.js.map +1 -0
- package/dist/backend/native/driver.d.ts +50 -0
- package/dist/backend/native/driver.js +294 -0
- package/dist/backend/native/driver.js.map +1 -0
- package/dist/backend/native/executable.d.ts +18 -0
- package/dist/backend/native/executable.js +1267 -0
- package/dist/backend/native/executable.js.map +1 -0
- package/dist/backend/native/library.d.ts +2 -0
- package/dist/backend/native/library.js +614 -0
- package/dist/backend/native/library.js.map +1 -0
- package/dist/backend/native/linker-fingerprint.d.ts +8 -0
- package/dist/backend/native/linker-fingerprint.js +174 -0
- package/dist/backend/native/linker-fingerprint.js.map +1 -0
- package/dist/backend/native/object-merge.d.ts +2 -0
- package/dist/backend/native/object-merge.js +154 -0
- package/dist/backend/native/object-merge.js.map +1 -0
- package/dist/backend/native/process.d.ts +17 -0
- package/dist/backend/native/process.js +42 -0
- package/dist/backend/native/process.js.map +1 -0
- package/dist/backend/native/program-shards.d.ts +21 -0
- package/dist/backend/native/program-shards.js +99 -0
- package/dist/backend/native/program-shards.js.map +1 -0
- package/dist/backend/native/runtime-inputs.d.ts +12 -0
- package/dist/backend/native/runtime-inputs.js +163 -0
- package/dist/backend/native/runtime-inputs.js.map +1 -0
- package/dist/backend/native/runtime-inputs.test.d.ts +1 -0
- package/dist/backend/native/runtime-inputs.test.js +64 -0
- package/dist/backend/native/runtime-inputs.test.js.map +1 -0
- package/dist/backend/native/runtime-objects.d.ts +16 -0
- package/dist/backend/native/runtime-objects.js +122 -0
- package/dist/backend/native/runtime-objects.js.map +1 -0
- package/dist/backend/native/session.d.ts +12 -0
- package/dist/backend/native/session.js +31 -0
- package/dist/backend/native/session.js.map +1 -0
- package/dist/backend/native/tool-identity.d.ts +37 -0
- package/dist/backend/native/tool-identity.js +310 -0
- package/dist/backend/native/tool-identity.js.map +1 -0
- package/dist/backend/native/trace-paths.d.ts +12 -0
- package/dist/backend/native/trace-paths.js +73 -0
- package/dist/backend/native/trace-paths.js.map +1 -0
- package/dist/backend/native/vendor.d.ts +1 -0
- package/dist/backend/native/vendor.js +12 -0
- package/dist/backend/native/vendor.js.map +1 -0
- package/dist/backend/native-codegen-core.js +2 -1
- package/dist/backend/native-codegen-core.js.map +1 -1
- package/dist/backend/native-codegen.d.ts +1 -1
- package/dist/backend/native-codegen.js +24 -13
- package/dist/backend/native-codegen.js.map +1 -1
- package/dist/backend/native-codegen.test.js +12 -9
- package/dist/backend/native-codegen.test.js.map +1 -1
- package/dist/backend/native-link-info-core.js +9 -5
- package/dist/backend/native-link-info-core.js.map +1 -1
- package/dist/backend/native-link-info.js +14 -5
- package/dist/backend/native-link-info.js.map +1 -1
- package/dist/backend/native-link-info.test.js +58 -13
- package/dist/backend/native-link-info.test.js.map +1 -1
- package/dist/backend/native-toolchain.d.ts +17 -450
- package/dist/backend/native-toolchain.js +17 -3971
- package/dist/backend/native-toolchain.js.map +1 -1
- package/dist/backend/native-toolchain.test.js +103 -72
- package/dist/backend/native-toolchain.test.js.map +1 -1
- package/dist/backend/native-tools.js +27 -8
- package/dist/backend/native-tools.js.map +1 -1
- package/dist/backend/object-localize.js +17 -14
- package/dist/backend/object-localize.js.map +1 -1
- package/dist/backend/object-localize.test.js +59 -12
- package/dist/backend/object-localize.test.js.map +1 -1
- package/dist/backend/runtime-pack-core.js +96 -49
- package/dist/backend/runtime-pack-core.js.map +1 -1
- package/dist/backend/runtime-pack-native.js +5 -3
- package/dist/backend/runtime-pack-native.js.map +1 -1
- package/dist/backend/runtime-pack-targets.test.js +87 -15
- package/dist/backend/runtime-pack-targets.test.js.map +1 -1
- package/dist/backend/runtime-pack.d.ts +1 -1
- package/dist/backend/runtime-pack.js +11 -12
- package/dist/backend/runtime-pack.js.map +1 -1
- package/dist/backend/runtime-pack.test.js +40 -24
- package/dist/backend/runtime-pack.test.js.map +1 -1
- package/dist/backend/source-locations.js.map +1 -1
- package/dist/backend/source-locations.test.js +7 -2
- package/dist/backend/source-locations.test.js.map +1 -1
- package/dist/backend/target-diagnostics.js +44 -14
- package/dist/backend/target-diagnostics.js.map +1 -1
- package/dist/backend/target-diagnostics.test.js +93 -20
- package/dist/backend/target-diagnostics.test.js.map +1 -1
- package/dist/backend/targets.js +230 -86
- package/dist/backend/targets.js.map +1 -1
- package/dist/backend/targets.test.js +32 -18
- package/dist/backend/targets.test.js.map +1 -1
- package/dist/backend/toolchain-environment.js +5 -1
- package/dist/backend/toolchain-environment.js.map +1 -1
- package/dist/backend/vendor-archives.d.ts +2 -2
- package/dist/backend/vendor-archives.js +84 -35
- package/dist/backend/vendor-archives.js.map +1 -1
- package/dist/backend/vendor-inputs.js +13 -1
- package/dist/backend/vendor-inputs.js.map +1 -1
- package/dist/backend/warm-cache.d.ts +1 -1
- package/dist/backend/warm-cache.js +33 -9
- package/dist/backend/warm-cache.js.map +1 -1
- package/dist/cli/command.js +39 -9
- package/dist/cli/command.js.map +1 -1
- package/dist/cli/output-options.js +14 -4
- package/dist/cli/output-options.js.map +1 -1
- package/dist/cli/paths.js.map +1 -1
- package/dist/cli/wasi-runner.js.map +1 -1
- package/dist/compat/fetch-profile.js +36 -35
- package/dist/compat/fetch-profile.js.map +1 -1
- package/dist/coverage/report.js +16 -17
- package/dist/coverage/report.js.map +1 -1
- package/dist/coverage/surface-manifest.js +112 -26
- package/dist/coverage/surface-manifest.js.map +1 -1
- package/dist/diagnostics/diagnostic.js +55 -16
- package/dist/diagnostics/diagnostic.js.map +1 -1
- package/dist/executable/executable-cache.d.ts +1 -1
- package/dist/executable/executable-cache.js +78 -48
- package/dist/executable/executable-cache.js.map +1 -1
- package/dist/executable/executable-cache.test.js +75 -26
- package/dist/executable/executable-cache.test.js.map +1 -1
- package/dist/executable/prepare.js +2 -2
- package/dist/executable/prepare.js.map +1 -1
- package/dist/ffi/ffi-manifest.js +78 -20
- package/dist/ffi/ffi-manifest.js.map +1 -1
- package/dist/ffi/ffi-manifest.test.js +96 -16
- package/dist/ffi/ffi-manifest.test.js.map +1 -1
- package/dist/format-integer.js.map +1 -1
- package/dist/frontend/analysis.js +12 -2
- package/dist/frontend/analysis.js.map +1 -1
- package/dist/frontend/arguments-usage.js.map +1 -1
- package/dist/frontend/binding-source.js +9 -3
- package/dist/frontend/binding-source.js.map +1 -1
- package/dist/frontend/builtin-modules.js +46 -2
- package/dist/frontend/builtin-modules.js.map +1 -1
- package/dist/frontend/cjs-resolve.js +40 -17
- package/dist/frontend/cjs-resolve.js.map +1 -1
- package/dist/frontend/cjs-syntax.js +31 -10
- package/dist/frontend/cjs-syntax.js.map +1 -1
- package/dist/frontend/comptime-node.test.js +10 -11
- package/dist/frontend/comptime-node.test.js.map +1 -1
- package/dist/frontend/dts-paths.js +7 -3
- package/dist/frontend/dts-paths.js.map +1 -1
- package/dist/frontend/fork-target.js +17 -12
- package/dist/frontend/fork-target.js.map +1 -1
- package/dist/frontend/function-completion.js +11 -6
- package/dist/frontend/function-completion.js.map +1 -1
- package/dist/frontend/helper-tokens.js +53 -6
- package/dist/frontend/helper-tokens.js.map +1 -1
- package/dist/frontend/helper-tokens.test.js +18 -2
- package/dist/frontend/helper-tokens.test.js.map +1 -1
- package/dist/frontend/inferred-js-diagnostics.js +32 -12
- package/dist/frontend/inferred-js-diagnostics.js.map +1 -1
- package/dist/frontend/inferred-js-diagnostics.test.js +11 -15
- package/dist/frontend/inferred-js-diagnostics.test.js.map +1 -1
- package/dist/frontend/input-tracker.js +11 -11
- package/dist/frontend/input-tracker.js.map +1 -1
- package/dist/frontend/input-tracker.test.js +4 -1
- package/dist/frontend/input-tracker.test.js.map +1 -1
- package/dist/frontend/lib-contract.js +38 -9
- package/dist/frontend/lib-contract.js.map +1 -1
- package/dist/frontend/literal-values.js.map +1 -1
- package/dist/frontend/literal-values.test.js +28 -8
- package/dist/frontend/literal-values.test.js.map +1 -1
- package/dist/frontend/lowering/abstract-equality.js +53 -10
- package/dist/frontend/lowering/abstract-equality.js.map +1 -1
- package/dist/frontend/lowering/array-indexed-mutation.d.ts +1 -1
- package/dist/frontend/lowering/array-indexed-mutation.js +108 -106
- package/dist/frontend/lowering/array-indexed-mutation.js.map +1 -1
- package/dist/frontend/lowering/array-values.js +37 -14
- package/dist/frontend/lowering/array-values.js.map +1 -1
- package/dist/frontend/lowering/binding-analysis.d.ts +50 -0
- package/dist/frontend/lowering/binding-analysis.js +376 -0
- package/dist/frontend/lowering/binding-analysis.js.map +1 -0
- package/dist/frontend/lowering/builtin-calls.d.ts +9 -0
- package/dist/frontend/lowering/builtin-calls.js +60 -0
- package/dist/frontend/lowering/builtin-calls.js.map +1 -0
- package/dist/frontend/lowering/builtins/arguments.d.ts +43 -0
- package/dist/frontend/lowering/builtins/arguments.js +247 -0
- package/dist/frontend/lowering/builtins/arguments.js.map +1 -0
- package/dist/frontend/lowering/builtins/async-context.d.ts +52 -0
- package/dist/frontend/lowering/builtins/async-context.js +436 -0
- package/dist/frontend/lowering/builtins/async-context.js.map +1 -0
- package/dist/frontend/lowering/builtins/atomics.d.ts +15 -0
- package/dist/frontend/lowering/builtins/atomics.js +46 -0
- package/dist/frontend/lowering/builtins/atomics.js.map +1 -0
- package/dist/frontend/lowering/builtins/callable-aliases.d.ts +13 -0
- package/dist/frontend/lowering/builtins/callable-aliases.js +87 -0
- package/dist/frontend/lowering/builtins/callable-aliases.js.map +1 -0
- package/dist/frontend/lowering/builtins/child-process-async.d.ts +18 -0
- package/dist/frontend/lowering/builtins/child-process-async.js +245 -0
- package/dist/frontend/lowering/builtins/child-process-async.js.map +1 -0
- package/dist/frontend/lowering/builtins/child-process-methods.d.ts +21 -0
- package/dist/frontend/lowering/builtins/child-process-methods.js +362 -0
- package/dist/frontend/lowering/builtins/child-process-methods.js.map +1 -0
- package/dist/frontend/lowering/builtins/child-process-sync.d.ts +4 -0
- package/dist/frontend/lowering/builtins/child-process-sync.js +639 -0
- package/dist/frontend/lowering/builtins/child-process-sync.js.map +1 -0
- package/dist/frontend/lowering/builtins/child-process.d.ts +55 -0
- package/dist/frontend/lowering/builtins/child-process.js +669 -0
- package/dist/frontend/lowering/builtins/child-process.js.map +1 -0
- package/dist/frontend/lowering/builtins/compression.d.ts +7 -0
- package/dist/frontend/lowering/builtins/compression.js +115 -0
- package/dist/frontend/lowering/builtins/compression.js.map +1 -0
- package/dist/frontend/lowering/builtins/console.d.ts +10 -0
- package/dist/frontend/lowering/builtins/console.js +38 -0
- package/dist/frontend/lowering/builtins/console.js.map +1 -0
- package/dist/frontend/lowering/builtins/constants.d.ts +24 -0
- package/dist/frontend/lowering/builtins/constants.js +141 -0
- package/dist/frontend/lowering/builtins/constants.js.map +1 -0
- package/dist/frontend/lowering/builtins/crypto.d.ts +22 -0
- package/dist/frontend/lowering/builtins/crypto.js +517 -0
- package/dist/frontend/lowering/builtins/crypto.js.map +1 -0
- package/dist/frontend/lowering/builtins/dates.d.ts +7 -0
- package/dist/frontend/lowering/builtins/dates.js +101 -0
- package/dist/frontend/lowering/builtins/dates.js.map +1 -0
- package/dist/frontend/lowering/builtins/environment.d.ts +34 -0
- package/dist/frontend/lowering/builtins/environment.js +95 -0
- package/dist/frontend/lowering/builtins/environment.js.map +1 -0
- package/dist/frontend/lowering/builtins/errors.d.ts +14 -0
- package/dist/frontend/lowering/builtins/errors.js +83 -0
- package/dist/frontend/lowering/builtins/errors.js.map +1 -0
- package/dist/frontend/lowering/builtins/filesystem-calls.d.ts +32 -0
- package/dist/frontend/lowering/builtins/filesystem-calls.js +678 -0
- package/dist/frontend/lowering/builtins/filesystem-calls.js.map +1 -0
- package/dist/frontend/lowering/builtins/filesystem.d.ts +108 -0
- package/dist/frontend/lowering/builtins/filesystem.js +1061 -0
- package/dist/frontend/lowering/builtins/filesystem.js.map +1 -0
- package/dist/frontend/lowering/builtins/ipc.d.ts +8 -0
- package/dist/frontend/lowering/builtins/ipc.js +76 -0
- package/dist/frontend/lowering/builtins/ipc.js.map +1 -0
- package/dist/frontend/lowering/builtins/json.d.ts +12 -0
- package/dist/frontend/lowering/builtins/json.js +387 -0
- package/dist/frontend/lowering/builtins/json.js.map +1 -0
- package/dist/frontend/lowering/builtins/module-bindings.d.ts +85 -0
- package/dist/frontend/lowering/builtins/module-bindings.js +346 -0
- package/dist/frontend/lowering/builtins/module-bindings.js.map +1 -0
- package/dist/frontend/lowering/builtins/module-calls.d.ts +8 -0
- package/dist/frontend/lowering/builtins/module-calls.js +303 -0
- package/dist/frontend/lowering/builtins/module-calls.js.map +1 -0
- package/dist/frontend/lowering/builtins/module-resolution.d.ts +38 -0
- package/dist/frontend/lowering/builtins/module-resolution.js +344 -0
- package/dist/frontend/lowering/builtins/module-resolution.js.map +1 -0
- package/dist/frontend/lowering/builtins/numbers.d.ts +15 -0
- package/dist/frontend/lowering/builtins/numbers.js +124 -0
- package/dist/frontend/lowering/builtins/numbers.js.map +1 -0
- package/dist/frontend/lowering/builtins/operating-system.d.ts +13 -0
- package/dist/frontend/lowering/builtins/operating-system.js +148 -0
- package/dist/frontend/lowering/builtins/operating-system.js.map +1 -0
- package/dist/frontend/lowering/builtins/performance.d.ts +13 -0
- package/dist/frontend/lowering/builtins/performance.js +100 -0
- package/dist/frontend/lowering/builtins/performance.js.map +1 -0
- package/dist/frontend/lowering/builtins/process.d.ts +50 -0
- package/dist/frontend/lowering/builtins/process.js +1138 -0
- package/dist/frontend/lowering/builtins/process.js.map +1 -0
- package/dist/frontend/lowering/builtins/promises.d.ts +14 -0
- package/dist/frontend/lowering/builtins/promises.js +356 -0
- package/dist/frontend/lowering/builtins/promises.js.map +1 -0
- package/dist/frontend/lowering/builtins/properties.d.ts +11 -0
- package/dist/frontend/lowering/builtins/properties.js +186 -0
- package/dist/frontend/lowering/builtins/properties.js.map +1 -0
- package/dist/frontend/lowering/builtins/querystring.d.ts +19 -0
- package/dist/frontend/lowering/builtins/querystring.js +150 -0
- package/dist/frontend/lowering/builtins/querystring.js.map +1 -0
- package/dist/frontend/lowering/builtins/readline.d.ts +13 -0
- package/dist/frontend/lowering/builtins/readline.js +138 -0
- package/dist/frontend/lowering/builtins/readline.js.map +1 -0
- package/dist/frontend/lowering/builtins/receiver-types.d.ts +5 -0
- package/dist/frontend/lowering/builtins/receiver-types.js +15 -0
- package/dist/frontend/lowering/builtins/receiver-types.js.map +1 -0
- package/dist/frontend/lowering/builtins/reflection.d.ts +13 -0
- package/dist/frontend/lowering/builtins/reflection.js +95 -0
- package/dist/frontend/lowering/builtins/reflection.js.map +1 -0
- package/dist/frontend/lowering/builtins/strings.d.ts +14 -0
- package/dist/frontend/lowering/builtins/strings.js +121 -0
- package/dist/frontend/lowering/builtins/strings.js.map +1 -0
- package/dist/frontend/lowering/builtins/text-codecs.d.ts +29 -0
- package/dist/frontend/lowering/builtins/text-codecs.js +590 -0
- package/dist/frontend/lowering/builtins/text-codecs.js.map +1 -0
- package/dist/frontend/lowering/builtins/timers.d.ts +22 -0
- package/dist/frontend/lowering/builtins/timers.js +180 -0
- package/dist/frontend/lowering/builtins/timers.js.map +1 -0
- package/dist/frontend/lowering/builtins/url.d.ts +37 -0
- package/dist/frontend/lowering/builtins/url.js +596 -0
- package/dist/frontend/lowering/builtins/url.js.map +1 -0
- package/dist/frontend/lowering/builtins/util-types.d.ts +7 -0
- package/dist/frontend/lowering/builtins/util-types.js +31 -0
- package/dist/frontend/lowering/builtins/util-types.js.map +1 -0
- package/dist/frontend/lowering/call-arguments.d.ts +72 -0
- package/dist/frontend/lowering/call-arguments.js +618 -0
- package/dist/frontend/lowering/call-arguments.js.map +1 -0
- package/dist/frontend/lowering/call-signatures.d.ts +115 -0
- package/dist/frontend/lowering/call-signatures.js +719 -0
- package/dist/frontend/lowering/call-signatures.js.map +1 -0
- package/dist/frontend/lowering/callback-arg.js.map +1 -1
- package/dist/frontend/lowering/checked-iterable-spread.js +53 -10
- package/dist/frontend/lowering/checked-iterable-spread.js.map +1 -1
- package/dist/frontend/lowering/checked-promise-all.js +41 -9
- package/dist/frontend/lowering/checked-promise-all.js.map +1 -1
- package/dist/frontend/lowering/class-callbacks.d.ts +1 -1
- package/dist/frontend/lowering/class-callbacks.js +130 -27
- package/dist/frontend/lowering/class-callbacks.js.map +1 -1
- package/dist/frontend/lowering/class-construction.d.ts +1 -1
- package/dist/frontend/lowering/class-construction.js +247 -50
- package/dist/frontend/lowering/class-construction.js.map +1 -1
- package/dist/frontend/lowering/class-descriptors.js +109 -29
- package/dist/frontend/lowering/class-descriptors.js.map +1 -1
- package/dist/frontend/lowering/class-dynamic-dispatch.d.ts +6 -1
- package/dist/frontend/lowering/class-dynamic-dispatch.js +2471 -465
- package/dist/frontend/lowering/class-dynamic-dispatch.js.map +1 -1
- package/dist/frontend/lowering/class-dynamic-dispatch.test.js +284 -44
- package/dist/frontend/lowering/class-dynamic-dispatch.test.js.map +1 -1
- package/dist/frontend/lowering/class-instance-constructor.js +17 -5
- package/dist/frontend/lowering/class-instance-constructor.js.map +1 -1
- package/dist/frontend/lowering/class-method-values.js +199 -51
- package/dist/frontend/lowering/class-method-values.js.map +1 -1
- package/dist/frontend/lowering/class-prototypes.js +345 -86
- package/dist/frontend/lowering/class-prototypes.js.map +1 -1
- package/dist/frontend/lowering/class-runtime-statics.d.ts +1 -1
- package/dist/frontend/lowering/class-runtime-statics.js +80 -17
- package/dist/frontend/lowering/class-runtime-statics.js.map +1 -1
- package/dist/frontend/lowering/class-static-data.js +76 -16
- package/dist/frontend/lowering/class-static-data.js.map +1 -1
- package/dist/frontend/lowering/coercions/builders.d.ts +13 -0
- package/dist/frontend/lowering/coercions/builders.js +77 -0
- package/dist/frontend/lowering/coercions/builders.js.map +1 -0
- package/dist/frontend/lowering/coercions/function-adapters.d.ts +58 -0
- package/dist/frontend/lowering/coercions/function-adapters.js +430 -0
- package/dist/frontend/lowering/coercions/function-adapters.js.map +1 -0
- package/dist/frontend/lowering/coercions/island.d.ts +37 -0
- package/dist/frontend/lowering/coercions/island.js +350 -0
- package/dist/frontend/lowering/coercions/island.js.map +1 -0
- package/dist/frontend/lowering/coercions/state.d.ts +14 -0
- package/dist/frontend/lowering/coercions/state.js +16 -0
- package/dist/frontend/lowering/coercions/state.js.map +1 -0
- package/dist/frontend/lowering/coercions/structural-plans.d.ts +40 -0
- package/dist/frontend/lowering/coercions/structural-plans.js +447 -0
- package/dist/frontend/lowering/coercions/structural-plans.js.map +1 -0
- package/dist/frontend/lowering/coercions/structural.d.ts +63 -0
- package/dist/frontend/lowering/coercions/structural.js +616 -0
- package/dist/frontend/lowering/coercions/structural.js.map +1 -0
- package/dist/frontend/lowering/coercions/unions.d.ts +65 -0
- package/dist/frontend/lowering/coercions/unions.js +318 -0
- package/dist/frontend/lowering/coercions/unions.js.map +1 -0
- package/dist/frontend/lowering/collection-ingestion.js +355 -72
- package/dist/frontend/lowering/collection-ingestion.js.map +1 -1
- package/dist/frontend/lowering/containers/array-callbacks.d.ts +92 -0
- package/dist/frontend/lowering/containers/array-callbacks.js +1646 -0
- package/dist/frontend/lowering/containers/array-callbacks.js.map +1 -0
- package/dist/frontend/lowering/containers/array-construction.d.ts +42 -0
- package/dist/frontend/lowering/containers/array-construction.js +1044 -0
- package/dist/frontend/lowering/containers/array-construction.js.map +1 -0
- package/dist/frontend/lowering/containers/array-iteration.d.ts +16 -0
- package/dist/frontend/lowering/containers/array-iteration.js +95 -0
- package/dist/frontend/lowering/containers/array-iteration.js.map +1 -0
- package/dist/frontend/lowering/containers/array-methods.d.ts +27 -0
- package/dist/frontend/lowering/containers/array-methods.js +1854 -0
- package/dist/frontend/lowering/containers/array-methods.js.map +1 -0
- package/dist/frontend/lowering/containers/bytes.d.ts +17 -17
- package/dist/frontend/lowering/containers/bytes.js +419 -105
- package/dist/frontend/lowering/containers/bytes.js.map +1 -1
- package/dist/frontend/lowering/containers/callback-arguments.d.ts +26 -0
- package/dist/frontend/lowering/containers/callback-arguments.js +179 -0
- package/dist/frontend/lowering/containers/callback-arguments.js.map +1 -0
- package/dist/frontend/lowering/containers/collection-grouping.d.ts +19 -0
- package/dist/frontend/lowering/containers/collection-grouping.js +297 -0
- package/dist/frontend/lowering/containers/collection-grouping.js.map +1 -0
- package/dist/frontend/lowering/containers/collection-methods.d.ts +57 -0
- package/dist/frontend/lowering/containers/collection-methods.js +1314 -0
- package/dist/frontend/lowering/containers/collection-methods.js.map +1 -0
- package/dist/frontend/lowering/containers/dynamic-receivers.d.ts +18 -0
- package/dist/frontend/lowering/containers/dynamic-receivers.js +114 -0
- package/dist/frontend/lowering/containers/dynamic-receivers.js.map +1 -0
- package/dist/frontend/lowering/containers/for-of.d.ts +60 -0
- package/dist/frontend/lowering/containers/for-of.js +643 -0
- package/dist/frontend/lowering/containers/for-of.js.map +1 -0
- package/dist/frontend/lowering/containers/indexed-objects.d.ts +132 -0
- package/dist/frontend/lowering/containers/indexed-objects.js +1743 -0
- package/dist/frontend/lowering/containers/indexed-objects.js.map +1 -0
- package/dist/frontend/lowering/containers/iterator-helpers.d.ts +20 -0
- package/dist/frontend/lowering/containers/iterator-helpers.js +809 -0
- package/dist/frontend/lowering/containers/iterator-helpers.js.map +1 -0
- package/dist/frontend/lowering/containers/string-and-regexp.js +580 -158
- package/dist/frontend/lowering/containers/string-and-regexp.js.map +1 -1
- package/dist/frontend/lowering/containers/string-replacement.js +213 -63
- package/dist/frontend/lowering/containers/string-replacement.js.map +1 -1
- package/dist/frontend/lowering/crypto-tables.js +263 -64
- package/dist/frontend/lowering/crypto-tables.js.map +1 -1
- package/dist/frontend/lowering/deferred-module-initializers.js +172 -68
- package/dist/frontend/lowering/deferred-module-initializers.js.map +1 -1
- package/dist/frontend/lowering/deferred-module-initializers.test.js +41 -8
- package/dist/frontend/lowering/deferred-module-initializers.test.js.map +1 -1
- package/dist/frontend/lowering/error-methods.js +339 -65
- package/dist/frontend/lowering/error-methods.js.map +1 -1
- package/dist/frontend/lowering/expressions/evaluation-safety.js +3 -2
- package/dist/frontend/lowering/expressions/evaluation-safety.js.map +1 -1
- package/dist/frontend/lowering/expressions/global-symbols.js +2 -1
- package/dist/frontend/lowering/expressions/global-symbols.js.map +1 -1
- package/dist/frontend/lowering/expressions/native-proxy.js +11 -5
- package/dist/frontend/lowering/expressions/native-proxy.js.map +1 -1
- package/dist/frontend/lowering/expressions/nullish-assignment.js +67 -13
- package/dist/frontend/lowering/expressions/nullish-assignment.js.map +1 -1
- package/dist/frontend/lowering/expressions/object-literals.js +589 -162
- package/dist/frontend/lowering/expressions/object-literals.js.map +1 -1
- package/dist/frontend/lowering/expressions/optional-chains.d.ts +1 -1
- package/dist/frontend/lowering/expressions/optional-chains.js +68 -17
- package/dist/frontend/lowering/expressions/optional-chains.js.map +1 -1
- package/dist/frontend/lowering/expressions/union-field-write.js +45 -18
- package/dist/frontend/lowering/expressions/union-field-write.js.map +1 -1
- package/dist/frontend/lowering/function-context.js +5 -1
- package/dist/frontend/lowering/function-context.js.map +1 -1
- package/dist/frontend/lowering/function-returns.d.ts +67 -0
- package/dist/frontend/lowering/function-returns.js +392 -0
- package/dist/frontend/lowering/function-returns.js.map +1 -0
- package/dist/frontend/lowering/generator-delegation.d.ts +1 -1
- package/dist/frontend/lowering/generator-delegation.js +171 -39
- package/dist/frontend/lowering/generator-delegation.js.map +1 -1
- package/dist/frontend/lowering/generator-dynamic-dispatch.d.ts +1 -1
- package/dist/frontend/lowering/generator-dynamic-dispatch.js +176 -36
- package/dist/frontend/lowering/generator-dynamic-dispatch.js.map +1 -1
- package/dist/frontend/lowering/generic-functions.d.ts +274 -0
- package/dist/frontend/lowering/generic-functions.js +1727 -0
- package/dist/frontend/lowering/generic-functions.js.map +1 -0
- package/dist/frontend/lowering/import-meta.d.ts +1 -1
- package/dist/frontend/lowering/import-meta.js +37 -14
- package/dist/frontend/lowering/import-meta.js.map +1 -1
- package/dist/frontend/lowering/indexed-comparison.js +6 -2
- package/dist/frontend/lowering/indexed-comparison.js.map +1 -1
- package/dist/frontend/lowering/iterator-consumption.d.ts +9 -0
- package/dist/frontend/lowering/iterator-consumption.js +91 -0
- package/dist/frontend/lowering/iterator-consumption.js.map +1 -0
- package/dist/frontend/lowering/lib-boundary.js +40 -17
- package/dist/frontend/lowering/lib-boundary.js.map +1 -1
- package/dist/frontend/lowering/lib-boundary.test.js +49 -11
- package/dist/frontend/lowering/lib-boundary.test.js.map +1 -1
- package/dist/frontend/lowering/lower-array-sort.d.ts +0 -19
- package/dist/frontend/lowering/lower-array-sort.js +331 -566
- package/dist/frontend/lowering/lower-array-sort.js.map +1 -1
- package/dist/frontend/lowering/lower-assert.js +248 -43
- package/dist/frontend/lowering/lower-assert.js.map +1 -1
- package/dist/frontend/lowering/lower-async-iteration.js +71 -16
- package/dist/frontend/lowering/lower-async-iteration.js.map +1 -1
- package/dist/frontend/lowering/lower-builtin-values.js +420 -71
- package/dist/frontend/lowering/lower-builtin-values.js.map +1 -1
- package/dist/frontend/lowering/lower-calls.d.ts +39 -558
- package/dist/frontend/lowering/lower-calls.js +2593 -5667
- package/dist/frontend/lowering/lower-calls.js.map +1 -1
- package/dist/frontend/lowering/lower-classes.d.ts +243 -242
- package/dist/frontend/lowering/lower-classes.js +1701 -724
- package/dist/frontend/lowering/lower-classes.js.map +1 -1
- package/dist/frontend/lowering/lower-comptime.d.ts +35 -35
- package/dist/frontend/lowering/lower-comptime.js +39 -37
- package/dist/frontend/lowering/lower-comptime.js.map +1 -1
- package/dist/frontend/lowering/lower-dgram.js +59 -31
- package/dist/frontend/lowering/lower-dgram.js.map +1 -1
- package/dist/frontend/lowering/lower-enums.js +5 -2
- package/dist/frontend/lowering/lower-enums.js.map +1 -1
- package/dist/frontend/lowering/lower-event-emitter.js +322 -85
- package/dist/frontend/lowering/lower-event-emitter.js.map +1 -1
- package/dist/frontend/lowering/lower-expando.js +19 -7
- package/dist/frontend/lowering/lower-expando.js.map +1 -1
- package/dist/frontend/lowering/lower-exprs.d.ts +194 -194
- package/dist/frontend/lowering/lower-exprs.js +3446 -1154
- package/dist/frontend/lowering/lower-exprs.js.map +1 -1
- package/dist/frontend/lowering/lower-functions.d.ts +23 -0
- package/dist/frontend/lowering/lower-functions.js +449 -0
- package/dist/frontend/lowering/lower-functions.js.map +1 -0
- package/dist/frontend/lowering/lower-generators.js +121 -32
- package/dist/frontend/lowering/lower-generators.js.map +1 -1
- package/dist/frontend/lowering/lower-global-value.js +15 -4
- package/dist/frontend/lowering/lower-global-value.js.map +1 -1
- package/dist/frontend/lowering/lower-inspect.js +479 -89
- package/dist/frontend/lowering/lower-inspect.js.map +1 -1
- package/dist/frontend/lowering/lower-island.d.ts +79 -79
- package/dist/frontend/lowering/lower-island.js +365 -273
- package/dist/frontend/lowering/lower-island.js.map +1 -1
- package/dist/frontend/lowering/lower-island.test.js +7 -2
- package/dist/frontend/lowering/lower-island.test.js.map +1 -1
- package/dist/frontend/lowering/lower-mixins.js +17 -8
- package/dist/frontend/lowering/lower-mixins.js.map +1 -1
- package/dist/frontend/lowering/lower-modules.d.ts +94 -94
- package/dist/frontend/lowering/lower-modules.js +612 -321
- package/dist/frontend/lowering/lower-modules.js.map +1 -1
- package/dist/frontend/lowering/lower-modules.test.js +91 -20
- package/dist/frontend/lowering/lower-modules.test.js.map +1 -1
- package/dist/frontend/lowering/lower-namespaces.js +25 -8
- package/dist/frontend/lowering/lower-namespaces.js.map +1 -1
- package/dist/frontend/lowering/lower-node-module.js +115 -34
- package/dist/frontend/lowering/lower-node-module.js.map +1 -1
- package/dist/frontend/lowering/lower-server.js +1210 -290
- package/dist/frontend/lowering/lower-server.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.d.ts +148 -148
- package/dist/frontend/lowering/lower-stmts.js +2312 -984
- package/dist/frontend/lowering/lower-stmts.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.test.js +13 -5
- package/dist/frontend/lowering/lower-stmts.test.js.map +1 -1
- package/dist/frontend/lowering/lower-stream.js +362 -90
- package/dist/frontend/lowering/lower-stream.js.map +1 -1
- package/dist/frontend/lowering/lower-system-errors.js +30 -8
- package/dist/frontend/lowering/lower-system-errors.js.map +1 -1
- package/dist/frontend/lowering/lower-test.js +40 -13
- package/dist/frontend/lowering/lower-test.js.map +1 -1
- package/dist/frontend/lowering/lower-timers.d.ts +31 -0
- package/dist/frontend/lowering/lower-timers.js +336 -0
- package/dist/frontend/lowering/lower-timers.js.map +1 -0
- package/dist/frontend/lowering/lower-url.d.ts +1 -1
- package/dist/frontend/lowering/lower-url.js +46 -13
- package/dist/frontend/lowering/lower-url.js.map +1 -1
- package/dist/frontend/lowering/lowerer.d.ts +21 -351
- package/dist/frontend/lowering/lowerer.js +1024 -2704
- package/dist/frontend/lowering/lowerer.js.map +1 -1
- package/dist/frontend/lowering/lowerer.test.js +85 -17
- package/dist/frontend/lowering/lowerer.test.js.map +1 -1
- package/dist/frontend/lowering/module-namespace-elements.js +43 -8
- package/dist/frontend/lowering/module-namespace-elements.js.map +1 -1
- package/dist/frontend/lowering/native-ffi.d.ts +21 -1
- package/dist/frontend/lowering/native-ffi.js +487 -18
- package/dist/frontend/lowering/native-ffi.js.map +1 -1
- package/dist/frontend/lowering/object-enumeration-receiver.js +55 -10
- package/dist/frontend/lowering/object-enumeration-receiver.js.map +1 -1
- package/dist/frontend/lowering/object-factory-new.d.ts +1 -1
- package/dist/frontend/lowering/object-factory-new.js +36 -11
- package/dist/frontend/lowering/object-factory-new.js.map +1 -1
- package/dist/frontend/lowering/optional-arguments.js +49 -20
- package/dist/frontend/lowering/optional-arguments.js.map +1 -1
- package/dist/frontend/lowering/pairs-snapshot.js +66 -14
- package/dist/frontend/lowering/pairs-snapshot.js.map +1 -1
- package/dist/frontend/lowering/runtime-optional-locals.js +3 -1
- package/dist/frontend/lowering/runtime-optional-locals.js.map +1 -1
- package/dist/frontend/lowering/runtime-optional-locals.test.js.map +1 -1
- package/dist/frontend/lowering/sanitize-class-types.js +4 -1
- package/dist/frontend/lowering/sanitize-class-types.js.map +1 -1
- package/dist/frontend/lowering/sanitize-class-types.test.js +86 -18
- package/dist/frontend/lowering/sanitize-class-types.test.js.map +1 -1
- package/dist/frontend/lowering/static-this.js +13 -6
- package/dist/frontend/lowering/static-this.js.map +1 -1
- package/dist/frontend/lowering/string-index.js +32 -10
- package/dist/frontend/lowering/string-index.js.map +1 -1
- package/dist/frontend/lowering/surfaces.d.ts +42 -42
- package/dist/frontend/lowering/surfaces.js +1094 -249
- package/dist/frontend/lowering/surfaces.js.map +1 -1
- package/dist/frontend/lowering/symbol-fields.js +40 -15
- package/dist/frontend/lowering/symbol-fields.js.map +1 -1
- package/dist/frontend/lowering/symbol-methods.js.map +1 -1
- package/dist/frontend/lowering/text-decoder-encoding.js +236 -24
- package/dist/frontend/lowering/text-decoder-encoding.js.map +1 -1
- package/dist/frontend/lowering/text-decoder-encoding.test.js +84 -12
- package/dist/frontend/lowering/text-decoder-encoding.test.js.map +1 -1
- package/dist/frontend/lowering/union-narrow.js +59 -16
- package/dist/frontend/lowering/union-narrow.js.map +1 -1
- package/dist/frontend/lowering/union-narrow.test.js +24 -7
- package/dist/frontend/lowering/union-narrow.test.js.map +1 -1
- package/dist/frontend/lowering/union-retag.js +155 -40
- package/dist/frontend/lowering/union-retag.js.map +1 -1
- package/dist/frontend/lowering/union-retag.test.js +131 -33
- package/dist/frontend/lowering/union-retag.test.js.map +1 -1
- package/dist/frontend/lowering/unregistered-class-types.js.map +1 -1
- package/dist/frontend/lowering/unregistered-class-types.test.js +34 -8
- package/dist/frontend/lowering/unregistered-class-types.test.js.map +1 -1
- package/dist/frontend/module-syntax.js +21 -8
- package/dist/frontend/module-syntax.js.map +1 -1
- package/dist/frontend/module-syntax.test.js +37 -13
- package/dist/frontend/module-syntax.test.js.map +1 -1
- package/dist/frontend/npm-fetch-analysis.js +13 -4
- package/dist/frontend/npm-fetch-analysis.js.map +1 -1
- package/dist/frontend/npm-fetch-analysis.test.js +33 -10
- package/dist/frontend/npm-fetch-analysis.test.js.map +1 -1
- package/dist/frontend/npm-fetch-node.js.map +1 -1
- package/dist/frontend/npm-fetch-syntax.js +4 -9
- package/dist/frontend/npm-fetch-syntax.js.map +1 -1
- package/dist/frontend/npm-node.js +3 -1
- package/dist/frontend/npm-node.js.map +1 -1
- package/dist/frontend/npm-static-bundled-cjs.js +88 -29
- package/dist/frontend/npm-static-bundled-cjs.js.map +1 -1
- package/dist/frontend/npm-static-bundled-cjs.test.js +29 -10
- package/dist/frontend/npm-static-bundled-cjs.test.js.map +1 -1
- package/dist/frontend/npm-static-declaration-syntax.js +148 -56
- package/dist/frontend/npm-static-declaration-syntax.js.map +1 -1
- package/dist/frontend/npm-static-declarations.d.ts +1 -1
- package/dist/frontend/npm-static-declarations.js.map +1 -1
- package/dist/frontend/npm-static-declarations.test.js +33 -7
- package/dist/frontend/npm-static-declarations.test.js.map +1 -1
- package/dist/frontend/npm-static-prune.js +26 -12
- package/dist/frontend/npm-static-prune.js.map +1 -1
- package/dist/frontend/npm-static-prune.test.js +17 -3
- package/dist/frontend/npm-static-prune.test.js.map +1 -1
- package/dist/frontend/npm-static-rewrite-host.js +2 -3
- package/dist/frontend/npm-static-rewrite-host.js.map +1 -1
- package/dist/frontend/npm-static-rewrite-syntax.js +64 -21
- package/dist/frontend/npm-static-rewrite-syntax.js.map +1 -1
- package/dist/frontend/npm-static-rewrite.js.map +1 -1
- package/dist/frontend/npm-static-subtyping.js +9 -4
- package/dist/frontend/npm-static-subtyping.js.map +1 -1
- package/dist/frontend/npm-static-subtyping.test.js +30 -6
- package/dist/frontend/npm-static-subtyping.test.js.map +1 -1
- package/dist/frontend/npm-static.js +15 -4
- package/dist/frontend/npm-static.js.map +1 -1
- package/dist/frontend/npm.js +122 -36
- package/dist/frontend/npm.js.map +1 -1
- package/dist/frontend/npm.test.js +30 -10
- package/dist/frontend/npm.test.js.map +1 -1
- package/dist/frontend/pipeline-native.js.map +1 -1
- package/dist/frontend/pipeline.js +25 -8
- package/dist/frontend/pipeline.js.map +1 -1
- package/dist/frontend/pipeline.test.js +21 -7
- package/dist/frontend/pipeline.test.js.map +1 -1
- package/dist/frontend/program-node.js +5 -3
- package/dist/frontend/program-node.js.map +1 -1
- package/dist/frontend/program.d.ts +2 -2
- package/dist/frontend/program.js +234 -101
- package/dist/frontend/program.js.map +1 -1
- package/dist/frontend/program.test.js +27 -27
- package/dist/frontend/program.test.js.map +1 -1
- package/dist/frontend/provenance-core.js +8 -4
- package/dist/frontend/provenance-core.js.map +1 -1
- package/dist/frontend/provenance-registry.js +1 -4
- package/dist/frontend/provenance-registry.js.map +1 -1
- package/dist/frontend/resolve.js +32 -20
- package/dist/frontend/resolve.js.map +1 -1
- package/dist/frontend/resolve.test.js +1 -1
- package/dist/frontend/resolve.test.js.map +1 -1
- package/dist/frontend/runtime-resolve.js +13 -4
- package/dist/frontend/runtime-resolve.js.map +1 -1
- package/dist/frontend/runtime-resolve.test.js +25 -9
- package/dist/frontend/runtime-resolve.test.js.map +1 -1
- package/dist/frontend/services-node.js +6 -2
- package/dist/frontend/services-node.js.map +1 -1
- package/dist/frontend/services-node.test.js +18 -6
- package/dist/frontend/services-node.test.js.map +1 -1
- package/dist/frontend/services.js +8 -4
- package/dist/frontend/services.js.map +1 -1
- package/dist/frontend/services.test.js +6 -2
- package/dist/frontend/services.test.js.map +1 -1
- package/dist/frontend/ts7/api.js +12 -4
- package/dist/frontend/ts7/api.js.map +1 -1
- package/dist/frontend/ts7/ast-bytes.js +10 -3
- package/dist/frontend/ts7/ast-bytes.js.map +1 -1
- package/dist/frontend/ts7/ast-bytes.test.js +23 -4
- package/dist/frontend/ts7/ast-bytes.test.js.map +1 -1
- package/dist/frontend/ts7/ast-guards.test.js +14 -5
- package/dist/frontend/ts7/ast-guards.test.js.map +1 -1
- package/dist/frontend/ts7/ast-node.d.ts +6 -1
- package/dist/frontend/ts7/ast-node.js +484 -164
- package/dist/frontend/ts7/ast-node.js.map +1 -1
- package/dist/frontend/ts7/ast-node.test.js +109 -36
- package/dist/frontend/ts7/ast-node.test.js.map +1 -1
- package/dist/frontend/ts7/ast-text.js +13 -3
- package/dist/frontend/ts7/ast-text.js.map +1 -1
- package/dist/frontend/ts7/ast-text.test.js.map +1 -1
- package/dist/frontend/ts7/ast-types.js.map +1 -1
- package/dist/frontend/ts7/ast-wire.d.ts +1 -1
- package/dist/frontend/ts7/ast-wire.js +55 -20
- package/dist/frontend/ts7/ast-wire.js.map +1 -1
- package/dist/frontend/ts7/ast-wire.test.js +53 -8
- package/dist/frontend/ts7/ast-wire.test.js.map +1 -1
- package/dist/frontend/ts7/ast.js +47 -28
- package/dist/frontend/ts7/ast.js.map +1 -1
- package/dist/frontend/ts7/census-check.js +1 -1
- package/dist/frontend/ts7/census-check.js.map +1 -1
- package/dist/frontend/ts7/checker-cache.js.map +1 -1
- package/dist/frontend/ts7/checker.js +5 -3
- package/dist/frontend/ts7/checker.js.map +1 -1
- package/dist/frontend/ts7/checker.test.js +54 -17
- package/dist/frontend/ts7/checker.test.js.map +1 -1
- package/dist/frontend/ts7/enums.test.js +9 -4
- package/dist/frontend/ts7/enums.test.js.map +1 -1
- package/dist/frontend/ts7/native-api.js.map +1 -1
- package/dist/frontend/ts7/native-host.js.map +1 -1
- package/dist/frontend/ts7/native-process.js +9 -3
- package/dist/frontend/ts7/native-process.js.map +1 -1
- package/dist/frontend/ts7/program-adapter.js +1 -1
- package/dist/frontend/ts7/program-adapter.js.map +1 -1
- package/dist/frontend/ts7/program-host.js +7 -4
- package/dist/frontend/ts7/program-host.js.map +1 -1
- package/dist/frontend/ts7/program-host.test.js +43 -11
- package/dist/frontend/ts7/program-host.test.js.map +1 -1
- package/dist/frontend/ts7/rpc-api.js +3 -1
- package/dist/frontend/ts7/rpc-api.js.map +1 -1
- package/dist/frontend/ts7/rpc-client.js +15 -5
- package/dist/frontend/ts7/rpc-client.js.map +1 -1
- package/dist/frontend/ts7/rpc-client.test.js +26 -8
- package/dist/frontend/ts7/rpc-client.test.js.map +1 -1
- package/dist/frontend/ts7/rpc-filesystem.js.map +1 -1
- package/dist/frontend/ts7/rpc-filesystem.test.js +43 -10
- package/dist/frontend/ts7/rpc-filesystem.test.js.map +1 -1
- package/dist/frontend/ts7/rpc-process.js +16 -6
- package/dist/frontend/ts7/rpc-process.js.map +1 -1
- package/dist/frontend/ts7/rpc-process.test.js.map +1 -1
- package/dist/frontend/ts7/rpc-wire.d.ts +1 -0
- package/dist/frontend/ts7/rpc-wire.js +41 -14
- package/dist/frontend/ts7/rpc-wire.js.map +1 -1
- package/dist/frontend/ts7/rpc-wire.test.js +36 -6
- package/dist/frontend/ts7/rpc-wire.test.js.map +1 -1
- package/dist/frontend/ts7/semantic-checker.js +209 -68
- package/dist/frontend/ts7/semantic-checker.js.map +1 -1
- package/dist/frontend/ts7/semantic-checker.test.js +29 -14
- package/dist/frontend/ts7/semantic-checker.test.js.map +1 -1
- package/dist/frontend/ts7/semantic-json.js +7 -1
- package/dist/frontend/ts7/semantic-json.js.map +1 -1
- package/dist/frontend/ts7/semantic-json.test.js +17 -3
- package/dist/frontend/ts7/semantic-json.test.js.map +1 -1
- package/dist/frontend/ts7/semantic-model.js +147 -51
- package/dist/frontend/ts7/semantic-model.js.map +1 -1
- package/dist/frontend/ts7/semantic-model.test.js +72 -19
- package/dist/frontend/ts7/semantic-model.test.js.map +1 -1
- package/dist/frontend/ts7/semantic-types.d.ts +2 -2
- package/dist/frontend/ts7/session-cache.js +10 -3
- package/dist/frontend/ts7/session-cache.js.map +1 -1
- package/dist/frontend/ts7/session-cache.test.js +13 -4
- package/dist/frontend/ts7/session-cache.test.js.map +1 -1
- package/dist/frontend/ts7/session-path.js +25 -10
- package/dist/frontend/ts7/session-path.js.map +1 -1
- package/dist/frontend/ts7/session-path.test.js +47 -4
- package/dist/frontend/ts7/session-path.test.js.map +1 -1
- package/dist/frontend/ts7/session-timing.js +22 -3
- package/dist/frontend/ts7/session-timing.js.map +1 -1
- package/dist/frontend/ts7/session-timing.test.js +12 -3
- package/dist/frontend/ts7/session-timing.test.js.map +1 -1
- package/dist/frontend/ts7/session.d.ts +1 -0
- package/dist/frontend/ts7/session.js +109 -35
- package/dist/frontend/ts7/session.js.map +1 -1
- package/dist/frontend/ts7/session.test.js +69 -15
- package/dist/frontend/ts7/session.test.js.map +1 -1
- package/dist/frontend/ts7/source-parser.js +17 -6
- package/dist/frontend/ts7/source-parser.js.map +1 -1
- package/dist/frontend/ts7/source-parser.test.js +32 -9
- package/dist/frontend/ts7/source-parser.test.js.map +1 -1
- package/dist/frontend/tsc-codes.js +56 -11
- package/dist/frontend/tsc-codes.js.map +1 -1
- package/dist/frontend/tsc-codes.test.d.ts +1 -0
- package/dist/frontend/tsc-codes.test.js +16 -0
- package/dist/frontend/tsc-codes.test.js.map +1 -0
- package/dist/frontend/type-mapper.js +545 -204
- package/dist/frontend/type-mapper.js.map +1 -1
- package/dist/frontend/type-mapper.test.js +108 -33
- package/dist/frontend/type-mapper.test.js.map +1 -1
- package/dist/frontend/union-discriminants.js +8 -2
- package/dist/frontend/union-discriminants.js.map +1 -1
- package/dist/frontend/union-discriminants.test.js +77 -20
- package/dist/frontend/union-discriminants.test.js.map +1 -1
- package/dist/index.d.ts +9 -8
- package/dist/index.js +150 -81
- package/dist/index.js.map +1 -1
- package/dist/ir/analysis.js +95 -38
- package/dist/ir/analysis.js.map +1 -1
- package/dist/ir/analysis.test.js +91 -15
- package/dist/ir/analysis.test.js.map +1 -1
- package/dist/ir/api.d.ts +4 -0
- package/dist/ir/api.js +6 -0
- package/dist/ir/api.js.map +1 -0
- package/dist/ir/build.d.ts +7 -0
- package/dist/ir/build.js +27 -1
- package/dist/ir/build.js.map +1 -1
- package/dist/ir/builtin-effects.d.ts +9 -0
- package/dist/ir/builtin-effects.js +631 -0
- package/dist/ir/builtin-effects.js.map +1 -0
- package/dist/ir/builtin-signatures.d.ts +15 -0
- package/dist/ir/builtin-signatures.js +3396 -0
- package/dist/ir/builtin-signatures.js.map +1 -0
- package/dist/ir/byte-numbers.js +67 -16
- package/dist/ir/byte-numbers.js.map +1 -1
- package/dist/ir/byte-numbers.test.js +17 -4
- package/dist/ir/byte-numbers.test.js.map +1 -1
- package/dist/ir/constant-tables.js +13 -5
- package/dist/ir/constant-tables.js.map +1 -1
- package/dist/ir/constant-tables.test.js +47 -7
- package/dist/ir/constant-tables.test.js.map +1 -1
- package/dist/ir/control-flow.js +2 -1
- package/dist/ir/control-flow.js.map +1 -1
- package/dist/ir/control-flow.test.js +35 -11
- package/dist/ir/control-flow.test.js.map +1 -1
- package/dist/ir/initializer-bindings.d.ts +9 -0
- package/dist/ir/initializer-bindings.js +115 -0
- package/dist/ir/initializer-bindings.js.map +1 -0
- package/dist/ir/initializer-bindings.test.d.ts +1 -0
- package/dist/ir/initializer-bindings.test.js +118 -0
- package/dist/ir/initializer-bindings.test.js.map +1 -0
- package/dist/ir/integer-loop-facts.d.ts +12 -0
- package/dist/ir/integer-loop-facts.js +137 -0
- package/dist/ir/integer-loop-facts.js.map +1 -0
- package/dist/ir/integer-loops.js +85 -30
- package/dist/ir/integer-loops.js.map +1 -1
- package/dist/ir/integer-loops.test.js +76 -13
- package/dist/ir/integer-loops.test.js.map +1 -1
- package/dist/ir/integer-ranges.js +93 -21
- package/dist/ir/integer-ranges.js.map +1 -1
- package/dist/ir/integer-ranges.test.js +199 -21
- package/dist/ir/integer-ranges.test.js.map +1 -1
- package/dist/ir/intrinsic-signatures.d.ts +20 -0
- package/dist/ir/intrinsic-signatures.js +57 -0
- package/dist/ir/intrinsic-signatures.js.map +1 -0
- package/dist/ir/ir.d.ts +6 -2150
- package/dist/ir/ir.js +160 -1396
- package/dist/ir/ir.js.map +1 -1
- package/dist/ir/ir.test.js +98 -77
- package/dist/ir/ir.test.js.map +1 -1
- package/dist/ir/runtime-features.d.ts +221 -0
- package/dist/ir/runtime-features.js +551 -0
- package/dist/ir/runtime-features.js.map +1 -0
- package/dist/ir/runtime-features.test.d.ts +1 -0
- package/dist/ir/runtime-features.test.js +98 -0
- package/dist/ir/runtime-features.test.js.map +1 -0
- package/dist/ir/scalar-records.js +130 -40
- package/dist/ir/scalar-records.js.map +1 -1
- package/dist/ir/scalar-records.test.js +146 -27
- package/dist/ir/scalar-records.test.js.map +1 -1
- package/dist/ir/serialize.js +4 -2
- package/dist/ir/serialize.js.map +1 -1
- package/dist/ir/serialize.test.js +44 -9
- package/dist/ir/serialize.test.js.map +1 -1
- package/dist/ir/traverse.js +156 -43
- package/dist/ir/traverse.js.map +1 -1
- package/dist/ir/traverse.test.js +99 -24
- package/dist/ir/traverse.test.js.map +1 -1
- package/dist/ir/validate.d.ts +1 -31
- package/dist/ir/validate.js +782 -1889
- package/dist/ir/validate.js.map +1 -1
- package/dist/ir/validate.test.js +610 -114
- package/dist/ir/validate.test.js.map +1 -1
- package/dist/library/cache-primitives.js +9 -10
- package/dist/library/cache-primitives.js.map +1 -1
- package/dist/library/cache-reset.test.js +2 -1
- package/dist/library/cache-reset.test.js.map +1 -1
- package/dist/library/compiler-self-identity.js +11 -5
- package/dist/library/compiler-self-identity.js.map +1 -1
- package/dist/library/compiler-self-identity.test.js +10 -3
- package/dist/library/compiler-self-identity.test.js.map +1 -1
- package/dist/library/fence-eval.js +24 -7
- package/dist/library/fence-eval.js.map +1 -1
- package/dist/library/fence-eval.test.js +31 -7
- package/dist/library/fence-eval.test.js.map +1 -1
- package/dist/library/int-infer.js +199 -59
- package/dist/library/int-infer.js.map +1 -1
- package/dist/library/int-infer.test.js +133 -57
- package/dist/library/int-infer.test.js.map +1 -1
- package/dist/library/ir-policy.d.ts +27 -0
- package/dist/library/ir-policy.js +232 -0
- package/dist/library/ir-policy.js.map +1 -0
- package/dist/library/library-cache.js +40 -17
- package/dist/library/library-cache.js.map +1 -1
- package/dist/library/library-cache.test.js +24 -13
- package/dist/library/library-cache.test.js.map +1 -1
- package/dist/library/library-profile.js +68 -13
- package/dist/library/library-profile.js.map +1 -1
- package/dist/library/prepare.js +48 -20
- package/dist/library/prepare.js.map +1 -1
- package/dist/library/semantic-source.js +16 -14
- package/dist/library/semantic-source.js.map +1 -1
- package/dist/library/semantic-source.test.js +9 -14
- package/dist/library/semantic-source.test.js.map +1 -1
- package/dist/library/sidecar-validate.js +53 -12
- package/dist/library/sidecar-validate.js.map +1 -1
- package/dist/library/sidecar.js +85 -24
- package/dist/library/sidecar.js.map +1 -1
- package/dist/library/trap-teaching.js +11 -2
- package/dist/library/trap-teaching.js.map +1 -1
- package/dist/native/cache.js +10 -4
- package/dist/native/cache.js.map +1 -1
- package/dist/native/cli.js +34 -9
- package/dist/native/cli.js.map +1 -1
- package/dist/native/compiler.js +167 -43
- package/dist/native/compiler.js.map +1 -1
- package/dist/native/compiler.test.js +129 -32
- package/dist/native/compiler.test.js.map +1 -1
- package/dist/native/comptime.js +23 -7
- package/dist/native/comptime.js.map +1 -1
- package/dist/native/comptime.test.js +26 -6
- package/dist/native/comptime.test.js.map +1 -1
- package/dist/native/executable-cache.js +77 -27
- package/dist/native/executable-cache.js.map +1 -1
- package/dist/native/executable-cache.test.js +41 -6
- package/dist/native/executable-cache.test.js.map +1 -1
- package/dist/native/file-identity.js +9 -2
- package/dist/native/file-identity.js.map +1 -1
- package/dist/native/file-identity.test.js.map +1 -1
- package/dist/native/library.js +50 -12
- package/dist/native/library.js.map +1 -1
- package/dist/native/prepare.js +119 -34
- package/dist/native/prepare.js.map +1 -1
- package/dist/native/prepare.test.js +22 -6
- package/dist/native/prepare.test.js.map +1 -1
- package/dist/native/runtime-typescript.js +24 -11
- package/dist/native/runtime-typescript.js.map +1 -1
- package/dist/native/runtime-typescript.test.js.map +1 -1
- package/dist/native/sanitizer.js +71 -18
- package/dist/native/sanitizer.js.map +1 -1
- package/dist/native/sanitizer.test.js +77 -20
- package/dist/native/sanitizer.test.js.map +1 -1
- package/dist/native/task.js.map +1 -1
- package/dist/native/task.test.js +7 -2
- package/dist/native/task.test.js.map +1 -1
- package/dist/native/toolchain.js +68 -26
- package/dist/native/toolchain.js.map +1 -1
- package/dist/native/toolchain.test.js +59 -20
- package/dist/native/toolchain.test.js.map +1 -1
- package/dist/startup-cache.d.ts +1 -1
- package/dist/startup-cache.js +1 -1
- package/dist/startup-cache.js.map +1 -1
- package/dist/timing.js.map +1 -1
- package/package.json +20 -20
- package/surface-manifest.json +1 -1
- package/dist/frontend/lowering/lower-builtins.d.ts +0 -601
- package/dist/frontend/lowering/lower-builtins.js +0 -8986
- package/dist/frontend/lowering/lower-builtins.js.map +0 -1
- package/dist/frontend/lowering/lower-containers.d.ts +0 -382
- package/dist/frontend/lowering/lower-containers.js +0 -7344
- package/dist/frontend/lowering/lower-containers.js.map +0 -1
package/dist/ir/validate.js
CHANGED
|
@@ -4,1588 +4,12 @@
|
|
|
4
4
|
* an ICE that points at source is a gift to whoever debugs it.
|
|
5
5
|
*/
|
|
6
6
|
import { validByteNumberToken } from "./byte-numbers.js";
|
|
7
|
-
import { arrayOf, BYTES_ELEMENT_NAME, BOOL, BYTES_U8, bytesOf, canAdaptDynFuncTo, canDynCheckTo, canConvertToDyn, canExitIslandToType, canMarshalIntoIsland, canMarshalTypedFuncIntoIsland,
|
|
8
|
-
import {
|
|
7
|
+
import { arrayOf, BYTES_ELEMENT_NAME, BOOL, BYTES_U8, bytesOf, canAdaptDynFuncTo, canDynCheckTo, canConvertToDyn, canExitIslandToType, canMarshalIntoIsland, canMarshalTypedFuncIntoIsland, DYN, DYN_HANDLE_KINDS, F64, ffiClassType, ffiSourceParamTypes, islandPromisePayloadTag, isDynTypedRefType, isFfiCallbackParam, isFfiContextParam, isFfiReleaseParam, isJsonSafeType, isJsonStringifySafeType, isRefCounted, isSupportedArrayElem, isSupportedIndexValue, isSupportedMapKey, isSupportedMapValue, isSupportedSetElem, isUnitType, jsOpResultKind, JSVAL, REF_TRUTHY_KINDS, RUNTIME_EMITTER_CLASS, RUNTIME_ERROR_CLASSES, RUNTIME_STREAM_CLASSES, shapeHasAccessorSlots, STRING, typeEquals, typeKey, unionContainerArmsOk, VOID, } from "./ir.js";
|
|
8
|
+
import { DYN_CLASS_PROPERTIES } from "./ir.js";
|
|
9
9
|
import { unionWideningTags } from "./analysis.js";
|
|
10
10
|
import { alwaysReturns } from "./control-flow.js";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* from the end (backends fill the documented defaults). Exported for the
|
|
14
|
-
* frontend's lib-boundary pass (lib-boundary.ts), which coerces or fences
|
|
15
|
-
* checked-dynamic arguments against the same table the validator enforces. */
|
|
16
|
-
export const STR_INTRINSIC_SIGS = {
|
|
17
|
-
length: { argTypes: [], minArgs: 0, result: F64 },
|
|
18
|
-
charCodeAt: { argTypes: [F64], minArgs: 1, result: F64 },
|
|
19
|
-
charAt: { argTypes: [F64], minArgs: 1, result: STRING },
|
|
20
|
-
indexOf: { argTypes: [STRING, F64], minArgs: 1, result: F64 },
|
|
21
|
-
includes: { argTypes: [STRING, F64], minArgs: 1, result: BOOL },
|
|
22
|
-
startsWith: { argTypes: [STRING, F64], minArgs: 1, result: BOOL },
|
|
23
|
-
endsWith: { argTypes: [STRING, F64], minArgs: 1, result: BOOL },
|
|
24
|
-
slice: { argTypes: [F64, F64], minArgs: 0, result: STRING },
|
|
25
|
-
substring: { argTypes: [F64, F64], minArgs: 1, result: STRING },
|
|
26
|
-
repeat: { argTypes: [F64], minArgs: 1, result: STRING },
|
|
27
|
-
trim: { argTypes: [], minArgs: 0, result: STRING },
|
|
28
|
-
trimStart: { argTypes: [], minArgs: 0, result: STRING },
|
|
29
|
-
trimEnd: { argTypes: [], minArgs: 0, result: STRING },
|
|
30
|
-
split: { argTypes: [STRING, F64], minArgs: 2, result: arrayOf(STRING) },
|
|
31
|
-
padStart: { argTypes: [F64, STRING], minArgs: 2, result: STRING },
|
|
32
|
-
padEnd: { argTypes: [F64, STRING], minArgs: 2, result: STRING },
|
|
33
|
-
toLowerCase: { argTypes: [], minArgs: 0, result: STRING },
|
|
34
|
-
toUpperCase: { argTypes: [], minArgs: 0, result: STRING },
|
|
35
|
-
normalize: { argTypes: [STRING], minArgs: 1, result: STRING },
|
|
36
|
-
isWellFormed: { argTypes: [], minArgs: 0, result: BOOL },
|
|
37
|
-
toWellFormed: { argTypes: [], minArgs: 0, result: STRING },
|
|
38
|
-
cpAt: { argTypes: [F64], minArgs: 1, result: STRING },
|
|
39
|
-
};
|
|
40
|
-
/** Per-method signature for regexIntrinsic. test/source/flags take the
|
|
41
|
-
* regex as receiver; replace/replaceAll/split take the STRING as receiver
|
|
42
|
-
* with the regex as args[0] (mirroring the source syntax). All positions
|
|
43
|
-
* are required — the surface has no optionals. */
|
|
44
|
-
export const REGEX_INTRINSIC_SIGS = {
|
|
45
|
-
test: { receiver: REGEX, argTypes: [STRING], result: BOOL },
|
|
46
|
-
// match's result is the program-dependent `string[] | null` union —
|
|
47
|
-
// VOID here is the process.envGet sentinel; the regexIntrinsic case
|
|
48
|
-
// checks the union's arms.
|
|
49
|
-
match: { receiver: STRING, argTypes: [REGEX], result: VOID },
|
|
50
|
-
exec: { receiver: STRING, argTypes: [REGEX], result: VOID },
|
|
51
|
-
lastIndex: { receiver: REGEX, argTypes: [], result: F64 },
|
|
52
|
-
matchAll: { receiver: STRING, argTypes: [REGEX], result: arrayOf(arrayOf(STRING)) },
|
|
53
|
-
matchAllInto: { receiver: STRING, argTypes: [REGEX, arrayOf(F64)], result: arrayOf(arrayOf(STRING)) },
|
|
54
|
-
search: { receiver: STRING, argTypes: [REGEX], result: F64 },
|
|
55
|
-
source: { receiver: REGEX, argTypes: [], result: STRING },
|
|
56
|
-
flags: { receiver: REGEX, argTypes: [], result: STRING },
|
|
57
|
-
toString: { receiver: REGEX, argTypes: [], result: STRING },
|
|
58
|
-
replace: { receiver: STRING, argTypes: [REGEX, STRING], result: STRING },
|
|
59
|
-
replaceAll: { receiver: STRING, argTypes: [REGEX, STRING], result: STRING },
|
|
60
|
-
split: { receiver: STRING, argTypes: [REGEX, F64], result: arrayOf(STRING) },
|
|
61
|
-
};
|
|
62
|
-
/** Closed-union signature table for `libCall` (mirrors ambient/scriptc.d.ts).
|
|
63
|
-
* All argument positions are required — the surface has no optionals.
|
|
64
|
-
* readFileSync's second argument is the (always-"utf8") encoding: it is
|
|
65
|
-
* evaluated for JS-exact side-effect order and ignored by the runtime.
|
|
66
|
-
* A `null` argument slot is program-dependent (a builtin-error receiver) —
|
|
67
|
-
* the libCall case checks it specially, like process.envGet's result.
|
|
68
|
-
* Exported for the frontend's lib-boundary pass (lib-boundary.ts). */
|
|
69
|
-
export const LIB_FN_SIGS = {
|
|
70
|
-
"fetch.start": { argTypes: [STRING, DYN], result: { kind: "promise", inner: DYN } },
|
|
71
|
-
"fetch.responseNew": { argTypes: [DYN, DYN], result: DYN },
|
|
72
|
-
"fetch.input": { argTypes: [DYN, DYN], result: { kind: "promise", inner: DYN } },
|
|
73
|
-
"abort.controllerNew": { argTypes: [], result: DYN },
|
|
74
|
-
"abort.timeout": { argTypes: [DYN], result: DYN },
|
|
75
|
-
"abort.now": { argTypes: [DYN], result: DYN },
|
|
76
|
-
"abort.any": { argTypes: [DYN], result: DYN },
|
|
77
|
-
"fetch.function": { argTypes: [], result: DYN },
|
|
78
|
-
"fetch.requestNew": { argTypes: [DYN, DYN], result: DYN },
|
|
79
|
-
"fetch.headersNew": { argTypes: [DYN], result: DYN },
|
|
80
|
-
"fetch.responseArrayBuffer": { argTypes: [DYN], result: { kind: "promise", inner: DYN } },
|
|
81
|
-
"fetch.responseJson": { argTypes: [DYN], result: { kind: "promise", inner: DYN } },
|
|
82
|
-
"fetch.responseText": { argTypes: [DYN], result: { kind: "promise", inner: STRING } },
|
|
83
|
-
"fetch.responseBytes": { argTypes: [DYN], result: { kind: "promise", inner: BYTES_U8 } },
|
|
84
|
-
"fetch.abortControllerNew": { argTypes: [], result: DYN },
|
|
85
|
-
"fetch.abortTimeout": { argTypes: [DYN], result: DYN },
|
|
86
|
-
"fetch.abortNow": { argTypes: [DYN], result: DYN },
|
|
87
|
-
"fetch.abortAny": { argTypes: [DYN], result: DYN },
|
|
88
|
-
"fetch.streamNew": { argTypes: [DYN], result: DYN },
|
|
89
|
-
// Program-dependent iterable: typed arrays/bytes/string stay intact so
|
|
90
|
-
// the native stream can pull lazily; checked-dynamic values are the
|
|
91
|
-
// fallback. The libCall validator below checks the closed set.
|
|
92
|
-
"fetch.webIs": { argTypes: [DYN, STRING], result: BOOL },
|
|
93
|
-
"fetch.streamIs": { argTypes: [DYN], result: BOOL },
|
|
94
|
-
"fetch.streamFrom": { argTypes: [null], result: DYN },
|
|
95
|
-
// The chunk/result record depends on ReadableStream<T>; validated below.
|
|
96
|
-
"fetch.readerRead": { argTypes: [DYN], result: VOID },
|
|
97
|
-
"island.eval": { argTypes: [STRING], result: STRING },
|
|
98
|
-
"island.import": { argTypes: [STRING, STRING, STRING], result: JSVAL },
|
|
99
|
-
"island.importDyn": { argTypes: [STRING], result: JSVAL },
|
|
100
|
-
// Result is the cast's mapped PROMISE target (program-dependent) —
|
|
101
|
-
// checked in the libCall case, like error.new.
|
|
102
|
-
"island.castFail": { argTypes: [JSVAL, STRING], result: VOID },
|
|
103
|
-
"json.parse": { argTypes: [STRING], result: DYN },
|
|
104
|
-
"json.parseReviver": { argTypes: [STRING, DYN], result: DYN },
|
|
105
|
-
"json.stringifyReplacer": { argTypes: [DYN, DYN, STRING], result: DYN },
|
|
106
|
-
"json.stringifyValue": { argTypes: [DYN, DYN, DYN], result: DYN },
|
|
107
|
-
"dyn.keySet": { argTypes: [DYN, STRING, DYN], result: VOID },
|
|
108
|
-
"dyn.keySetComputed": { argTypes: [DYN, DYN, DYN], result: VOID },
|
|
109
|
-
"dyn.keyDelete": { argTypes: [DYN, STRING, BOOL], result: VOID },
|
|
110
|
-
"dyn.keyDeleteComputed": { argTypes: [DYN, DYN, BOOL], result: VOID },
|
|
111
|
-
"dyn.hasKeyComputed": { argTypes: [DYN, DYN], result: BOOL },
|
|
112
|
-
"dyn.hasOwnComputed": { argTypes: [DYN, DYN], result: BOOL },
|
|
113
|
-
"dyn.propertyIsEnumerableComputed": { argTypes: [DYN, DYN], result: BOOL },
|
|
114
|
-
"dyn.globalSymbolGet": { argTypes: [SYMBOL_T], result: DYN },
|
|
115
|
-
"dyn.globalSymbolSet": { argTypes: [SYMBOL_T, DYN], result: VOID },
|
|
116
|
-
"dyn.globalSymbolHas": { argTypes: [SYMBOL_T], result: BOOL },
|
|
117
|
-
"dyn.globalSymbolDelete": { argTypes: [SYMBOL_T], result: VOID },
|
|
118
|
-
"dyn.typedRefIs": { argTypes: [DYN, STRING], result: BOOL },
|
|
119
|
-
"dyn.classIs": { argTypes: [DYN, STRING], result: BOOL },
|
|
120
|
-
"dyn.iterPack": { argTypes: [DYN, STRING], result: DYN },
|
|
121
|
-
"dyn.arrayFromIterator": { argTypes: [DYN], result: DYN },
|
|
122
|
-
"dyn.iterator": { argTypes: [DYN, STRING], result: DYN },
|
|
123
|
-
"dyn.iteratorResult": { argTypes: [DYN], result: DYN },
|
|
124
|
-
"dyn.mapSeedEntries": { argTypes: [DYN], result: DYN },
|
|
125
|
-
"dyn.mapSeedEntry": { argTypes: [DYN], result: DYN },
|
|
126
|
-
"dyn.arrLen": { argTypes: [DYN], result: F64 },
|
|
127
|
-
"dyn.arrAt": { argTypes: [DYN, F64], result: DYN },
|
|
128
|
-
"dyn.hasKey": { argTypes: [DYN, STRING], result: BOOL },
|
|
129
|
-
"dyn.freeze": { argTypes: [DYN], result: DYN },
|
|
130
|
-
"dyn.isFrozen": { argTypes: [DYN], result: BOOL },
|
|
131
|
-
"dyn.nativeSetNew": { argTypes: [DYN], result: DYN },
|
|
132
|
-
"dyn.nativeSetIs": { argTypes: [DYN], result: BOOL },
|
|
133
|
-
"dyn.nativeMapIs": { argTypes: [DYN], result: BOOL },
|
|
134
|
-
"dyn.nativeUrlIs": { argTypes: [DYN], result: BOOL },
|
|
135
|
-
"dyn.nativeDateIs": { argTypes: [DYN], result: BOOL },
|
|
136
|
-
"date.nativeNew": { argTypes: [DYN], result: DYN },
|
|
137
|
-
"date.checkedValue": { argTypes: [DYN], result: DATE_T },
|
|
138
|
-
"dyn.nativeRegexIs": { argTypes: [DYN], result: BOOL },
|
|
139
|
-
"dyn.toString": { argTypes: [DYN, DYN, STRING], result: STRING },
|
|
140
|
-
"dyn.defineProps": { argTypes: [DYN, DYN], result: DYN },
|
|
141
|
-
"dyn.defineProperty": { argTypes: [DYN, DYN, DYN], result: DYN },
|
|
142
|
-
"dyn.getOwnPropertyDescriptor": { argTypes: [DYN, DYN], result: DYN },
|
|
143
|
-
"dyn.arrayProtoCall": { argTypes: [DYN, STRING, DYN], result: DYN },
|
|
144
|
-
"dyn.promiseAll": { argTypes: [DYN], result: { kind: "promise", inner: DYN } },
|
|
145
|
-
"dyn.typeof": { argTypes: [DYN], result: STRING },
|
|
146
|
-
"dyn.objectTag": { argTypes: [DYN], result: STRING },
|
|
147
|
-
"module.registryInit": { argTypes: [F64], result: VOID },
|
|
148
|
-
"module.define": { argTypes: [F64, STRING, STRING, STRING, arrayOf(STRING), BOOL], result: VOID },
|
|
149
|
-
"module.enter": { argTypes: [F64], result: VOID },
|
|
150
|
-
"module.link": { argTypes: [F64, F64], result: VOID },
|
|
151
|
-
"module.finish": { argTypes: [F64], result: VOID },
|
|
152
|
-
"module.fail": { argTypes: [F64], result: VOID },
|
|
153
|
-
"module.filename": { argTypes: [F64], result: STRING },
|
|
154
|
-
"module.id": { argTypes: [F64], result: STRING },
|
|
155
|
-
"module.path": { argTypes: [F64], result: STRING },
|
|
156
|
-
"module.paths": { argTypes: [F64], result: arrayOf(STRING) },
|
|
157
|
-
"module.children": { argTypes: [F64], result: arrayOf(F64) },
|
|
158
|
-
"module.parent": { argTypes: [F64], result: F64 },
|
|
159
|
-
"module.loaded": { argTypes: [F64], result: BOOL },
|
|
160
|
-
"module.cacheGet": { argTypes: [STRING], result: F64 },
|
|
161
|
-
"module.cacheHas": { argTypes: [STRING], result: BOOL },
|
|
162
|
-
"module.cacheKeys": { argTypes: [], result: arrayOf(STRING) },
|
|
163
|
-
"timers.setTimeout": { argTypes: [{ kind: "func", params: [], ret: VOID }, F64], result: VOID },
|
|
164
|
-
"timers.setInterval": { argTypes: [{ kind: "func", params: [], ret: VOID }, F64], result: F64 },
|
|
165
|
-
"timers.clearInterval": { argTypes: [F64], result: VOID },
|
|
166
|
-
"timers.setTimeoutHandle": { argTypes: [{ kind: "func", params: [], ret: VOID }, F64], result: F64 },
|
|
167
|
-
"timers.clearTimeout": { argTypes: [F64], result: VOID },
|
|
168
|
-
"timers.unref": { argTypes: [F64], result: F64 },
|
|
169
|
-
"timers.ref": { argTypes: [F64], result: F64 },
|
|
170
|
-
"timers.hasRef": { argTypes: [F64], result: BOOL },
|
|
171
|
-
"timers.refresh": { argTypes: [F64], result: F64 },
|
|
172
|
-
"timers.setImmediate": { argTypes: [{ kind: "func", params: [], ret: VOID }], result: F64 },
|
|
173
|
-
"timers.queueMicrotask": { argTypes: [{ kind: "func", params: [], ret: VOID }], result: VOID },
|
|
174
|
-
"timers.queueMicrotaskDyn": { argTypes: [DYN], result: VOID },
|
|
175
|
-
"timers.clearImmediate": { argTypes: [F64], result: VOID },
|
|
176
|
-
"process.nextTick": { argTypes: [{ kind: "func", params: [], ret: VOID }], result: VOID },
|
|
177
|
-
"process.uptime": { argTypes: [], result: F64 },
|
|
178
|
-
"perf.now": { argTypes: [], result: F64 },
|
|
179
|
-
"process.availableMemory": { argTypes: [], result: F64 },
|
|
180
|
-
"process.constrainedMemory": { argTypes: [], result: F64 },
|
|
181
|
-
"process.cpuUser": { argTypes: [], result: F64 },
|
|
182
|
-
"process.cpuSystem": { argTypes: [], result: F64 },
|
|
183
|
-
"process.cpuUserDiff": { argTypes: [F64], result: F64 },
|
|
184
|
-
"process.cpuSystemDiff": { argTypes: [F64], result: F64 },
|
|
185
|
-
"process.threadCpuUser": { argTypes: [], result: F64 },
|
|
186
|
-
"process.threadCpuSystem": { argTypes: [], result: F64 },
|
|
187
|
-
"process.threadCpuUserDiff": { argTypes: [F64], result: F64 },
|
|
188
|
-
"process.threadCpuSystemDiff": { argTypes: [F64], result: F64 },
|
|
189
|
-
"process.cpuPrevValidate": { argTypes: [F64, F64], result: VOID },
|
|
190
|
-
"process.rusage": { argTypes: [F64], result: F64 },
|
|
191
|
-
"process.activeResources": { argTypes: [], result: arrayOf(STRING) },
|
|
192
|
-
"timers.immediateUnref": { argTypes: [F64], result: F64 },
|
|
193
|
-
"timers.immediateRef": { argTypes: [F64], result: F64 },
|
|
194
|
-
"timers.immediateHasRef": { argTypes: [F64], result: BOOL },
|
|
195
|
-
"timers.clearNoop": { argTypes: [], result: VOID },
|
|
196
|
-
// Signal listeners are zero-param (the ambient shape); exit/stdin
|
|
197
|
-
// callbacks carry program-dependent one-param shapes — null slots, the
|
|
198
|
-
// libCall case checks them (child.onExit precedent).
|
|
199
|
-
"process.onSignal": { argTypes: [STRING, DYN, BOOL], result: VOID },
|
|
200
|
-
"process.offSignal": { argTypes: [STRING, DYN], result: VOID },
|
|
201
|
-
"process.onExit": { argTypes: [null, BOOL], result: VOID },
|
|
202
|
-
"process.offExit": { argTypes: [null], result: VOID },
|
|
203
|
-
"stdin.onData": { argTypes: [null, BOOL], result: VOID },
|
|
204
|
-
"stdin.onEnd": { argTypes: [{ kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
205
|
-
"stdin.onError": { argTypes: [null, BOOL], result: VOID },
|
|
206
|
-
"stdin.nextChunk": { argTypes: [], result: { kind: "promise", inner: BYTES_U8 } },
|
|
207
|
-
"fs.readFileSync": { argTypes: [STRING, STRING], result: STRING },
|
|
208
|
-
"fs.readFileSyncBuf": { argTypes: [STRING], result: BYTES_U8 },
|
|
209
|
-
"fs.readFileSyncDyn": { argTypes: [STRING, DYN], result: DYN },
|
|
210
|
-
"fs.writeFileSync": { argTypes: [STRING, STRING], result: VOID },
|
|
211
|
-
"fs.appendFileSync": { argTypes: [STRING, STRING], result: VOID },
|
|
212
|
-
"fs.existsSync": { argTypes: [STRING], result: BOOL },
|
|
213
|
-
"fs.mkdirSync": { argTypes: [STRING], result: VOID },
|
|
214
|
-
"fs.rmSync": { argTypes: [STRING], result: VOID },
|
|
215
|
-
"fs.rmdirSync": { argTypes: [STRING], result: VOID },
|
|
216
|
-
"fs.readdirSync": { argTypes: [STRING], result: arrayOf(STRING) },
|
|
217
|
-
// Result is the call site's Dirent record array (VOID is the
|
|
218
|
-
// structure-checked sentinel, the os.networkInterfaces pattern).
|
|
219
|
-
"fs.readdirTypesSync": { argTypes: [STRING], result: VOID },
|
|
220
|
-
"path.join": { argTypes: [arrayOf(STRING)], result: STRING },
|
|
221
|
-
"path.resolve": { argTypes: [arrayOf(STRING)], result: STRING },
|
|
222
|
-
"path.normalize": { argTypes: [STRING], result: STRING },
|
|
223
|
-
"path.dirname": { argTypes: [STRING], result: STRING },
|
|
224
|
-
"path.basename": { argTypes: [STRING, STRING], result: STRING },
|
|
225
|
-
"path.extname": { argTypes: [STRING], result: STRING },
|
|
226
|
-
"path.isAbsolute": { argTypes: [STRING], result: BOOL },
|
|
227
|
-
"path.relative": { argTypes: [STRING, STRING], result: STRING },
|
|
228
|
-
"path.toNamespacedPath": { argTypes: [STRING], result: STRING },
|
|
229
|
-
"path.win32Join": { argTypes: [arrayOf(STRING)], result: STRING },
|
|
230
|
-
"path.win32Resolve": { argTypes: [arrayOf(STRING)], result: STRING },
|
|
231
|
-
"path.win32Normalize": { argTypes: [STRING], result: STRING },
|
|
232
|
-
"path.win32Dirname": { argTypes: [STRING], result: STRING },
|
|
233
|
-
"path.win32Basename": { argTypes: [STRING, STRING], result: STRING },
|
|
234
|
-
"path.win32Extname": { argTypes: [STRING], result: STRING },
|
|
235
|
-
"path.win32IsAbsolute": { argTypes: [STRING], result: BOOL },
|
|
236
|
-
"path.win32Relative": { argTypes: [STRING, STRING], result: STRING },
|
|
237
|
-
"path.win32ToNamespacedPath": { argTypes: [STRING], result: STRING },
|
|
238
|
-
"os.homedir": { argTypes: [], result: STRING },
|
|
239
|
-
"os.release": { argTypes: [], result: STRING },
|
|
240
|
-
"os.type": { argTypes: [], result: STRING },
|
|
241
|
-
"os.totalmem": { argTypes: [], result: F64 },
|
|
242
|
-
"process.umask": { argTypes: [F64], result: F64 },
|
|
243
|
-
"process.chdir": { argTypes: [STRING], result: VOID },
|
|
244
|
-
"process.loadEnvFile": { argTypes: [DYN], result: VOID },
|
|
245
|
-
"process.exiting": { argTypes: [], result: BOOL },
|
|
246
|
-
"net.getAutoSelTimeout": { argTypes: [], result: F64 },
|
|
247
|
-
"net.setAutoSelTimeout": { argTypes: [F64], result: VOID },
|
|
248
|
-
"fs.realpathSync": { argTypes: [STRING], result: STRING },
|
|
249
|
-
"fs.realpathNativeSync": { argTypes: [STRING], result: STRING },
|
|
250
|
-
"os.userName": { argTypes: [], result: STRING },
|
|
251
|
-
"os.userShell": { argTypes: [], result: STRING },
|
|
252
|
-
"os.userHomedir": { argTypes: [], result: STRING },
|
|
253
|
-
"os.tmpdir": { argTypes: [], result: STRING },
|
|
254
|
-
// Result is the call site's Dict<NetworkInterfaceInfo[]> record (VOID is
|
|
255
|
-
// the dgram.address sentinel — the libCall case checks the structure).
|
|
256
|
-
"os.networkInterfaces": { argTypes: [], result: VOID },
|
|
257
|
-
"math.maxArr": { argTypes: [arrayOf(F64)], result: F64 },
|
|
258
|
-
"math.minArr": { argTypes: [arrayOf(F64)], result: F64 },
|
|
259
|
-
"math.hypotArr": { argTypes: [arrayOf(F64)], result: F64 },
|
|
260
|
-
"math.floor": { argTypes: [F64], result: F64 },
|
|
261
|
-
"math.abs": { argTypes: [F64], result: F64 },
|
|
262
|
-
"math.round": { argTypes: [F64], result: F64 },
|
|
263
|
-
"math.trunc": { argTypes: [F64], result: F64 },
|
|
264
|
-
"math.ceil": { argTypes: [F64], result: F64 },
|
|
265
|
-
"math.sin": { argTypes: [F64], result: F64 },
|
|
266
|
-
"math.sinh": { argTypes: [F64], result: F64 },
|
|
267
|
-
"math.cos": { argTypes: [F64], result: F64 },
|
|
268
|
-
"math.cosh": { argTypes: [F64], result: F64 },
|
|
269
|
-
"math.tan": { argTypes: [F64], result: F64 },
|
|
270
|
-
"math.tanh": { argTypes: [F64], result: F64 },
|
|
271
|
-
"math.asin": { argTypes: [F64], result: F64 },
|
|
272
|
-
"math.asinh": { argTypes: [F64], result: F64 },
|
|
273
|
-
"math.acos": { argTypes: [F64], result: F64 },
|
|
274
|
-
"math.acosh": { argTypes: [F64], result: F64 },
|
|
275
|
-
"math.atan": { argTypes: [F64], result: F64 },
|
|
276
|
-
"math.atanh": { argTypes: [F64], result: F64 },
|
|
277
|
-
"math.cbrt": { argTypes: [F64], result: F64 },
|
|
278
|
-
"math.clz32": { argTypes: [F64], result: F64 },
|
|
279
|
-
"math.sign": { argTypes: [F64], result: F64 },
|
|
280
|
-
"math.exp": { argTypes: [F64], result: F64 },
|
|
281
|
-
"math.expm1": { argTypes: [F64], result: F64 },
|
|
282
|
-
"math.fround": { argTypes: [F64], result: F64 },
|
|
283
|
-
"math.sqrt": { argTypes: [F64], result: F64 },
|
|
284
|
-
"math.log": { argTypes: [F64], result: F64 },
|
|
285
|
-
"math.log1p": { argTypes: [F64], result: F64 },
|
|
286
|
-
"math.log2": { argTypes: [F64], result: F64 },
|
|
287
|
-
"math.log10": { argTypes: [F64], result: F64 },
|
|
288
|
-
"math.atan2": { argTypes: [F64, F64], result: F64 },
|
|
289
|
-
"math.pow": { argTypes: [F64, F64], result: F64 },
|
|
290
|
-
"math.imul": { argTypes: [F64, F64], result: F64 },
|
|
291
|
-
"math.min": { argTypes: [F64, F64], result: F64 },
|
|
292
|
-
"math.max": { argTypes: [F64, F64], result: F64 },
|
|
293
|
-
"math.random": { argTypes: [], result: F64 },
|
|
294
|
-
"num.parseInt": { argTypes: [STRING, F64], result: F64 },
|
|
295
|
-
"num.parseFloat": { argTypes: [STRING], result: F64 },
|
|
296
|
-
"num.fromString": { argTypes: [STRING], result: F64 },
|
|
297
|
-
"num.isNaN": { argTypes: [F64], result: BOOL },
|
|
298
|
-
"str.encodeUriComponent": { argTypes: [STRING], result: STRING },
|
|
299
|
-
// The base64 globals: the argument is a dyn value (WebIDL ToString
|
|
300
|
-
// runs in the runtime); the zero-argument form always throws.
|
|
301
|
-
"str.atob": { argTypes: [DYN], result: STRING },
|
|
302
|
-
"str.btoa": { argTypes: [DYN], result: STRING },
|
|
303
|
-
"str.b64Missing": { argTypes: [], result: STRING },
|
|
304
|
-
"str.decodeUriComponent": { argTypes: [STRING], result: STRING },
|
|
305
|
-
"str.decodeUri": { argTypes: [STRING], result: STRING },
|
|
306
|
-
"str.encodeUri": { argTypes: [STRING], result: STRING },
|
|
307
|
-
"regexp.escape": { argTypes: [STRING], result: STRING },
|
|
308
|
-
"num.toExponential": { argTypes: [F64], result: STRING },
|
|
309
|
-
"num.toFixed0": { argTypes: [F64], result: STRING },
|
|
310
|
-
"num.toFixed": { argTypes: [F64, F64], result: STRING },
|
|
311
|
-
"num.toStringRadix": { argTypes: [F64, DYN], result: STRING },
|
|
312
|
-
"num.sameValue": { argTypes: [F64, F64], result: BOOL },
|
|
313
|
-
"intl.numFormatEnUs": { argTypes: [F64], result: STRING },
|
|
314
|
-
"sym.new": { argTypes: [STRING], result: SYMBOL_T },
|
|
315
|
-
"sym.newAnon": { argTypes: [], result: SYMBOL_T },
|
|
316
|
-
"sym.for": { argTypes: [STRING], result: SYMBOL_T },
|
|
317
|
-
"sym.wellKnown": { argTypes: [STRING], result: SYMBOL_T },
|
|
318
|
-
// Result is the interned `string | undefined` union — the libCall case
|
|
319
|
-
// checks the arms (the spawnRes.error pattern).
|
|
320
|
-
"sym.keyFor": { argTypes: [SYMBOL_T], result: VOID },
|
|
321
|
-
"sym.desc": { argTypes: [SYMBOL_T], result: VOID },
|
|
322
|
-
"sym.toString": { argTypes: [SYMBOL_T], result: STRING },
|
|
323
|
-
"bigint.parse": { argTypes: [STRING], result: BIGINT_T },
|
|
324
|
-
"bigint.fromF64": { argTypes: [F64], result: BIGINT_T },
|
|
325
|
-
"bigint.neg": { argTypes: [BIGINT_T], result: BIGINT_T },
|
|
326
|
-
"bigint.not": { argTypes: [BIGINT_T], result: BIGINT_T },
|
|
327
|
-
"bigint.add": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
328
|
-
"bigint.sub": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
329
|
-
"bigint.mul": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
330
|
-
"bigint.div": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
331
|
-
"bigint.mod": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
332
|
-
"bigint.pow": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
333
|
-
"bigint.and": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
334
|
-
"bigint.or": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
335
|
-
"bigint.xor": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
336
|
-
"bigint.shl": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
337
|
-
"bigint.shr": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
338
|
-
"bigint.eq": { argTypes: [BIGINT_T, BIGINT_T], result: BOOL },
|
|
339
|
-
"bigint.eqString": { argTypes: [BIGINT_T, STRING], result: BOOL },
|
|
340
|
-
"bigint.cmp": { argTypes: [BIGINT_T, BIGINT_T], result: F64 },
|
|
341
|
-
"bigint.cmpNumber": { argTypes: [BIGINT_T, F64], result: F64 },
|
|
342
|
-
"bigint.truthy": { argTypes: [BIGINT_T], result: BOOL },
|
|
343
|
-
"bigint.toString": { argTypes: [BIGINT_T, F64], result: STRING },
|
|
344
|
-
"bigint.inspect": { argTypes: [BIGINT_T], result: STRING },
|
|
345
|
-
"bigint.toF64": { argTypes: [BIGINT_T], result: F64 },
|
|
346
|
-
"bigint.asUintN": { argTypes: [F64, BIGINT_T], result: BIGINT_T },
|
|
347
|
-
"bigint.asIntN": { argTypes: [F64, BIGINT_T], result: BIGINT_T },
|
|
348
|
-
"bigint.bufferRead": { argTypes: [BYTES_U8, F64, BOOL, BOOL], result: BIGINT_T },
|
|
349
|
-
"bigint.bufferWrite": { argTypes: [BYTES_U8, BIGINT_T, F64, BOOL, BOOL], result: F64 },
|
|
350
|
-
"bigint.dataViewGet": { argTypes: [BYTES_U8, F64, BOOL, BOOL], result: BIGINT_T },
|
|
351
|
-
"bigint.dataViewSet": { argTypes: [BYTES_U8, F64, BIGINT_T, BOOL], result: VOID },
|
|
352
|
-
"url.new": { argTypes: [STRING], result: URL_T },
|
|
353
|
-
"url.newBase": { argTypes: [STRING, STRING], result: URL_T },
|
|
354
|
-
"url.canParse": { argTypes: [STRING], result: BOOL },
|
|
355
|
-
"url.canParseBase": { argTypes: [STRING, STRING], result: BOOL },
|
|
356
|
-
"url.parse": { argTypes: [STRING], result: DYN },
|
|
357
|
-
"url.parseBase": { argTypes: [STRING, STRING], result: DYN },
|
|
358
|
-
"url.protocol": { argTypes: [URL_T], result: STRING },
|
|
359
|
-
"url.origin": { argTypes: [URL_T], result: STRING },
|
|
360
|
-
"url.username": { argTypes: [URL_T], result: STRING },
|
|
361
|
-
"url.password": { argTypes: [URL_T], result: STRING },
|
|
362
|
-
"url.host": { argTypes: [URL_T], result: STRING },
|
|
363
|
-
"url.hostname": { argTypes: [URL_T], result: STRING },
|
|
364
|
-
"url.port": { argTypes: [URL_T], result: STRING },
|
|
365
|
-
"url.pathname": { argTypes: [URL_T], result: STRING },
|
|
366
|
-
"url.href": { argTypes: [URL_T], result: STRING },
|
|
367
|
-
"url.set": { argTypes: [URL_T, STRING, STRING], result: VOID },
|
|
368
|
-
"url.setChecked": { argTypes: [URL_T, STRING, DYN], result: VOID },
|
|
369
|
-
"url.fileURLToPathUrl": { argTypes: [URL_T], result: STRING },
|
|
370
|
-
"url.fileURLToPathChecked": { argTypes: [DYN], result: STRING },
|
|
371
|
-
"url.fileURLToPathOptions": { argTypes: [DYN, DYN], result: STRING },
|
|
372
|
-
"url.fileURLToPathBuffer": { argTypes: [DYN, DYN], result: BYTES_U8 },
|
|
373
|
-
"url.pathToFileURLChecked": { argTypes: [DYN, DYN], result: URL_T },
|
|
374
|
-
"url.fileURLToPathStr": { argTypes: [STRING], result: STRING },
|
|
375
|
-
"url.pathToFileURL": { argTypes: [STRING], result: URL_T },
|
|
376
|
-
"url.pathToFileURLPlatform": { argTypes: [STRING, BOOL], result: URL_T },
|
|
377
|
-
"url.pathToFileURLWin32": { argTypes: [STRING], result: URL_T },
|
|
378
|
-
"sp.new": { argTypes: [], result: SEARCH_PARAMS_T },
|
|
379
|
-
"sp.newChecked": { argTypes: [DYN], result: SEARCH_PARAMS_T },
|
|
380
|
-
"sp.parse": { argTypes: [STRING], result: SEARCH_PARAMS_T },
|
|
381
|
-
"sp.copy": { argTypes: [SEARCH_PARAMS_T], result: SEARCH_PARAMS_T },
|
|
382
|
-
// The pairs argument is string[][] — checked structurally below (the
|
|
383
|
-
// generic array-of slot has no named constant here).
|
|
384
|
-
"sp.fromPairs": { argTypes: [null], result: SEARCH_PARAMS_T },
|
|
385
|
-
"sp.with": { argTypes: [SEARCH_PARAMS_T, STRING, STRING], result: SEARCH_PARAMS_T },
|
|
386
|
-
"url.searchParams": { argTypes: [URL_T], result: SEARCH_PARAMS_T },
|
|
387
|
-
"url.search": { argTypes: [URL_T], result: STRING },
|
|
388
|
-
"url.hash": { argTypes: [URL_T], result: STRING },
|
|
389
|
-
// Result is the interned `string | null` union — the libCall case
|
|
390
|
-
// checks the arms (the spawnRes.signal pattern).
|
|
391
|
-
"sp.get": { argTypes: [SEARCH_PARAMS_T, STRING], result: VOID },
|
|
392
|
-
"sp.getAll": { argTypes: [SEARCH_PARAMS_T, STRING], result: arrayOf(STRING) },
|
|
393
|
-
"sp.append": { argTypes: [SEARCH_PARAMS_T, STRING, STRING], result: VOID },
|
|
394
|
-
"sp.set": { argTypes: [SEARCH_PARAMS_T, STRING, STRING], result: VOID },
|
|
395
|
-
"sp.delete": { argTypes: [SEARCH_PARAMS_T, STRING], result: VOID },
|
|
396
|
-
"sp.deleteValue": { argTypes: [SEARCH_PARAMS_T, STRING, STRING], result: VOID },
|
|
397
|
-
"sp.has": { argTypes: [SEARCH_PARAMS_T, STRING], result: BOOL },
|
|
398
|
-
"sp.hasValue": { argTypes: [SEARCH_PARAMS_T, STRING, STRING], result: BOOL },
|
|
399
|
-
"sp.sort": { argTypes: [SEARCH_PARAMS_T], result: VOID },
|
|
400
|
-
"sp.size": { argTypes: [SEARCH_PARAMS_T], result: F64 },
|
|
401
|
-
"sp.toString": { argTypes: [SEARCH_PARAMS_T], result: STRING },
|
|
402
|
-
"sp.keyAt": { argTypes: [SEARCH_PARAMS_T, F64], result: STRING },
|
|
403
|
-
"sp.valAt": { argTypes: [SEARCH_PARAMS_T, F64], result: STRING },
|
|
404
|
-
// node:querystring. qs.parse's result is the call site's ParsedUrlQuery
|
|
405
|
-
// dictionary record (VOID is the networkInterfaces sentinel — the
|
|
406
|
-
// libCall case checks the structure); qs.stringify's object argument
|
|
407
|
-
// is a dyn value (the frontend dynFroms typed records).
|
|
408
|
-
"qs.parse": { argTypes: [STRING, STRING, STRING, F64], result: VOID },
|
|
409
|
-
"qs.stringify": { argTypes: [DYN, STRING, STRING], result: STRING },
|
|
410
|
-
"qs.escape": { argTypes: [STRING], result: STRING },
|
|
411
|
-
"qs.unescape": { argTypes: [STRING], result: STRING },
|
|
412
|
-
"util.parseArgs": { argTypes: [DYN], result: DYN },
|
|
413
|
-
"util.parseEnv": { argTypes: [DYN], result: DYN },
|
|
414
|
-
"util.getSystemErrorName": { argTypes: [DYN], result: STRING },
|
|
415
|
-
"util.getSystemErrorMessage": { argTypes: [DYN], result: STRING },
|
|
416
|
-
"util.systemErrorEntries": { argTypes: [], result: DYN },
|
|
417
|
-
"util.stripVTControlCharacters": { argTypes: [DYN], result: STRING },
|
|
418
|
-
"util.toUSVString": { argTypes: [DYN], result: STRING },
|
|
419
|
-
"util.isDeepStrictEqual": { argTypes: [DYN, DYN, DYN], result: BOOL },
|
|
420
|
-
"util.styleText": { argTypes: [DYN, DYN, DYN], result: STRING },
|
|
421
|
-
"util.typeIs": { argTypes: [DYN, STRING], result: BOOL },
|
|
422
|
-
"util.typeValue": { argTypes: [DYN, STRING], result: DYN },
|
|
423
|
-
"fs.statSync": { argTypes: [STRING], result: STATS_T },
|
|
424
|
-
"fs.lstatSync": { argTypes: [STRING], result: STATS_T },
|
|
425
|
-
"fs.fstatSync": { argTypes: [F64], result: STATS_T },
|
|
426
|
-
"fs.fchmodSync": { argTypes: [F64, F64], result: VOID },
|
|
427
|
-
"fs.fsyncSync": { argTypes: [F64], result: VOID },
|
|
428
|
-
"fs.fdatasyncSync": { argTypes: [F64], result: VOID },
|
|
429
|
-
"fs.ftruncateSync": { argTypes: [F64, F64], result: VOID },
|
|
430
|
-
"fs.utimesSync": { argTypes: [DYN, DYN, DYN], result: VOID },
|
|
431
|
-
"fs.futimesSync": { argTypes: [DYN, DYN, DYN], result: VOID },
|
|
432
|
-
"fs.lutimesSync": { argTypes: [DYN, DYN, DYN], result: VOID },
|
|
433
|
-
"fs.readvSync": { argTypes: [F64, arrayOf(BYTES_U8), F64], result: F64 },
|
|
434
|
-
"fs.writevSync": { argTypes: [F64, arrayOf(BYTES_U8), F64], result: F64 },
|
|
435
|
-
"fs.linkSync": { argTypes: [DYN, DYN], result: VOID },
|
|
436
|
-
"fs.symlinkSync": { argTypes: [DYN, DYN, DYN], result: VOID },
|
|
437
|
-
"fs.readlinkSync": { argTypes: [DYN, DYN], result: DYN },
|
|
438
|
-
"fs.statfsSync": { argTypes: [DYN, DYN], result: DYN },
|
|
439
|
-
"fs.readlinkSyncStr": { argTypes: [DYN, DYN], result: STRING },
|
|
440
|
-
"fs.readlinkSyncBuffer": { argTypes: [DYN, DYN], result: BYTES_U8 },
|
|
441
|
-
"fs.openSync": { argTypes: [STRING, STRING], result: F64 },
|
|
442
|
-
"fs.openNumericSync": { argTypes: [STRING, F64, F64], result: F64 },
|
|
443
|
-
"fs.readSync": { argTypes: [F64, BYTES_U8, F64, F64, F64], result: F64 },
|
|
444
|
-
"fs.writeSync": { argTypes: [F64, BYTES_U8, F64, F64, F64], result: F64 },
|
|
445
|
-
"fs.writeStrSync": { argTypes: [F64, STRING, F64, STRING], result: F64 },
|
|
446
|
-
// fs.watch's callback func type is program-dependent (zero params, or
|
|
447
|
-
// the eventType string) — the slot pins arity and the path/receiver.
|
|
448
|
-
"fs.watch": { argTypes: [STRING], result: FSWATCHER_T },
|
|
449
|
-
"fs.watchCb": { argTypes: [STRING, null], result: FSWATCHER_T },
|
|
450
|
-
"watcher.close": { argTypes: [FSWATCHER_T], result: VOID },
|
|
451
|
-
"crypto.x509Fingerprint": { argTypes: [BYTES_U8], result: STRING },
|
|
452
|
-
"crypto.x509FingerprintStr": { argTypes: [STRING], result: STRING },
|
|
453
|
-
"crypto.x509ValidFrom": { argTypes: [BYTES_U8], result: STRING },
|
|
454
|
-
"crypto.x509ValidFromStr": { argTypes: [STRING], result: STRING },
|
|
455
|
-
"crypto.x509ValidTo": { argTypes: [BYTES_U8], result: STRING },
|
|
456
|
-
"crypto.x509ValidToStr": { argTypes: [STRING], result: STRING },
|
|
457
|
-
"fs.closeSync": { argTypes: [F64], result: VOID },
|
|
458
|
-
"stats.isFile": { argTypes: [STATS_T], result: BOOL },
|
|
459
|
-
"stats.isDirectory": { argTypes: [STATS_T], result: BOOL },
|
|
460
|
-
"stats.isSymbolicLink": { argTypes: [STATS_T], result: BOOL },
|
|
461
|
-
"stats.size": { argTypes: [STATS_T], result: F64 },
|
|
462
|
-
"stats.dev": { argTypes: [STATS_T], result: F64 },
|
|
463
|
-
"stats.ino": { argTypes: [STATS_T], result: F64 },
|
|
464
|
-
"stats.blocks": { argTypes: [STATS_T], result: F64 },
|
|
465
|
-
"stats.nlink": { argTypes: [STATS_T], result: F64 },
|
|
466
|
-
"stats.atimeMs": { argTypes: [STATS_T], result: F64 },
|
|
467
|
-
"stats.mtimeMs": { argTypes: [STATS_T], result: F64 },
|
|
468
|
-
"stats.ctimeMs": { argTypes: [STATS_T], result: F64 },
|
|
469
|
-
// The wider sync fs slice (unlink/chmod/chown/copyfile and the
|
|
470
|
-
// mode-carrying write/mkdir forms).
|
|
471
|
-
"fs.unlinkSync": { argTypes: [STRING], result: VOID },
|
|
472
|
-
"fs.chmodSync": { argTypes: [STRING, F64], result: VOID },
|
|
473
|
-
"fs.chownSync": { argTypes: [STRING, F64, F64], result: VOID },
|
|
474
|
-
"fs.copyFileSync": { argTypes: [STRING, STRING], result: VOID },
|
|
475
|
-
"fs.renameSync": { argTypes: [STRING, STRING], result: VOID },
|
|
476
|
-
// Callback type is program-dependent (zero params or Error | null).
|
|
477
|
-
"fs.renameCb": { argTypes: [STRING, STRING, null], result: VOID },
|
|
478
|
-
"fs.writeFileModeSync": { argTypes: [STRING, STRING, F64], result: VOID },
|
|
479
|
-
"fs.mkdirModeSync": { argTypes: [STRING, F64], result: VOID },
|
|
480
|
-
"fs.mkdirRecursiveModeSync": { argTypes: [STRING, F64], result: VOID },
|
|
481
|
-
// Atomics.wait over an Int32Array — the synchronous-sleep idiom.
|
|
482
|
-
"atomics.wait": { argTypes: [bytesOf("i32"), F64, F64, F64], result: STRING },
|
|
483
|
-
"cp.spawnSync": { argTypes: [STRING, arrayOf(STRING)], result: SPAWNRES_T },
|
|
484
|
-
// spawnSync's options form: timeout, killSignal name ("" = SIGTERM),
|
|
485
|
-
// and the three stdio modes.
|
|
486
|
-
"cp.spawnSyncOpts": {
|
|
487
|
-
argTypes: [STRING, arrayOf(STRING), F64, STRING, F64, F64, F64],
|
|
488
|
-
result: SPAWNRES_T,
|
|
489
|
-
},
|
|
490
|
-
"cp.spawnSyncStdioStr": {
|
|
491
|
-
argTypes: [STRING, arrayOf(STRING), F64, STRING, STRING],
|
|
492
|
-
result: SPAWNRES_T,
|
|
493
|
-
},
|
|
494
|
-
// node:net (scr_net.c). Listener slots are program-dependent closures —
|
|
495
|
-
// null slots, checked in the libCall case (the child.onExit precedent);
|
|
496
|
-
// the zero-param callbacks pin the exact func type here. The trailing
|
|
497
|
-
// BOOL on registrations is the once flag.
|
|
498
|
-
"net.createServer": { argTypes: [], result: NETSERVER_T },
|
|
499
|
-
"net.createServerCb": { argTypes: [null], result: NETSERVER_T },
|
|
500
|
-
"net.listen": { argTypes: [NETSERVER_T, F64], result: VOID },
|
|
501
|
-
"net.listenCb": { argTypes: [NETSERVER_T, F64, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
502
|
-
"net.listenOpts": { argTypes: [NETSERVER_T, F64, STRING, BOOL], result: VOID },
|
|
503
|
-
// The callback slot is a zero-param void closure OR its
|
|
504
|
-
// `(() => void) | undefined` optional-binding union (checked specially).
|
|
505
|
-
"net.listenOptsCb": { argTypes: [NETSERVER_T, F64, STRING, BOOL, null], result: VOID },
|
|
506
|
-
"net.listenOptsReusePort": { argTypes: [NETSERVER_T, F64, STRING, BOOL, BOOL], result: VOID },
|
|
507
|
-
// The callback is a zero-param void closure OR its optional-binding union;
|
|
508
|
-
// the callback follows the reusePort BOOL in this additive ABI.
|
|
509
|
-
"net.listenOptsReusePortCb": { argTypes: [NETSERVER_T, F64, STRING, BOOL, BOOL, null], result: VOID },
|
|
510
|
-
"net.serverPort": { argTypes: [NETSERVER_T], result: F64 },
|
|
511
|
-
"net.serverListening": { argTypes: [NETSERVER_T], result: BOOL },
|
|
512
|
-
// net.serverAddress's record result is shape-checked in the libCall case
|
|
513
|
-
// (the dgram.address sentinel pattern).
|
|
514
|
-
"net.serverAddress": { argTypes: [NETSERVER_T], result: VOID },
|
|
515
|
-
"net.serverClose": { argTypes: [NETSERVER_T], result: VOID },
|
|
516
|
-
"net.serverCloseCb": { argTypes: [NETSERVER_T, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
517
|
-
"net.serverOnError": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
|
|
518
|
-
"net.serverOnClose": { argTypes: [NETSERVER_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
519
|
-
"net.serverOnConnection": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
|
|
520
|
-
"net.serverOnSecureConnection": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
|
|
521
|
-
"net.connect": { argTypes: [F64, STRING], result: NETSOCKET_T },
|
|
522
|
-
"net.connectAttempt": { argTypes: [F64, STRING, DYN], result: NETSOCKET_T },
|
|
523
|
-
"net.connectOptsChk": { argTypes: [DYN, STRING], result: VOID },
|
|
524
|
-
"net.connectCb": { argTypes: [F64, STRING, { kind: "func", params: [], ret: VOID }], result: NETSOCKET_T },
|
|
525
|
-
// The lookup's exact func shape is program data (its answer callback's
|
|
526
|
-
// union/record types) — checked specially in the libCall case.
|
|
527
|
-
"net.connectLookup": { argTypes: [F64, STRING, null], result: NETSOCKET_T },
|
|
528
|
-
"net.sockWrite": { argTypes: [NETSOCKET_T, STRING], result: VOID },
|
|
529
|
-
"net.sockWriteBytes": { argTypes: [NETSOCKET_T, BYTES_U8], result: VOID },
|
|
530
|
-
"net.sockEnd": { argTypes: [NETSOCKET_T], result: VOID },
|
|
531
|
-
"net.sockEndStr": { argTypes: [NETSOCKET_T, STRING], result: VOID },
|
|
532
|
-
"net.sockEndBytes": { argTypes: [NETSOCKET_T, BYTES_U8], result: VOID },
|
|
533
|
-
"net.sockWriteDyn": { argTypes: [NETSOCKET_T, DYN], result: VOID },
|
|
534
|
-
"net.sockEndDyn": { argTypes: [NETSOCKET_T, DYN], result: VOID },
|
|
535
|
-
"net.sockDestroy": { argTypes: [NETSOCKET_T], result: VOID },
|
|
536
|
-
"net.sockPipe": { argTypes: [NETSOCKET_T, NETSOCKET_T], result: VOID },
|
|
537
|
-
"net.sockPipeRes": { argTypes: [NETSOCKET_T, HTTPRES_T], result: VOID },
|
|
538
|
-
"net.sockOnData": { argTypes: [NETSOCKET_T, null, BOOL], result: VOID },
|
|
539
|
-
"net.sockOnEnd": { argTypes: [NETSOCKET_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
540
|
-
"net.sockOnClose": { argTypes: [NETSOCKET_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
541
|
-
"net.sockOnError": { argTypes: [NETSOCKET_T, null, BOOL], result: VOID },
|
|
542
|
-
"net.sockOnConnect": { argTypes: [NETSOCKET_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
543
|
-
// node:dgram + node:dns (scr_dgram.c). The message/error listeners and
|
|
544
|
-
// dns.lookup's callback are program-dependent closures (null slots,
|
|
545
|
-
// checked in the libCall case); dgram.address's record result is
|
|
546
|
-
// program-dependent too (VOID here is the envGet sentinel — the libCall
|
|
547
|
-
// case checks the {address, family, port} shape).
|
|
548
|
-
"dgram.createSocket": { argTypes: [BOOL], result: DGRAMSOCK_T },
|
|
549
|
-
"dgram.bind": { argTypes: [DGRAMSOCK_T, F64, STRING], result: VOID },
|
|
550
|
-
"dgram.bindCb": { argTypes: [DGRAMSOCK_T, F64, STRING, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
551
|
-
"dgram.connect": { argTypes: [DGRAMSOCK_T, F64, STRING], result: VOID },
|
|
552
|
-
"dgram.connectCb": { argTypes: [DGRAMSOCK_T, F64, STRING, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
553
|
-
"dgram.sendStr": { argTypes: [DGRAMSOCK_T, STRING, F64, STRING], result: VOID },
|
|
554
|
-
"dgram.sendBytes": { argTypes: [DGRAMSOCK_T, BYTES_U8, F64, STRING], result: VOID },
|
|
555
|
-
"dgram.sendChk": { argTypes: [DGRAMSOCK_T, DYN, DYN, DYN, DYN, DYN, STRING], result: VOID },
|
|
556
|
-
"dgram.address": { argTypes: [DGRAMSOCK_T], result: VOID },
|
|
557
|
-
"dgram.close": { argTypes: [DGRAMSOCK_T], result: VOID },
|
|
558
|
-
"dgram.closeCb": { argTypes: [DGRAMSOCK_T, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
559
|
-
"dgram.unref": { argTypes: [DGRAMSOCK_T], result: VOID },
|
|
560
|
-
"dgram.ref": { argTypes: [DGRAMSOCK_T], result: VOID },
|
|
561
|
-
"dgram.onMessage": { argTypes: [DGRAMSOCK_T, null, BOOL], result: VOID },
|
|
562
|
-
"dgram.onError": { argTypes: [DGRAMSOCK_T, null, BOOL], result: VOID },
|
|
563
|
-
"dgram.onListening": { argTypes: [DGRAMSOCK_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
564
|
-
"dgram.onClose": { argTypes: [DGRAMSOCK_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
565
|
-
"dgram.onConnect": { argTypes: [DGRAMSOCK_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
566
|
-
"dns.lookup": { argTypes: [STRING, F64, null], result: VOID },
|
|
567
|
-
// node:test (scr_test.c). Bodies are program-dependent closures (0 or
|
|
568
|
-
// 1 testCtx param, void or Promise<void> result — the spoke pinned the
|
|
569
|
-
// shape): null slots. sub's result is the settled Promise<void> the
|
|
570
|
-
// await consumes.
|
|
571
|
-
"test.register": { argTypes: [STRING, F64, STRING, null, F64, STRING], result: VOID },
|
|
572
|
-
"test.registerEmpty": { argTypes: [STRING, F64, STRING, F64, STRING], result: VOID },
|
|
573
|
-
"test.suite": { argTypes: [STRING, F64, STRING, { kind: "func", params: [], ret: VOID }, STRING], result: VOID },
|
|
574
|
-
"test.hook": { argTypes: [F64, null, F64], result: VOID },
|
|
575
|
-
"test.sub": { argTypes: [TESTCTX_T, STRING, F64, STRING, null, F64, STRING], result: { kind: "promise", inner: VOID } },
|
|
576
|
-
"test.subEmpty": { argTypes: [TESTCTX_T, STRING, F64, STRING, STRING], result: VOID },
|
|
577
|
-
"test.ctxSkip": { argTypes: [TESTCTX_T, STRING], result: VOID },
|
|
578
|
-
"test.ctxTodo": { argTypes: [TESTCTX_T, STRING], result: VOID },
|
|
579
|
-
"test.ctxDiagnostic": { argTypes: [TESTCTX_T, STRING], result: VOID },
|
|
580
|
-
"test.ctxName": { argTypes: [TESTCTX_T], result: STRING },
|
|
581
|
-
// node:http (scr_http.c over scr_net.c). The handler and the data
|
|
582
|
-
// listeners are program-dependent closures (null slots, checked in the
|
|
583
|
-
// libCall case); reqHeader's result is the interned string|undefined
|
|
584
|
-
// union, checked like process.envGet.
|
|
585
|
-
"http.createServer": { argTypes: [null], result: NETSERVER_T },
|
|
586
|
-
"http.createServerEmpty": { argTypes: [], result: NETSERVER_T },
|
|
587
|
-
"http.validateHeaderName": { argTypes: [STRING, STRING], result: VOID },
|
|
588
|
-
"http.validateHeaderValue": { argTypes: [STRING, DYN], result: VOID },
|
|
589
|
-
"http.serverJoinDupHeaders": { argTypes: [NETSERVER_T], result: VOID },
|
|
590
|
-
"http.serverAllowMissingHostHeader": { argTypes: [NETSERVER_T], result: VOID },
|
|
591
|
-
"http.serverTimeoutGet": { argTypes: [NETSERVER_T, F64], result: F64 },
|
|
592
|
-
"http.serverSetTimeout": { argTypes: [NETSERVER_T, F64], result: VOID },
|
|
593
|
-
"http.serverSetTimeoutCb": { argTypes: [NETSERVER_T, F64, null], result: VOID },
|
|
594
|
-
"http.serverOnTimeout": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
|
|
595
|
-
"http.serverCloseAllConnections": { argTypes: [NETSERVER_T], result: VOID },
|
|
596
|
-
"http.serverCloseIdleConnections": { argTypes: [NETSERVER_T], result: VOID },
|
|
597
|
-
"http.serverTimeoutSet": { argTypes: [NETSERVER_T, F64, F64], result: VOID },
|
|
598
|
-
"http.serverTimeoutOptionSet": { argTypes: [NETSERVER_T, F64, DYN], result: VOID },
|
|
599
|
-
"net.serverOnListening": { argTypes: [NETSERVER_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
600
|
-
"http.resStatusGet": { argTypes: [HTTPRES_T], result: F64 },
|
|
601
|
-
"http.resStatusSet": { argTypes: [HTTPRES_T, F64], result: VOID },
|
|
602
|
-
"http.resStatusMsgGet": { argTypes: [HTTPRES_T], result: VOID },
|
|
603
|
-
"http.resStatusMsgSet": { argTypes: [HTTPRES_T, STRING], result: VOID },
|
|
604
|
-
"http.resRequest": { argTypes: [HTTPRES_T], result: HTTPREQ_T },
|
|
605
|
-
"http.resSocket": { argTypes: [HTTPRES_T], result: VOID },
|
|
606
|
-
"http.resWritableFinished": { argTypes: [HTTPRES_T], result: BOOL },
|
|
607
|
-
"http.resSendDateGet": { argTypes: [HTTPRES_T], result: BOOL },
|
|
608
|
-
"http.resSendDateSet": { argTypes: [HTTPRES_T, BOOL], result: VOID },
|
|
609
|
-
"http.resStrictContentLengthGet": { argTypes: [HTTPRES_T], result: BOOL },
|
|
610
|
-
"http.resStrictContentLengthSet": { argTypes: [HTTPRES_T, BOOL], result: VOID },
|
|
611
|
-
"http.resSetTimeout": { argTypes: [HTTPRES_T, F64], result: VOID },
|
|
612
|
-
"http.resSetTimeoutCb": { argTypes: [HTTPRES_T, F64, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
613
|
-
// resGetHeader answers the interned `string | undefined` union — the
|
|
614
|
-
// reqHeader/envGet sentinel pattern (VOID here, checked specially).
|
|
615
|
-
"http.resGetHeader": { argTypes: [HTTPRES_T, STRING], result: VOID },
|
|
616
|
-
"http.resGetHeaderNames": { argTypes: [HTTPRES_T], result: arrayOf(STRING) },
|
|
617
|
-
"http.resGetRawHeaderNames": { argTypes: [HTTPRES_T], result: arrayOf(STRING) },
|
|
618
|
-
"http.resGetHeaders": { argTypes: [HTTPRES_T], result: DYN },
|
|
619
|
-
"http.resHasHeader": { argTypes: [HTTPRES_T, STRING], result: BOOL },
|
|
620
|
-
"http.resRemoveHeader": { argTypes: [HTTPRES_T, STRING], result: VOID },
|
|
621
|
-
"http.resOnFinish": { argTypes: [HTTPRES_T, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
622
|
-
"http.reqUrl": { argTypes: [HTTPREQ_T], result: STRING },
|
|
623
|
-
"http.reqMethod": { argTypes: [HTTPREQ_T], result: STRING },
|
|
624
|
-
"http.reqHeader": { argTypes: [HTTPREQ_T, STRING], result: VOID },
|
|
625
|
-
"http.reqTrailer": { argTypes: [HTTPREQ_T, STRING], result: VOID },
|
|
626
|
-
"http.reqHeaderValues": { argTypes: [HTTPREQ_T, STRING], result: VOID },
|
|
627
|
-
"http.reqTrailerValues": { argTypes: [HTTPREQ_T, STRING], result: VOID },
|
|
628
|
-
"http.reqOnData": { argTypes: [HTTPREQ_T, null, BOOL], result: VOID },
|
|
629
|
-
"http.reqOnEnd": { argTypes: [HTTPREQ_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
630
|
-
"http.resSetHeader": { argTypes: [HTTPRES_T, STRING, STRING], result: VOID },
|
|
631
|
-
"http.resWriteHead": { argTypes: [HTTPRES_T, F64], result: VOID },
|
|
632
|
-
"http.resWriteHeadN": { argTypes: [HTTPRES_T, F64, arrayOf(STRING), arrayOf(STRING)], result: VOID },
|
|
633
|
-
"http.resWriteContinue": { argTypes: [HTTPRES_T], result: VOID },
|
|
634
|
-
"http.resWriteProcessing": { argTypes: [HTTPRES_T], result: VOID },
|
|
635
|
-
"http.resWriteEarlyHints": { argTypes: [HTTPRES_T, arrayOf(STRING)], result: VOID },
|
|
636
|
-
"http.resWrite": { argTypes: [HTTPRES_T, STRING], result: VOID },
|
|
637
|
-
"http.resWriteBytes": { argTypes: [HTTPRES_T, BYTES_U8], result: VOID },
|
|
638
|
-
"http.resEnd": { argTypes: [HTTPRES_T], result: VOID },
|
|
639
|
-
"http.resEndStr": { argTypes: [HTTPRES_T, STRING], result: VOID },
|
|
640
|
-
"http.resEndBytes": { argTypes: [HTTPRES_T, BYTES_U8], result: VOID },
|
|
641
|
-
"http.resWriteDyn": { argTypes: [HTTPRES_T, DYN], result: VOID },
|
|
642
|
-
"http.resEndDyn": { argTypes: [HTTPRES_T, DYN], result: VOID },
|
|
643
|
-
"http.resHeadersSent": { argTypes: [HTTPRES_T], result: BOOL },
|
|
644
|
-
"http.resWritableEnded": { argTypes: [HTTPRES_T], result: BOOL },
|
|
645
|
-
"http.resFlushHeaders": { argTypes: [HTTPRES_T], result: VOID },
|
|
646
|
-
"http.resAddTrailers": { argTypes: [HTTPRES_T, arrayOf(STRING)], result: VOID },
|
|
647
|
-
"http.resCork": { argTypes: [HTTPRES_T], result: VOID },
|
|
648
|
-
"http.resUncork": { argTypes: [HTTPRES_T], result: VOID },
|
|
649
|
-
"http.resWritableCorked": { argTypes: [HTTPRES_T], result: F64 },
|
|
650
|
-
// The member follow-ups: reqStatusCode's `number | undefined` and
|
|
651
|
-
// sockRemoteAddress's `string | undefined` results are shape-checked in
|
|
652
|
-
// the special cases below (like reqHeader/columns).
|
|
653
|
-
"http.reqStatusCode": { argTypes: [HTTPREQ_T], result: VOID },
|
|
654
|
-
// reqStatusMessage's `string | undefined` is program-interned like
|
|
655
|
-
// reqHeader's (the VOID here is the envGet sentinel).
|
|
656
|
-
"http.reqStatusMessage": { argTypes: [HTTPREQ_T], result: VOID },
|
|
657
|
-
"http.reqRawHeaders": { argTypes: [HTTPREQ_T], result: arrayOf(STRING) },
|
|
658
|
-
"http.reqHeaderPairs": { argTypes: [HTTPREQ_T], result: arrayOf(STRING) },
|
|
659
|
-
"http.reqRawTrailers": { argTypes: [HTTPREQ_T], result: arrayOf(STRING) },
|
|
660
|
-
"http.reqTrailerPairs": { argTypes: [HTTPREQ_T], result: arrayOf(STRING) },
|
|
661
|
-
"net.sockDestroyed": { argTypes: [NETSOCKET_T], result: BOOL },
|
|
662
|
-
"net.sockWritable": { argTypes: [NETSOCKET_T], result: BOOL },
|
|
663
|
-
// The 'upgrade' registrations: the callback shapes are program-typed
|
|
664
|
-
// ((req, socket, head) and shorter prefixes — the libCall case checks).
|
|
665
|
-
"http.serverOnUpgrade": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
|
|
666
|
-
"http.serverOnConnect": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
|
|
667
|
-
"http.clientOnUpgrade": { argTypes: [HTTPCLIENTREQ_T, null, BOOL], result: VOID },
|
|
668
|
-
"http.reqSocket": { argTypes: [HTTPREQ_T], result: NETSOCKET_T },
|
|
669
|
-
// reqH2Stream's program-interned Http2Stream | undefined result is
|
|
670
|
-
// checked in the special libCall cases below.
|
|
671
|
-
"http.reqH2Stream": { argTypes: [HTTPREQ_T], result: VOID },
|
|
672
|
-
"http.reqH2StreamOrThrow": { argTypes: [HTTPREQ_T, STRING], result: HTTP2STREAM_T },
|
|
673
|
-
"http.reqPipeRes": { argTypes: [HTTPREQ_T, HTTPRES_T], result: VOID },
|
|
674
|
-
"http.reqPipeClient": { argTypes: [HTTPREQ_T, HTTPCLIENTREQ_T], result: VOID },
|
|
675
|
-
"http.reqPipeSock": { argTypes: [HTTPREQ_T, NETSOCKET_T], result: VOID },
|
|
676
|
-
"http.reqResume": { argTypes: [HTTPREQ_T], result: VOID },
|
|
677
|
-
"http.reqDestroy": { argTypes: [HTTPREQ_T], result: VOID },
|
|
678
|
-
"http.reqOnError": { argTypes: [HTTPREQ_T, null, BOOL], result: VOID },
|
|
679
|
-
"http.reqOnClose": { argTypes: [HTTPREQ_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
680
|
-
"http.reqOnAborted": { argTypes: [HTTPREQ_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
681
|
-
"http.reqHttpVersion": { argTypes: [HTTPREQ_T], result: STRING },
|
|
682
|
-
"http.reqHttpVersionMajor": { argTypes: [HTTPREQ_T], result: F64 },
|
|
683
|
-
"http.reqHttpVersionMinor": { argTypes: [HTTPREQ_T], result: F64 },
|
|
684
|
-
"http.reqAborted": { argTypes: [HTTPREQ_T], result: BOOL },
|
|
685
|
-
"http.reqComplete": { argTypes: [HTTPREQ_T], result: BOOL },
|
|
686
|
-
"http.resDestroy": { argTypes: [HTTPRES_T], result: VOID },
|
|
687
|
-
"http.resOnClose": { argTypes: [HTTPRES_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
688
|
-
"http.resWriteHeadPairs": { argTypes: [HTTPRES_T, F64, arrayOf(STRING)], result: VOID },
|
|
689
|
-
"http.resWriteHeadDyn": { argTypes: [HTTPRES_T, F64, DYN], result: VOID },
|
|
690
|
-
"net.sockSetTimeout": { argTypes: [NETSOCKET_T, F64], result: VOID },
|
|
691
|
-
"net.sockSetEncoding": { argTypes: [NETSOCKET_T, STRING], result: VOID },
|
|
692
|
-
"http.reqSetEncoding": { argTypes: [HTTPREQ_T, STRING], result: VOID },
|
|
693
|
-
"net.sockOnTimeout": { argTypes: [NETSOCKET_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
694
|
-
"net.sockRemoteAddress": { argTypes: [NETSOCKET_T], result: VOID },
|
|
695
|
-
"net.sockEncrypted": { argTypes: [NETSOCKET_T], result: VOID },
|
|
696
|
-
// node:http, the client slice. The response callback shapes are
|
|
697
|
-
// program-dependent (checked below); header pairs arrive flat.
|
|
698
|
-
"http.request": { argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL], result: HTTPCLIENTREQ_T },
|
|
699
|
-
"http.requestCb": { argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, null], result: HTTPCLIENTREQ_T },
|
|
700
|
-
"http.agentNew": { argTypes: [BOOL, BOOL, F64, F64, F64, F64, F64], result: DYN },
|
|
701
|
-
"http.requestAgent": { argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, DYN], result: HTTPCLIENTREQ_T },
|
|
702
|
-
"http.requestAgentCb": { argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, DYN, null], result: HTTPCLIENTREQ_T },
|
|
703
|
-
"http.requestUrl": { argTypes: [STRING, STRING, BOOL], result: HTTPCLIENTREQ_T },
|
|
704
|
-
"http.requestUrlCb": { argTypes: [STRING, STRING, BOOL, null], result: HTTPCLIENTREQ_T },
|
|
705
|
-
"net.sockOnReadable": { argTypes: [NETSOCKET_T, null, BOOL], result: VOID },
|
|
706
|
-
// sockRead's result is the interned `Buffer | null` union — checked
|
|
707
|
-
// specially below (the reqHeader/envGet pattern; VOID here is a
|
|
708
|
-
// placeholder the special case overrides).
|
|
709
|
-
"net.sockRead": { argTypes: [NETSOCKET_T, F64], result: VOID },
|
|
710
|
-
"net.sockUnshift": { argTypes: [NETSOCKET_T, BYTES_U8], result: VOID },
|
|
711
|
-
"net.sockPause": { argTypes: [NETSOCKET_T], result: NETSOCKET_T },
|
|
712
|
-
"net.sockResume": { argTypes: [NETSOCKET_T], result: NETSOCKET_T },
|
|
713
|
-
"net.sockSetNoDelay": { argTypes: [NETSOCKET_T, BOOL], result: NETSOCKET_T },
|
|
714
|
-
"net.sockDestroySoon": { argTypes: [NETSOCKET_T], result: VOID },
|
|
715
|
-
"net.sockBytesWritten": { argTypes: [NETSOCKET_T], result: F64 },
|
|
716
|
-
"net.sockReadable": { argTypes: [NETSOCKET_T], result: BOOL },
|
|
717
|
-
"net.sockOnFinish": { argTypes: [NETSOCKET_T, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
718
|
-
"net.serverEmitConnection": { argTypes: [NETSERVER_T, NETSOCKET_T], result: VOID },
|
|
719
|
-
// tls/https: cert/key/ca PEM arguments are strings OR Buffers (null =
|
|
720
|
-
// both accepted; the emitter passes data+len either way).
|
|
721
|
-
"tls.createServer": { argTypes: [null, null], result: NETSERVER_T },
|
|
722
|
-
"tls.createServerCb": { argTypes: [null, null, null], result: NETSERVER_T },
|
|
723
|
-
// The runtime options records (divergence 66's stance): a dyn options
|
|
724
|
-
// value whose members read at runtime; pemDyn extracts a runtime-valued
|
|
725
|
-
// cert/key member (arg 1 is the precomposed fence label).
|
|
726
|
-
"tls.pemDyn": { argTypes: [DYN, STRING], result: BYTES_U8 },
|
|
727
|
-
"tls.createServerDyn": { argTypes: [DYN], result: NETSERVER_T },
|
|
728
|
-
"tls.createServerDynCb": { argTypes: [DYN, null], result: NETSERVER_T },
|
|
729
|
-
"https.createServerDyn": { argTypes: [DYN], result: NETSERVER_T },
|
|
730
|
-
"https.createServerDynCb": { argTypes: [DYN, null], result: NETSERVER_T },
|
|
731
|
-
"http2.createSecureServerReq": { argTypes: [null, null, null, BOOL], result: NETSERVER_T },
|
|
732
|
-
"http2.createSecureServerH2Req": { argTypes: [null, null, null, BOOL], result: NETSERVER_T },
|
|
733
|
-
"http2.createSecureServerDyn": { argTypes: [DYN], result: NETSERVER_T },
|
|
734
|
-
"http2.createSecureServerDynCb": { argTypes: [DYN, null], result: NETSERVER_T },
|
|
735
|
-
// tls.connect(port, host, opts[, cb]) — port -1 / host "" read the
|
|
736
|
-
// options record; the callback fires post-handshake (secureConnect).
|
|
737
|
-
"tls.connect": { argTypes: [F64, STRING, DYN], result: NETSOCKET_T },
|
|
738
|
-
"tls.connectCb": { argTypes: [F64, STRING, DYN, null], result: NETSOCKET_T },
|
|
739
|
-
// The TLSSocket member surface (authError's `string | null` union is
|
|
740
|
-
// shape-checked in the special cases below — the reqHeader pattern).
|
|
741
|
-
"tls.sockAuthorized": { argTypes: [NETSOCKET_T], result: BOOL },
|
|
742
|
-
"tls.sockAuthError": { argTypes: [NETSOCKET_T], result: VOID },
|
|
743
|
-
"tls.sockOnSecureConnect": { argTypes: [NETSOCKET_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
744
|
-
"tls.sockOnSession": { argTypes: [NETSOCKET_T, null, BOOL], result: VOID },
|
|
745
|
-
// createSecureContext({ cert, key }) mints the opaque SNI-answer handle.
|
|
746
|
-
"tls.createSecureContext": { argTypes: [null, null], result: SECURECTX_T },
|
|
747
|
-
"tls.createSecureContextDyn": { argTypes: [DYN], result: SECURECTX_T },
|
|
748
|
-
"tls.caCertsChk": { argTypes: [DYN, STRING], result: VOID },
|
|
749
|
-
// The CA-store introspection unit (scr_tls_ca.c): per-type cached PEM
|
|
750
|
-
// string arrays and the default-set replacement.
|
|
751
|
-
"tlsca.get": { argTypes: [STRING], result: arrayOf(STRING) },
|
|
752
|
-
"tlsca.root": { argTypes: [], result: arrayOf(STRING) },
|
|
753
|
-
"tlsca.set": { argTypes: [arrayOf(STRING)], result: VOID },
|
|
754
|
-
"https.createServer": { argTypes: [null, null, null], result: NETSERVER_T },
|
|
755
|
-
// http2's allowHTTP1 compatibility server (divergence 57): cert/key
|
|
756
|
-
// like tls.createServer; the 'request' handler arrives separately via
|
|
757
|
-
// http.serverOnRequest (shape checked in the libCall case, like
|
|
758
|
-
// http.createServer's). sessionError callback shape is checked below.
|
|
759
|
-
"http2.createSecureServer": { argTypes: [null, null, BOOL], result: NETSERVER_T },
|
|
760
|
-
// The SNI-callback form: arg 2 is the JS SNICallback closure — a
|
|
761
|
-
// `(servername, cb) => void` func, or its `| undefined` union from the
|
|
762
|
-
// conditional-spread spelling (the libCall case checks the shape).
|
|
763
|
-
"http2.createSecureServerSni": { argTypes: [null, null, null, BOOL], result: NETSERVER_T },
|
|
764
|
-
// The ALPN=h2 server (createSecureServer without allowHTTP1): the real
|
|
765
|
-
// h2 session machinery behind the TLS handshake.
|
|
766
|
-
"http2.createSecureServerH2": { argTypes: [null, null, BOOL], result: NETSERVER_T },
|
|
767
|
-
"http.serverOnRequest": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
|
|
768
|
-
"http2.serverOnSessionError": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
|
|
769
|
-
"http2.streamNoop": { argTypes: [], result: VOID },
|
|
770
|
-
"http2.streamUndefCall": { argTypes: [STRING], result: VOID },
|
|
771
|
-
// The REAL h2c surface (scr_http2.c). Callback slots are null (the
|
|
772
|
-
// emitter picks the thunk); pairs slots are string arrays; the
|
|
773
|
-
// endStream tri-state and event flags ride as f64.
|
|
774
|
-
"http2.createServer": { argTypes: [], result: NETSERVER_T },
|
|
775
|
-
"http2.createServerReq": { argTypes: [null], result: NETSERVER_T },
|
|
776
|
-
"http2.serverOnStream": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
|
|
777
|
-
"http2.serverOnSession": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
|
|
778
|
-
// connect(authority, reject, ca[, cb]): the TLS client knobs an https
|
|
779
|
-
// authority reads (inert on http ones, exactly Node); ca is a PEM
|
|
780
|
-
// string/Buffer ("" = the system anchors).
|
|
781
|
-
"http2.connect": { argTypes: [STRING, BOOL, null], result: HTTP2SESSION_T },
|
|
782
|
-
"http2.connectCb": { argTypes: [STRING, BOOL, null, null], result: HTTP2SESSION_T },
|
|
783
|
-
"http2.sessionRequest": { argTypes: [HTTP2SESSION_T, arrayOf(STRING), F64], result: HTTP2STREAM_T },
|
|
784
|
-
"http2.sessionClose": { argTypes: [HTTP2SESSION_T], result: VOID },
|
|
785
|
-
"http2.sessionCloseCb": { argTypes: [HTTP2SESSION_T, null], result: VOID },
|
|
786
|
-
"http2.sessionDestroy": { argTypes: [HTTP2SESSION_T], result: VOID },
|
|
787
|
-
"http2.sessionOnClose": { argTypes: [HTTP2SESSION_T, null, BOOL], result: VOID },
|
|
788
|
-
"http2.sessionOnError": { argTypes: [HTTP2SESSION_T, null, BOOL], result: VOID },
|
|
789
|
-
"http2.sessionOnConnect": { argTypes: [HTTP2SESSION_T, null, BOOL], result: VOID },
|
|
790
|
-
"http2.sessionOnStream": { argTypes: [HTTP2SESSION_T, null, BOOL], result: VOID },
|
|
791
|
-
"http2.sessionOnGoaway": { argTypes: [HTTP2SESSION_T, null, BOOL], result: VOID },
|
|
792
|
-
"http2.sessionClosed": { argTypes: [HTTP2SESSION_T], result: BOOL },
|
|
793
|
-
"http2.sessionDestroyed": { argTypes: [HTTP2SESSION_T], result: BOOL },
|
|
794
|
-
"http2.sessionEncrypted": { argTypes: [HTTP2SESSION_T], result: BOOL },
|
|
795
|
-
"http2.sessionType": { argTypes: [HTTP2SESSION_T], result: F64 },
|
|
796
|
-
"http2.sessionAlpn": { argTypes: [HTTP2SESSION_T], result: STRING },
|
|
797
|
-
"http2.sessionSocket": { argTypes: [HTTP2SESSION_T], result: NETSOCKET_T },
|
|
798
|
-
"http2.streamRespond": { argTypes: [HTTP2STREAM_T, arrayOf(STRING), BOOL], result: VOID },
|
|
799
|
-
"http2.streamWrite": { argTypes: [HTTP2STREAM_T, STRING], result: VOID },
|
|
800
|
-
"http2.streamWriteBytes": { argTypes: [HTTP2STREAM_T, BYTES_U8], result: VOID },
|
|
801
|
-
"http2.streamEnd": { argTypes: [HTTP2STREAM_T], result: VOID },
|
|
802
|
-
"http2.streamEndStr": { argTypes: [HTTP2STREAM_T, STRING], result: VOID },
|
|
803
|
-
"http2.streamEndBytes": { argTypes: [HTTP2STREAM_T, BYTES_U8], result: VOID },
|
|
804
|
-
"http2.streamClose": { argTypes: [HTTP2STREAM_T, F64], result: VOID },
|
|
805
|
-
"http2.streamCloseCb": { argTypes: [HTTP2STREAM_T, F64, null], result: VOID },
|
|
806
|
-
"http2.streamDestroy": { argTypes: [HTTP2STREAM_T], result: VOID },
|
|
807
|
-
"http2.sessionSettings0": { argTypes: [HTTP2SESSION_T], result: VOID },
|
|
808
|
-
"http2.sessionSettings": { argTypes: [HTTP2SESSION_T, DYN], result: VOID },
|
|
809
|
-
"http2.sessionSettingsDynCb": { argTypes: [HTTP2SESSION_T, DYN, DYN], result: VOID },
|
|
810
|
-
"http2.sessionSettingsCb0": { argTypes: [HTTP2SESSION_T, DYN, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
811
|
-
"http2.sessionOnSettingsDyn": { argTypes: [HTTP2SESSION_T, DYN, BOOL, BOOL], result: VOID },
|
|
812
|
-
"http2.sessionOnSettings0": { argTypes: [HTTP2SESSION_T, { kind: "func", params: [], ret: VOID }, BOOL, BOOL], result: VOID },
|
|
813
|
-
"http2.sessionSettingsGet": { argTypes: [HTTP2SESSION_T, BOOL], result: DYN },
|
|
814
|
-
"http2.sessionPendingSettingsAck": { argTypes: [HTTP2SESSION_T], result: BOOL },
|
|
815
|
-
"http2.getDefaultSettings": { argTypes: [], result: DYN },
|
|
816
|
-
"http2.streamSetEncoding": { argTypes: [HTTP2STREAM_T, STRING], result: VOID },
|
|
817
|
-
"http2.streamSetEncodingRet": { argTypes: [HTTP2STREAM_T, STRING], result: HTTP2STREAM_T },
|
|
818
|
-
"http2.streamResume": { argTypes: [HTTP2STREAM_T], result: VOID },
|
|
819
|
-
"http2.streamPause": { argTypes: [HTTP2STREAM_T], result: VOID },
|
|
820
|
-
"http2.streamOnData": { argTypes: [HTTP2STREAM_T, null, BOOL], result: VOID },
|
|
821
|
-
"http2.streamOnEnd": { argTypes: [HTTP2STREAM_T, null, BOOL], result: VOID },
|
|
822
|
-
"http2.streamOnClose": { argTypes: [HTTP2STREAM_T, null, BOOL], result: VOID },
|
|
823
|
-
"http2.streamOnAborted": { argTypes: [HTTP2STREAM_T, null, BOOL], result: VOID },
|
|
824
|
-
"http2.streamOnError": { argTypes: [HTTP2STREAM_T, null, BOOL], result: VOID },
|
|
825
|
-
"http2.streamOnResponse": { argTypes: [HTTP2STREAM_T, null, BOOL], result: VOID },
|
|
826
|
-
"http2.streamId": { argTypes: [HTTP2STREAM_T], result: F64 },
|
|
827
|
-
"http2.streamRstCode": { argTypes: [HTTP2STREAM_T], result: F64 },
|
|
828
|
-
"http2.streamDestroyed": { argTypes: [HTTP2STREAM_T], result: BOOL },
|
|
829
|
-
"http2.streamClosed": { argTypes: [HTTP2STREAM_T], result: BOOL },
|
|
830
|
-
"http2.streamAborted": { argTypes: [HTTP2STREAM_T], result: BOOL },
|
|
831
|
-
"http2.streamPending": { argTypes: [HTTP2STREAM_T], result: BOOL },
|
|
832
|
-
"http2.streamSession": { argTypes: [HTTP2STREAM_T], result: HTTP2SESSION_T },
|
|
833
|
-
// The createConnection forms: arg 0 is the dialer closure (() =>
|
|
834
|
-
// Socket — the libCall case checks), then path/method/timeout/headers/
|
|
835
|
-
// autoEnd like http.request.
|
|
836
|
-
"http.requestConn": { argTypes: [null, STRING, STRING, F64, arrayOf(STRING), BOOL], result: HTTPCLIENTREQ_T },
|
|
837
|
-
"http.requestConnCb": { argTypes: [null, STRING, STRING, F64, arrayOf(STRING), BOOL, null], result: HTTPCLIENTREQ_T },
|
|
838
|
-
"https.request": { argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, BOOL, null], result: HTTPCLIENTREQ_T },
|
|
839
|
-
"https.requestCb": { argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, BOOL, null, null], result: HTTPCLIENTREQ_T },
|
|
840
|
-
"https.requestUrl": { argTypes: [STRING, STRING, BOOL], result: HTTPCLIENTREQ_T },
|
|
841
|
-
"https.requestUrlCb": { argTypes: [STRING, STRING, BOOL, null], result: HTTPCLIENTREQ_T },
|
|
842
|
-
"https.requestAgent": { argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, BOOL, null, DYN], result: HTTPCLIENTREQ_T },
|
|
843
|
-
"https.requestAgentCb": { argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, BOOL, null, DYN, null], result: HTTPCLIENTREQ_T },
|
|
844
|
-
// The requestFn binding's runtime-secure rows: https.request's shape
|
|
845
|
-
// with the leading `secure` bool.
|
|
846
|
-
"https.requestFn": { argTypes: [BOOL, STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, BOOL, null], result: HTTPCLIENTREQ_T },
|
|
847
|
-
"https.requestFnCb": { argTypes: [BOOL, STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, BOOL, null, null], result: HTTPCLIENTREQ_T },
|
|
848
|
-
"http.clientWrite": { argTypes: [HTTPCLIENTREQ_T, STRING], result: VOID },
|
|
849
|
-
"http.clientSetHeader": { argTypes: [HTTPCLIENTREQ_T, STRING, STRING], result: VOID },
|
|
850
|
-
"http.clientGetHeader": { argTypes: [HTTPCLIENTREQ_T, STRING], result: VOID },
|
|
851
|
-
"http.clientHasHeader": { argTypes: [HTTPCLIENTREQ_T, STRING], result: BOOL },
|
|
852
|
-
"http.clientRemoveHeader": { argTypes: [HTTPCLIENTREQ_T, STRING], result: VOID },
|
|
853
|
-
"http.clientGetHeaderNames": { argTypes: [HTTPCLIENTREQ_T], result: arrayOf(STRING) },
|
|
854
|
-
"http.clientGetRawHeaderNames": { argTypes: [HTTPCLIENTREQ_T], result: arrayOf(STRING) },
|
|
855
|
-
"http.clientGetHeaders": { argTypes: [HTTPCLIENTREQ_T], result: DYN },
|
|
856
|
-
"http.clientWriteBytes": { argTypes: [HTTPCLIENTREQ_T, BYTES_U8], result: VOID },
|
|
857
|
-
"http.clientEnd": { argTypes: [HTTPCLIENTREQ_T], result: VOID },
|
|
858
|
-
"http.clientEndStr": { argTypes: [HTTPCLIENTREQ_T, STRING], result: VOID },
|
|
859
|
-
"http.clientEndBytes": { argTypes: [HTTPCLIENTREQ_T, BYTES_U8], result: VOID },
|
|
860
|
-
"http.clientWriteDyn": { argTypes: [HTTPCLIENTREQ_T, DYN], result: VOID },
|
|
861
|
-
"http.clientEndDyn": { argTypes: [HTTPCLIENTREQ_T, DYN], result: VOID },
|
|
862
|
-
"http.clientFlushHeaders": { argTypes: [HTTPCLIENTREQ_T], result: VOID },
|
|
863
|
-
"http.clientAddTrailers": { argTypes: [HTTPCLIENTREQ_T, arrayOf(STRING)], result: VOID },
|
|
864
|
-
"http.clientCork": { argTypes: [HTTPCLIENTREQ_T], result: VOID },
|
|
865
|
-
"http.clientUncork": { argTypes: [HTTPCLIENTREQ_T], result: VOID },
|
|
866
|
-
"http.clientWritableCorked": { argTypes: [HTTPCLIENTREQ_T], result: F64 },
|
|
867
|
-
"http.clientMethod": { argTypes: [HTTPCLIENTREQ_T], result: STRING },
|
|
868
|
-
"http.clientPath": { argTypes: [HTTPCLIENTREQ_T], result: STRING },
|
|
869
|
-
"http.clientHost": { argTypes: [HTTPCLIENTREQ_T], result: STRING },
|
|
870
|
-
"http.clientProtocol": { argTypes: [HTTPCLIENTREQ_T], result: STRING },
|
|
871
|
-
"http.clientHeadersSent": { argTypes: [HTTPCLIENTREQ_T], result: BOOL },
|
|
872
|
-
"http.clientWritableEnded": { argTypes: [HTTPCLIENTREQ_T], result: BOOL },
|
|
873
|
-
"http.clientWritableFinished": { argTypes: [HTTPCLIENTREQ_T], result: BOOL },
|
|
874
|
-
"http.clientSocket": { argTypes: [HTTPCLIENTREQ_T], result: NETSOCKET_T },
|
|
875
|
-
"http.clientReusedSocket": { argTypes: [HTTPCLIENTREQ_T], result: BOOL },
|
|
876
|
-
"http.clientSetNoDelay": { argTypes: [HTTPCLIENTREQ_T, BOOL], result: VOID },
|
|
877
|
-
"http.clientSetSocketKeepAlive": { argTypes: [HTTPCLIENTREQ_T, BOOL, F64], result: VOID },
|
|
878
|
-
"http.clientSetTimeout": { argTypes: [HTTPCLIENTREQ_T, F64], result: VOID },
|
|
879
|
-
"http.clientSetTimeoutCb": { argTypes: [HTTPCLIENTREQ_T, F64, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
880
|
-
"http.statusCodes": { argTypes: [], result: DYN },
|
|
881
|
-
"http.methods": { argTypes: [], result: arrayOf(STRING) },
|
|
882
|
-
"http.reqSetTimeout": { argTypes: [HTTPREQ_T, F64], result: VOID },
|
|
883
|
-
"http.reqSetTimeoutCb": { argTypes: [HTTPREQ_T, F64, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
884
|
-
"http.clientDestroy": { argTypes: [HTTPCLIENTREQ_T], result: VOID },
|
|
885
|
-
"http.clientAbort": { argTypes: [HTTPCLIENTREQ_T], result: VOID },
|
|
886
|
-
"http.clientAborted": { argTypes: [HTTPCLIENTREQ_T], result: BOOL },
|
|
887
|
-
"http.clientDestroyed": { argTypes: [HTTPCLIENTREQ_T], result: BOOL },
|
|
888
|
-
"http.clientOnResponse": { argTypes: [HTTPCLIENTREQ_T, null, BOOL], result: VOID },
|
|
889
|
-
"http.clientOnSocket": { argTypes: [HTTPCLIENTREQ_T, null, BOOL], result: VOID },
|
|
890
|
-
"http.clientOnFinish": { argTypes: [HTTPCLIENTREQ_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
891
|
-
"http.clientOnError": { argTypes: [HTTPCLIENTREQ_T, null, BOOL], result: VOID },
|
|
892
|
-
"http.clientOnTimeout": { argTypes: [HTTPCLIENTREQ_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
893
|
-
"http.clientOnClose": { argTypes: [HTTPCLIENTREQ_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
894
|
-
"http.clientOnAbort": { argTypes: [HTTPCLIENTREQ_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
895
|
-
"cp.execSync": {
|
|
896
|
-
argTypes: [STRING, arrayOf(STRING), BOOL, STRING, BOOL, STRING, BOOL, arrayOf(STRING), F64, F64, F64],
|
|
897
|
-
result: STRING,
|
|
898
|
-
},
|
|
899
|
-
"cp.execCapture": {
|
|
900
|
-
argTypes: [STRING, arrayOf(STRING), STRING, BOOL, arrayOf(STRING), F64],
|
|
901
|
-
result: SPAWNRES_T,
|
|
902
|
-
},
|
|
903
|
-
"cp.spawn": { argTypes: [STRING, arrayOf(STRING)], result: CHILD_T },
|
|
904
|
-
"process.forkTarget": { argTypes: [F64], result: F64 },
|
|
905
|
-
"cp.fork": {
|
|
906
|
-
argTypes: [F64, arrayOf(STRING), F64, F64, F64, BOOL, arrayOf(STRING), STRING],
|
|
907
|
-
result: CHILD_T,
|
|
908
|
-
},
|
|
909
|
-
"child.connected": { argTypes: [CHILD_T], result: BOOL },
|
|
910
|
-
"child.send": { argTypes: [CHILD_T, STRING], result: BOOL },
|
|
911
|
-
"child.sendCb": { argTypes: [CHILD_T, STRING, null], result: BOOL },
|
|
912
|
-
"child.disconnect": { argTypes: [CHILD_T], result: VOID },
|
|
913
|
-
"child.onMessage": { argTypes: [CHILD_T, null, BOOL], result: VOID },
|
|
914
|
-
"child.onDisconnect": { argTypes: [CHILD_T, null, BOOL], result: VOID },
|
|
915
|
-
"child.onSpawn": { argTypes: [CHILD_T, null], result: VOID },
|
|
916
|
-
"child.onDyn": { argTypes: [CHILD_T, STRING, DYN], result: VOID },
|
|
917
|
-
"process.connected": { argTypes: [], result: BOOL },
|
|
918
|
-
"process.send": { argTypes: [STRING], result: BOOL },
|
|
919
|
-
"process.sendCb": { argTypes: [STRING, null], result: BOOL },
|
|
920
|
-
"process.disconnect": { argTypes: [], result: VOID },
|
|
921
|
-
"process.onMessage": { argTypes: [null, BOOL], result: VOID },
|
|
922
|
-
"process.onDisconnect": { argTypes: [null, BOOL], result: VOID },
|
|
923
|
-
"cp.execFile": { argTypes: [STRING, arrayOf(STRING), null], result: CHILD_T },
|
|
924
|
-
// spawn's options form: per-slot stdio modes (0 ignore / 1 inherit /
|
|
925
|
-
// 2 fd) with the out/err fds for mode 2, detached, env replacement
|
|
926
|
-
// pairs, cwd ("" = inherit).
|
|
927
|
-
"cp.spawnOpts": {
|
|
928
|
-
argTypes: [STRING, arrayOf(STRING), F64, F64, F64, F64, F64, BOOL, BOOL, BOOL, arrayOf(STRING), STRING],
|
|
929
|
-
result: CHILD_T,
|
|
930
|
-
},
|
|
931
|
-
"cp.spawnDynamic": { argTypes: [STRING, arrayOf(STRING), DYN], result: CHILD_T },
|
|
932
|
-
// The callback's func type is program-dependent (zero params, or the
|
|
933
|
-
// `number | null` union / the %Error class) — the libCall case checks
|
|
934
|
-
// the shape; the slot here only pins arity and the child receiver.
|
|
935
|
-
"child.onExit": { argTypes: [CHILD_T, null], result: VOID },
|
|
936
|
-
"child.onClose": { argTypes: [CHILD_T, null], result: VOID },
|
|
937
|
-
"child.onError": { argTypes: [CHILD_T, null], result: VOID },
|
|
938
|
-
// Like process.envGet, spawnRes.status's result type is program-dependent
|
|
939
|
-
// (the interned `number | null` union) — the libCall case checks the arms.
|
|
940
|
-
"spawnRes.status": { argTypes: [SPAWNRES_T], result: VOID },
|
|
941
|
-
// spawnRes.error's result is the interned `Error | undefined` union —
|
|
942
|
-
// the libCall case checks the arms, the spawnRes.status pattern.
|
|
943
|
-
"spawnRes.error": { argTypes: [SPAWNRES_T], result: VOID },
|
|
944
|
-
// spawnRes.signal's result is the interned `string | null` union —
|
|
945
|
-
// same pattern.
|
|
946
|
-
"spawnRes.signal": { argTypes: [SPAWNRES_T], result: VOID },
|
|
947
|
-
// The ChildProcess lifecycle members: pid/exitCode are program-dependent
|
|
948
|
-
// unions (`number | undefined` / `number | null` — the libCall case
|
|
949
|
-
// checks the arms, the spawnRes.status pattern).
|
|
950
|
-
"child.pid": { argTypes: [CHILD_T], result: VOID },
|
|
951
|
-
"child.exitCode": { argTypes: [CHILD_T], result: VOID },
|
|
952
|
-
// The close-override pair: the bound close's result func type and the
|
|
953
|
-
// override's func argument are program-dependent (the callback union's
|
|
954
|
-
// tags) — the slots pin the server receiver; the libCall case checks
|
|
955
|
-
// the bound value's shape.
|
|
956
|
-
"net.serverCloseBind": { argTypes: [NETSERVER_T], result: VOID },
|
|
957
|
-
"net.serverSetCloseOverride": { argTypes: [NETSERVER_T, null], result: VOID },
|
|
958
|
-
// The piped-output stream reads: `Readable | null` unions (the libCall
|
|
959
|
-
// case checks the arms — the child.pid pattern with a ref arm).
|
|
960
|
-
"child.stdout": { argTypes: [CHILD_T], result: VOID },
|
|
961
|
-
"child.stderr": { argTypes: [CHILD_T], result: VOID },
|
|
962
|
-
"child.stdin": { argTypes: [CHILD_T], result: VOID },
|
|
963
|
-
// Listener registrations: callback func shapes are program-dependent
|
|
964
|
-
// (zero-param / Buffer / Buffer-armed union) — the slots pin arity,
|
|
965
|
-
// the stream receiver, and the once-flag.
|
|
966
|
-
"stream.onData": { argTypes: [CHILDSTREAM_T, null, BOOL], result: VOID },
|
|
967
|
-
"stream.onDataStr": { argTypes: [CHILDSTREAM_T, null, BOOL], result: VOID },
|
|
968
|
-
"stream.onEnd": { argTypes: [CHILDSTREAM_T, null, BOOL], result: VOID },
|
|
969
|
-
"stream.childSetEncoding": { argTypes: [CHILDSTREAM_T, STRING], result: CHILDSTREAM_T },
|
|
970
|
-
"writer.writeString": { argTypes: [CHILDWRITER_T, STRING], result: BOOL },
|
|
971
|
-
"writer.writeBytes": { argTypes: [CHILDWRITER_T, BYTES_U8], result: BOOL },
|
|
972
|
-
"writer.end": { argTypes: [CHILDWRITER_T], result: VOID },
|
|
973
|
-
"writer.destroy": { argTypes: [CHILDWRITER_T], result: VOID },
|
|
974
|
-
"writer.writable": { argTypes: [CHILDWRITER_T], result: BOOL },
|
|
975
|
-
"writer.onDrain": { argTypes: [CHILDWRITER_T, null, BOOL], result: VOID },
|
|
976
|
-
"writer.onFinish": { argTypes: [CHILDWRITER_T, null, BOOL], result: VOID },
|
|
977
|
-
"writer.onError": { argTypes: [CHILDWRITER_T, null, BOOL], result: VOID },
|
|
978
|
-
"procStream.write": { argTypes: [PROCSTREAM_T, STRING], result: BOOL },
|
|
979
|
-
"child.killed": { argTypes: [CHILD_T], result: BOOL },
|
|
980
|
-
"child.kill": { argTypes: [CHILD_T, STRING], result: BOOL },
|
|
981
|
-
"child.killNum": { argTypes: [CHILD_T, F64], result: BOOL },
|
|
982
|
-
"child.unref": { argTypes: [CHILD_T], result: VOID },
|
|
983
|
-
"child.ref": { argTypes: [CHILD_T], result: VOID },
|
|
984
|
-
"spawnRes.stdout": { argTypes: [SPAWNRES_T], result: STRING },
|
|
985
|
-
"spawnRes.stderr": { argTypes: [SPAWNRES_T], result: STRING },
|
|
986
|
-
"crypto.randomUUID": { argTypes: [], result: STRING },
|
|
987
|
-
"crypto.randomBytesToString": { argTypes: [F64, STRING], result: STRING },
|
|
988
|
-
"crypto.randomBytes": { argTypes: [F64], result: BYTES_U8 },
|
|
989
|
-
"crypto.hashDigestStr": { argTypes: [STRING, STRING, STRING], result: STRING },
|
|
990
|
-
"crypto.hashDigestBytes": { argTypes: [STRING, BYTES_U8, STRING], result: STRING },
|
|
991
|
-
"crypto.native": { argTypes: [], result: DYN },
|
|
992
|
-
"crypto.hashNew": { argTypes: [STRING], result: CRYPTOHASH_T },
|
|
993
|
-
"crypto.hmacNewStr": { argTypes: [STRING, STRING], result: CRYPTOHMAC_T },
|
|
994
|
-
"crypto.hmacNewBytes": { argTypes: [STRING, BYTES_U8], result: CRYPTOHMAC_T },
|
|
995
|
-
"crypto.hashUpdateStr": { argTypes: [CRYPTOHASH_T, STRING], result: CRYPTOHASH_T },
|
|
996
|
-
"crypto.hashUpdateBytes": { argTypes: [CRYPTOHASH_T, BYTES_U8], result: CRYPTOHASH_T },
|
|
997
|
-
"crypto.hmacUpdateStr": { argTypes: [CRYPTOHMAC_T, STRING], result: CRYPTOHMAC_T },
|
|
998
|
-
"crypto.hmacUpdateBytes": { argTypes: [CRYPTOHMAC_T, BYTES_U8], result: CRYPTOHMAC_T },
|
|
999
|
-
"crypto.hashCopy": { argTypes: [CRYPTOHASH_T], result: CRYPTOHASH_T },
|
|
1000
|
-
"crypto.hashDigestString": { argTypes: [CRYPTOHASH_T, STRING], result: STRING },
|
|
1001
|
-
"crypto.hashDigestBuffer": { argTypes: [CRYPTOHASH_T], result: BYTES_U8 },
|
|
1002
|
-
"crypto.hmacDigestString": { argTypes: [CRYPTOHMAC_T, STRING], result: STRING },
|
|
1003
|
-
"crypto.hmacDigestBuffer": { argTypes: [CRYPTOHMAC_T], result: BYTES_U8 },
|
|
1004
|
-
"crypto.timingSafeEqual": { argTypes: [BYTES_U8, BYTES_U8], result: BOOL },
|
|
1005
|
-
"crypto.randomFill": { argTypes: [BYTES_U8, F64, F64], result: BYTES_U8 },
|
|
1006
|
-
"crypto.randomFillRest": { argTypes: [BYTES_U8, F64], result: BYTES_U8 },
|
|
1007
|
-
"crypto.randomInt": { argTypes: [F64, F64], result: F64 },
|
|
1008
|
-
"crypto.pbkdf2": { argTypes: [BYTES_U8, BYTES_U8, F64, F64, STRING], result: BYTES_U8 },
|
|
1009
|
-
"crypto.randomBytesCb": { argTypes: [F64, null], result: VOID },
|
|
1010
|
-
"crypto.pbkdf2Cb": { argTypes: [BYTES_U8, BYTES_U8, F64, F64, STRING, null], result: VOID },
|
|
1011
|
-
"crypto.hkdf": { argTypes: [STRING, BYTES_U8, BYTES_U8, BYTES_U8, F64], result: DYN },
|
|
1012
|
-
"crypto.hkdfCb": { argTypes: [STRING, BYTES_U8, BYTES_U8, BYTES_U8, F64, null], result: VOID },
|
|
1013
|
-
"crypto.scrypt": { argTypes: [BYTES_U8, BYTES_U8, F64, DYN], result: BYTES_U8 },
|
|
1014
|
-
"crypto.scryptCb": { argTypes: [BYTES_U8, BYTES_U8, F64, DYN, null], result: VOID },
|
|
1015
|
-
// The Buffer statics and the fs/zlib Buffer forms: fixed always-u8
|
|
1016
|
-
// signatures (Buffer IS a Uint8Array — one bytes kind).
|
|
1017
|
-
"buffer.fromStr": { argTypes: [STRING, STRING], result: BYTES_U8 },
|
|
1018
|
-
"buffer.brand": { argTypes: [BYTES_U8], result: BYTES_U8 },
|
|
1019
|
-
"buffer.fromDyn": { argTypes: [DYN, STRING], result: BYTES_U8 },
|
|
1020
|
-
"buffer.concat": { argTypes: [arrayOf(BYTES_U8)], result: BYTES_U8 },
|
|
1021
|
-
"buffer.byteLenDyn": { argTypes: [DYN, STRING], result: F64 },
|
|
1022
|
-
"buffer.byteLenStr": { argTypes: [STRING, STRING], result: F64 },
|
|
1023
|
-
"buffer.isEncoding": { argTypes: [STRING], result: BOOL },
|
|
1024
|
-
"buffer.concatLen": { argTypes: [arrayOf(BYTES_U8), F64], result: BYTES_U8 },
|
|
1025
|
-
// The checked-dynamic compare/equals validators (Node's argument
|
|
1026
|
-
// ladders over dyn-boxed invalid-input probes).
|
|
1027
|
-
"buffer.compareChk": { argTypes: [DYN, DYN], result: F64 },
|
|
1028
|
-
"bytes.equalsChk": { argTypes: [BYTES_U8, DYN], result: BOOL },
|
|
1029
|
-
"bytes.compareChk": { argTypes: [BYTES_U8, DYN, DYN, DYN, DYN, DYN], result: F64 },
|
|
1030
|
-
"buffer.newStringFail": { argTypes: [DYN], result: BYTES_U8 },
|
|
1031
|
-
"fs.toUnixTimestamp": { argTypes: [DYN], result: F64 },
|
|
1032
|
-
"fs.existsChk": { argTypes: [DYN, DYN], result: DYN },
|
|
1033
|
-
"fs.mkdtempChk": { argTypes: [DYN, DYN, STRING], result: VOID },
|
|
1034
|
-
"fs.mkdtempSyncChk": { argTypes: [DYN, DYN, STRING], result: STRING },
|
|
1035
|
-
"fs.readFileChk": { argTypes: [DYN, DYN, DYN, STRING], result: VOID },
|
|
1036
|
-
"fs.opendirChk": { argTypes: [DYN, DYN, STRING], result: VOID },
|
|
1037
|
-
"fs.watchFileChk": { argTypes: [DYN, DYN, STRING], result: VOID },
|
|
1038
|
-
"fs.lchmodChk": { argTypes: [DYN, DYN, DYN, STRING], result: VOID },
|
|
1039
|
-
"fs.lchmodSyncChk": { argTypes: [DYN, DYN], result: DYN },
|
|
1040
|
-
"fsp.lchmodChk": { argTypes: [DYN, DYN], result: { kind: "promise", inner: VOID } },
|
|
1041
|
-
"fs.readChk": { argTypes: [DYN, DYN, DYN, DYN, DYN, STRING], result: VOID },
|
|
1042
|
-
"fs.streamOptsChk": { argTypes: [DYN, DYN, STRING], result: VOID },
|
|
1043
|
-
"error.argTypeThrow": { argTypes: [STRING, STRING, DYN], result: VOID },
|
|
1044
|
-
"error.propTypeThrow": { argTypes: [STRING, STRING, DYN], result: VOID },
|
|
1045
|
-
"emitter.setMaxChk": { argTypes: [null, DYN], result: VOID },
|
|
1046
|
-
"emitter.setDefaultMaxChk": { argTypes: [DYN, STRING], result: VOID },
|
|
1047
|
-
"fs.readFileSyncBytes": { argTypes: [STRING], result: BYTES_U8 },
|
|
1048
|
-
"fs.writeFileSyncBytes": { argTypes: [STRING, BYTES_U8], result: VOID },
|
|
1049
|
-
"fs.appendFileSyncBytes": { argTypes: [STRING, BYTES_U8], result: VOID },
|
|
1050
|
-
"fsp.readFileBytes": { argTypes: [STRING], result: { kind: "promise", inner: BYTES_U8 } },
|
|
1051
|
-
"zlib.deflateSync": { argTypes: [BYTES_U8], result: BYTES_U8 },
|
|
1052
|
-
"zlib.inflateSync": { argTypes: [BYTES_U8], result: BYTES_U8 },
|
|
1053
|
-
"zlib.deflateRawSync": { argTypes: [BYTES_U8], result: BYTES_U8 },
|
|
1054
|
-
"zlib.deflateLevelSync": { argTypes: [BYTES_U8, F64, F64], result: BYTES_U8 },
|
|
1055
|
-
"zlib.inflateRawSync": { argTypes: [BYTES_U8], result: BYTES_U8 },
|
|
1056
|
-
"zlib.gzipSync": { argTypes: [BYTES_U8], result: BYTES_U8 },
|
|
1057
|
-
"zlib.gunzipSync": { argTypes: [BYTES_U8], result: BYTES_U8 },
|
|
1058
|
-
"zlib.unzipSync": { argTypes: [BYTES_U8], result: BYTES_U8 },
|
|
1059
|
-
"zlib.deflateCb": { argTypes: [BYTES_U8, null], result: VOID },
|
|
1060
|
-
"zlib.inflateCb": { argTypes: [BYTES_U8, null], result: VOID },
|
|
1061
|
-
"zlib.deflateRawCb": { argTypes: [BYTES_U8, null], result: VOID },
|
|
1062
|
-
"zlib.inflateRawCb": { argTypes: [BYTES_U8, null], result: VOID },
|
|
1063
|
-
"zlib.gzipCb": { argTypes: [BYTES_U8, null], result: VOID },
|
|
1064
|
-
"zlib.gunzipCb": { argTypes: [BYTES_U8, null], result: VOID },
|
|
1065
|
-
"zlib.unzipCb": { argTypes: [BYTES_U8, null], result: VOID },
|
|
1066
|
-
"zlib.crc32": { argTypes: [BYTES_U8, F64], result: F64 },
|
|
1067
|
-
"process.stdoutWriteBytes": { argTypes: [BYTES_U8, STRING], result: BOOL },
|
|
1068
|
-
"process.stderrWriteBytes": { argTypes: [BYTES_U8, STRING], result: BOOL },
|
|
1069
|
-
// Completion callback is program-dependent: zero params, checked-dynamic,
|
|
1070
|
-
// or an optional Error | null slot (same success shape as fs.rename).
|
|
1071
|
-
"process.stdoutWriteBytesCb": { argTypes: [BYTES_U8, STRING, null], result: BOOL },
|
|
1072
|
-
"process.stderrWriteBytesCb": { argTypes: [BYTES_U8, STRING, null], result: BOOL },
|
|
1073
|
-
"fsp.readFile": { argTypes: [STRING, STRING], result: { kind: "promise", inner: STRING } },
|
|
1074
|
-
"fsp.writeFile": { argTypes: [STRING, STRING], result: { kind: "promise", inner: VOID } },
|
|
1075
|
-
"fsp.writeFileMode": { argTypes: [STRING, STRING, F64], result: { kind: "promise", inner: VOID } },
|
|
1076
|
-
"fsp.mkdir": { argTypes: [STRING], result: { kind: "promise", inner: VOID } },
|
|
1077
|
-
"fsp.mkdirMode": { argTypes: [STRING, F64], result: { kind: "promise", inner: VOID } },
|
|
1078
|
-
"fsp.mkdirRecursive": { argTypes: [STRING], result: { kind: "promise", inner: VOID } },
|
|
1079
|
-
"fsp.mkdirRecursiveMode": { argTypes: [STRING, F64], result: { kind: "promise", inner: VOID } },
|
|
1080
|
-
"fsp.unlink": { argTypes: [STRING], result: { kind: "promise", inner: VOID } },
|
|
1081
|
-
"fsp.chmod": { argTypes: [STRING, F64], result: { kind: "promise", inner: VOID } },
|
|
1082
|
-
"fsp.link": { argTypes: [DYN, DYN], result: { kind: "promise", inner: VOID } },
|
|
1083
|
-
"fsp.symlink": { argTypes: [DYN, DYN, DYN], result: { kind: "promise", inner: VOID } },
|
|
1084
|
-
"fsp.readlink": { argTypes: [DYN, DYN], result: { kind: "promise", inner: DYN } },
|
|
1085
|
-
"fsp.statfs": { argTypes: [DYN, DYN], result: { kind: "promise", inner: DYN } },
|
|
1086
|
-
"fsp.readlinkStr": { argTypes: [DYN, DYN], result: { kind: "promise", inner: STRING } },
|
|
1087
|
-
"fsp.readlinkBuffer": { argTypes: [DYN, DYN], result: { kind: "promise", inner: BYTES_U8 } },
|
|
1088
|
-
"fsp.utimes": { argTypes: [DYN, DYN, DYN], result: { kind: "promise", inner: VOID } },
|
|
1089
|
-
"fsp.lutimes": { argTypes: [DYN, DYN, DYN], result: { kind: "promise", inner: VOID } },
|
|
1090
|
-
"fsp.rename": { argTypes: [STRING, STRING], result: { kind: "promise", inner: VOID } },
|
|
1091
|
-
"fsp.readdir": { argTypes: [STRING], result: { kind: "promise", inner: arrayOf(STRING) } },
|
|
1092
|
-
// Result is promise<call-site Dirent record array>; the libCall case
|
|
1093
|
-
// validates the program-dependent record shape below.
|
|
1094
|
-
"fsp.readdirTypes": { argTypes: [STRING], result: { kind: "promise", inner: VOID } },
|
|
1095
|
-
"fsp.rm": { argTypes: [STRING], result: { kind: "promise", inner: VOID } },
|
|
1096
|
-
"fsp.stat": { argTypes: [STRING], result: { kind: "promise", inner: STATS_T } },
|
|
1097
|
-
"fsp.realpath": { argTypes: [STRING], result: { kind: "promise", inner: STRING } },
|
|
1098
|
-
"fsp.lstat": { argTypes: [STRING], result: { kind: "promise", inner: STATS_T } },
|
|
1099
|
-
"fsp.open": { argTypes: [STRING, STRING, F64], result: { kind: "promise", inner: FILEHANDLE_T } },
|
|
1100
|
-
"fileHandle.fd": { argTypes: [FILEHANDLE_T], result: F64 },
|
|
1101
|
-
"fileHandle.close": { argTypes: [FILEHANDLE_T], result: { kind: "promise", inner: VOID } },
|
|
1102
|
-
"fileHandle.sync": { argTypes: [FILEHANDLE_T], result: { kind: "promise", inner: VOID } },
|
|
1103
|
-
"fileHandle.datasync": { argTypes: [FILEHANDLE_T], result: { kind: "promise", inner: VOID } },
|
|
1104
|
-
"fileHandle.truncate": { argTypes: [FILEHANDLE_T, F64], result: { kind: "promise", inner: VOID } },
|
|
1105
|
-
"fileHandle.chmod": { argTypes: [FILEHANDLE_T, F64], result: { kind: "promise", inner: VOID } },
|
|
1106
|
-
"fileHandle.utimes": { argTypes: [FILEHANDLE_T, DYN, DYN], result: { kind: "promise", inner: VOID } },
|
|
1107
|
-
"fileHandle.readv": { argTypes: [FILEHANDLE_T, arrayOf(BYTES_U8), F64], result: { kind: "promise", inner: VOID } },
|
|
1108
|
-
"fileHandle.writev": { argTypes: [FILEHANDLE_T, arrayOf(BYTES_U8), F64], result: { kind: "promise", inner: VOID } },
|
|
1109
|
-
// read/write carry call-site result record shapes; the validator checks
|
|
1110
|
-
// those below, so promise<void> is only a table sentinel.
|
|
1111
|
-
"fileHandle.read": { argTypes: [FILEHANDLE_T, BYTES_U8, F64, F64, F64, BOOL], result: { kind: "promise", inner: VOID } },
|
|
1112
|
-
"fileHandle.writeBytes": { argTypes: [FILEHANDLE_T, BYTES_U8, F64, F64, F64, BOOL], result: { kind: "promise", inner: VOID } },
|
|
1113
|
-
"fileHandle.writeStr": { argTypes: [FILEHANDLE_T, STRING, F64, STRING], result: { kind: "promise", inner: VOID } },
|
|
1114
|
-
"fileHandle.readFile": { argTypes: [FILEHANDLE_T, STRING], result: { kind: "promise", inner: STRING } },
|
|
1115
|
-
"fileHandle.readFileBytes": { argTypes: [FILEHANDLE_T, STRING], result: { kind: "promise", inner: BYTES_U8 } },
|
|
1116
|
-
"fileHandle.writeFile": { argTypes: [FILEHANDLE_T, STRING, STRING], result: { kind: "promise", inner: VOID } },
|
|
1117
|
-
"fileHandle.writeFileBytes": { argTypes: [FILEHANDLE_T, BYTES_U8, STRING], result: { kind: "promise", inner: VOID } },
|
|
1118
|
-
"fileHandle.stat": { argTypes: [FILEHANDLE_T], result: { kind: "promise", inner: STATS_T } },
|
|
1119
|
-
"process.argv": { argTypes: [], result: arrayOf(STRING) },
|
|
1120
|
-
"process.platform": { argTypes: [], result: STRING },
|
|
1121
|
-
// The one libCall whose result type is program-dependent (union ids are
|
|
1122
|
-
// per-module): the `result` here is a placeholder — the libCall case
|
|
1123
|
-
// checks the union's ARMS ([string, undefinedT] in canonical order)
|
|
1124
|
-
// against the module's registry instead.
|
|
1125
|
-
"process.envGet": { argTypes: [STRING], result: VOID },
|
|
1126
|
-
"process.envSet": { argTypes: [STRING, STRING], result: VOID },
|
|
1127
|
-
"process.envUnset": { argTypes: [STRING], result: VOID },
|
|
1128
|
-
"process.envPairs": { argTypes: [], result: arrayOf(STRING) },
|
|
1129
|
-
"process.exit": { argTypes: [F64], result: VOID },
|
|
1130
|
-
"process.setExitCode": { argTypes: [F64], result: VOID },
|
|
1131
|
-
"process.currentExitCode": { argTypes: [], result: F64 },
|
|
1132
|
-
"process.cwd": { argTypes: [], result: STRING },
|
|
1133
|
-
"process.pid": { argTypes: [], result: F64 },
|
|
1134
|
-
"dyn.this": { argTypes: [], result: DYN },
|
|
1135
|
-
"dyn.generatorThis": { argTypes: [], result: DYN },
|
|
1136
|
-
"process.getuid": { argTypes: [], result: F64 },
|
|
1137
|
-
"process.getgid": { argTypes: [], result: F64 },
|
|
1138
|
-
"process.execPath": { argTypes: [], result: STRING },
|
|
1139
|
-
"process.arch": { argTypes: [], result: STRING },
|
|
1140
|
-
"process.versions": { argTypes: [], result: DYN },
|
|
1141
|
-
"process.builtinId": { argTypes: [DYN, arrayOf(STRING)], result: STRING },
|
|
1142
|
-
"process.builtinModule": { argTypes: [STRING, DYN], result: DYN },
|
|
1143
|
-
"process.builtinUnsupported": { argTypes: [STRING, STRING], result: DYN },
|
|
1144
|
-
"fs.callbackValue": { argTypes: [STRING], result: DYN },
|
|
1145
|
-
"fs.callbackCall": { argTypes: [STRING, DYN], result: DYN },
|
|
1146
|
-
"process.hrtimeValue": { argTypes: [], result: DYN },
|
|
1147
|
-
"process.versionsNode": { argTypes: [], result: STRING },
|
|
1148
|
-
"process.versionsOpenssl": { argTypes: [], result: STRING },
|
|
1149
|
-
"process.kill": { argTypes: [F64, STRING], result: BOOL },
|
|
1150
|
-
"process.killNum": { argTypes: [F64, F64], result: BOOL },
|
|
1151
|
-
"process.stdoutWrite": { argTypes: [STRING], result: BOOL },
|
|
1152
|
-
"process.stdio": { argTypes: [F64], result: DYN },
|
|
1153
|
-
"process.stderrWrite": { argTypes: [STRING], result: BOOL },
|
|
1154
|
-
// error.new's result and the receiver slots are builtin-error classes —
|
|
1155
|
-
// program-dependent object types, checked in the libCall case.
|
|
1156
|
-
"error.new": { argTypes: [STRING], result: VOID },
|
|
1157
|
-
"error.newOptions": { argTypes: [DYN, DYN], result: VOID },
|
|
1158
|
-
"error.ctorOptions": { argTypes: [null, DYN, DYN], result: VOID },
|
|
1159
|
-
"error.cause": { argTypes: [null], result: DYN },
|
|
1160
|
-
"error.hasCause": { argTypes: [null], result: BOOL },
|
|
1161
|
-
"error.setCause": { argTypes: [null, DYN], result: VOID },
|
|
1162
|
-
"error.defineCause": { argTypes: [null, DYN], result: VOID },
|
|
1163
|
-
"error.deleteCause": { argTypes: [null], result: VOID },
|
|
1164
|
-
"error.nodeThrow": { argTypes: [F64, STRING, STRING], result: VOID },
|
|
1165
|
-
"dyn.toStringCoerce": { argTypes: [DYN], result: STRING },
|
|
1166
|
-
"dyn.stringConstructor": { argTypes: [DYN], result: STRING },
|
|
1167
|
-
"dyn.propertyKey": { argTypes: [DYN], result: DYN },
|
|
1168
|
-
"dyn.toNumeric": { argTypes: [DYN], result: DYN },
|
|
1169
|
-
"dyn.increment": { argTypes: [DYN, BOOL], result: DYN },
|
|
1170
|
-
"dyn.numberConstructor": { argTypes: [DYN], result: F64 },
|
|
1171
|
-
"dyn.bigintConstructor": { argTypes: [DYN], result: BIGINT_T },
|
|
1172
|
-
"dyn.toNumberCoerce": { argTypes: [DYN], result: F64 },
|
|
1173
|
-
"dyn.add": { argTypes: [DYN, DYN], result: DYN },
|
|
1174
|
-
"dyn.arithmetic": { argTypes: [DYN, DYN, STRING], result: DYN },
|
|
1175
|
-
"dyn.compare": { argTypes: [DYN, DYN, STRING], result: BOOL },
|
|
1176
|
-
"dyn.bitwise": { argTypes: [DYN, DYN, STRING], result: DYN },
|
|
1177
|
-
"dyn.proxyNew": { argTypes: [DYN, DYN], result: DYN },
|
|
1178
|
-
// Always throws; the result is the READ's declared type (a typed dummy
|
|
1179
|
-
// the unwind abandons) — the libCall case skips the result check.
|
|
1180
|
-
"global.undefRead": { argTypes: [STRING], result: VOID },
|
|
1181
|
-
"console.native": { argTypes: [], result: DYN },
|
|
1182
|
-
"global.native": { argTypes: [arrayOf(STRING)], result: DYN },
|
|
1183
|
-
// `X.name` through a class value: the arg is a program-dependent
|
|
1184
|
-
// classval (a null slot; the libCall case checks the kind).
|
|
1185
|
-
"class.name": { argTypes: [null], result: STRING },
|
|
1186
|
-
"error.ctor": { argTypes: [null, STRING], result: VOID },
|
|
1187
|
-
"error.toString": { argTypes: [null], result: STRING },
|
|
1188
|
-
"dyn.sameValue": { argTypes: [DYN, DYN], result: BOOL },
|
|
1189
|
-
"error.stack": { argTypes: [null], result: STRING },
|
|
1190
|
-
"error.stackLimitGet": { argTypes: [], result: F64 },
|
|
1191
|
-
"error.stackLimitSet": { argTypes: [F64], result: VOID },
|
|
1192
|
-
// Receiver (any error-hierarchy object) and the program-dependent
|
|
1193
|
-
// `string | undefined` result are checked in the libCall case.
|
|
1194
|
-
"error.code": { argTypes: [null], result: VOID },
|
|
1195
|
-
// DOMException: construction takes the two dyn args (WebIDL's
|
|
1196
|
-
// resolution runs in the runtime); the %DOMException result is a
|
|
1197
|
-
// program-dependent object type, checked in the libCall case. The
|
|
1198
|
-
// read surface takes the %DOMException receiver (a null slot — the
|
|
1199
|
-
// libCall case checks the class name).
|
|
1200
|
-
"error.newDom": { argTypes: [DYN, DYN], result: VOID },
|
|
1201
|
-
"error.domCode": { argTypes: [null], result: F64 },
|
|
1202
|
-
"error.domHasCause": { argTypes: [null], result: BOOL },
|
|
1203
|
-
"error.domCause": { argTypes: [null], result: DYN },
|
|
1204
|
-
"error.domClone": { argTypes: [null, DYN], result: VOID },
|
|
1205
|
-
"dyn.errInstanceof": { argTypes: [DYN, F64], result: BOOL },
|
|
1206
|
-
"weakMap.is": { argTypes: [DYN], result: BOOL },
|
|
1207
|
-
"weakSet.is": { argTypes: [DYN], result: BOOL },
|
|
1208
|
-
"weakMap.new": { argTypes: [DYN], result: DYN },
|
|
1209
|
-
"weakSet.new": { argTypes: [DYN], result: DYN },
|
|
1210
|
-
"dyn.fromEntries": { argTypes: [DYN], result: DYN },
|
|
1211
|
-
"bytes.constructor": { argTypes: [STRING], result: DYN },
|
|
1212
|
-
"bytes.instanceOf": { argTypes: [DYN, DYN], result: BOOL },
|
|
1213
|
-
"bytes.construct": { argTypes: [DYN, DYN, STRING], result: DYN },
|
|
1214
|
-
"dyn.dataViewIs": { argTypes: [DYN], result: BOOL },
|
|
1215
|
-
"dyn.construct": { argTypes: [DYN, DYN, STRING], result: DYN },
|
|
1216
|
-
"arrayBuffer.constructor": { argTypes: [], result: DYN },
|
|
1217
|
-
"arrayBuffer.new": { argTypes: [DYN], result: DYN },
|
|
1218
|
-
"ffi.argument": { argTypes: [DYN, STRING], result: DYN },
|
|
1219
|
-
"ffi.memoryModule": { argTypes: [DYN], result: DYN },
|
|
1220
|
-
"intl.segmenterNew": { argTypes: [], result: DYN },
|
|
1221
|
-
"arrayBuffer.is": { argTypes: [DYN], result: BOOL },
|
|
1222
|
-
"arrayBuffer.isView": { argTypes: [DYN], result: BOOL },
|
|
1223
|
-
"arrayBuffer.byteLengthGetter": { argTypes: [], result: F64 },
|
|
1224
|
-
"arrayBuffer.byteLengthDescriptor": { argTypes: [DYN], result: DYN },
|
|
1225
|
-
"arrayBuffer.viewU8C": { argTypes: [DYN, DYN, DYN], result: bytesOf("u8c") },
|
|
1226
|
-
"arrayBuffer.viewI8": { argTypes: [DYN, DYN, DYN], result: bytesOf("i8") },
|
|
1227
|
-
"arrayBuffer.viewU16": { argTypes: [DYN, DYN, DYN], result: bytesOf("u16") },
|
|
1228
|
-
"arrayBuffer.viewI16": { argTypes: [DYN, DYN, DYN], result: bytesOf("i16") },
|
|
1229
|
-
"arrayBuffer.viewU8": { argTypes: [DYN, DYN, DYN], result: BYTES_U8 },
|
|
1230
|
-
"arrayBuffer.viewU32": { argTypes: [DYN, DYN, DYN], result: bytesOf("u32") },
|
|
1231
|
-
"arrayBuffer.viewI32": { argTypes: [DYN, DYN, DYN], result: bytesOf("i32") },
|
|
1232
|
-
"arrayBuffer.viewF32": { argTypes: [DYN, DYN, DYN], result: bytesOf("f32") },
|
|
1233
|
-
"arrayBuffer.viewF64": { argTypes: [DYN, DYN, DYN], result: bytesOf("f64") },
|
|
1234
|
-
"arrayBuffer.viewDV": { argTypes: [DYN, DYN, DYN], result: BYTES_U8 },
|
|
1235
|
-
"dyn.objKeys": { argTypes: [DYN], result: DYN },
|
|
1236
|
-
"dyn.forInKeys": { argTypes: [DYN], result: DYN },
|
|
1237
|
-
"dyn.hasOwn": { argTypes: [DYN, STRING], result: BOOL },
|
|
1238
|
-
"dyn.propertyIsEnumerable": { argTypes: [DYN, STRING], result: BOOL },
|
|
1239
|
-
"dyn.assign": { argTypes: [DYN, DYN], result: DYN },
|
|
1240
|
-
"dyn.copyDataProperties": { argTypes: [DYN, DYN], result: DYN },
|
|
1241
|
-
"dyn.objectRest": { argTypes: [DYN, DYN], result: DYN },
|
|
1242
|
-
"dyn.packPush": { argTypes: [DYN, DYN], result: VOID },
|
|
1243
|
-
"dyn.packPushSpread": { argTypes: [DYN, DYN, STRING], result: VOID },
|
|
1244
|
-
"dyn.packPushSpreadIter": { argTypes: [DYN, DYN], result: VOID },
|
|
1245
|
-
"dyn.reflectApply": { argTypes: [DYN, DYN, DYN], result: DYN },
|
|
1246
|
-
"dyn.reflectGet": { argTypes: [DYN, DYN, DYN], result: DYN },
|
|
1247
|
-
"dyn.reflectSet": { argTypes: [DYN, DYN, DYN, DYN], result: BOOL },
|
|
1248
|
-
"dyn.reflectDefine": { argTypes: [DYN, DYN, DYN], result: BOOL },
|
|
1249
|
-
"dyn.abstractEq": { argTypes: [DYN, DYN], result: BOOL },
|
|
1250
|
-
"dyn.assignAll": { argTypes: [DYN, DYN], result: DYN },
|
|
1251
|
-
"dyn.objCreateNullProto": { argTypes: [], result: DYN },
|
|
1252
|
-
"dyn.arrayPrototype": { argTypes: [], result: DYN },
|
|
1253
|
-
"dyn.arrayConstructor": { argTypes: [], result: DYN },
|
|
1254
|
-
"dyn.objectPrototype": { argTypes: [], result: DYN },
|
|
1255
|
-
"dyn.functionApply": { argTypes: [], result: DYN },
|
|
1256
|
-
"dyn.builtinMethod": { argTypes: [STRING, STRING], result: DYN },
|
|
1257
|
-
"dyn.classPrototype": { argTypes: [DYN, DYN], result: DYN },
|
|
1258
|
-
"dyn.classBasePrototype": { argTypes: [DYN], result: DYN },
|
|
1259
|
-
"dyn.classInherit": { argTypes: [DYN, DYN], result: DYN },
|
|
1260
|
-
"dyn.classSuper": { argTypes: [DYN, DYN, DYN], result: VOID },
|
|
1261
|
-
"dyn.assignPrototype": { argTypes: [DYN, DYN, DYN], result: DYN },
|
|
1262
|
-
"dyn.definePrototypeProps": { argTypes: [DYN, DYN, DYN], result: DYN },
|
|
1263
|
-
"dyn.bagGet": { argTypes: [DYN, STRING, DYN], result: DYN },
|
|
1264
|
-
"dyn.bagSet": { argTypes: [DYN, STRING, DYN, DYN], result: VOID },
|
|
1265
|
-
"dyn.objCreate": { argTypes: [DYN], result: DYN },
|
|
1266
|
-
"dyn.objCreateWithProperties": { argTypes: [DYN, DYN], result: DYN },
|
|
1267
|
-
"dyn.getPrototype": { argTypes: [DYN], result: DYN },
|
|
1268
|
-
"dyn.setPrototype": { argTypes: [DYN, DYN], result: DYN },
|
|
1269
|
-
"dyn.getOwnPropertyNames": { argTypes: [DYN], result: DYN },
|
|
1270
|
-
"dyn.ownKeys": { argTypes: [DYN], result: DYN },
|
|
1271
|
-
"dyn.getOwnPropertySymbols": { argTypes: [DYN], result: DYN },
|
|
1272
|
-
"dyn.getOwnPropertyDescriptors": { argTypes: [DYN], result: DYN },
|
|
1273
|
-
"dyn.preventExtensions": { argTypes: [DYN], result: DYN },
|
|
1274
|
-
"dyn.isExtensible": { argTypes: [DYN], result: BOOL },
|
|
1275
|
-
"dyn.seal": { argTypes: [DYN], result: DYN },
|
|
1276
|
-
"dyn.isSealed": { argTypes: [DYN], result: BOOL },
|
|
1277
|
-
"dyn.objValues": { argTypes: [DYN], result: DYN },
|
|
1278
|
-
"dyn.objEntries": { argTypes: [DYN], result: DYN },
|
|
1279
|
-
"dyn.structuredClone": { argTypes: [DYN, DYN], result: DYN },
|
|
1280
|
-
"dyn.cloneMissing": { argTypes: [], result: DYN },
|
|
1281
|
-
"dyn.cloneTransferFail": { argTypes: [], result: DYN },
|
|
1282
|
-
"regex.new": { argTypes: [STRING, STRING], result: REGEX },
|
|
1283
|
-
"regex.resetLastIndex": { argTypes: [REGEX, F64], result: VOID },
|
|
1284
|
-
"regex.newChecked": { argTypes: [DYN, DYN], result: REGEX },
|
|
1285
|
-
// node:events EventEmitter: receivers are emitter-hierarchy objects and
|
|
1286
|
-
// the chaining forms (on/off/removeAll/setMax) return the receiver's
|
|
1287
|
-
// own class — program-dependent object types, checked in the libCall
|
|
1288
|
-
// case. emitter.emit is the one VARIADIC libCall: args beyond
|
|
1289
|
-
// (recv, name) are the event's frontend-unified tuple, any borrowable
|
|
1290
|
-
// kind — the count check admits a longer list for it alone.
|
|
1291
|
-
"emitter.new": { argTypes: [], result: VOID },
|
|
1292
|
-
"emitter.ctor": { argTypes: [null], result: VOID },
|
|
1293
|
-
"emitter.on": { argTypes: [null, STRING, null, BOOL, BOOL], result: VOID },
|
|
1294
|
-
"emitter.off": { argTypes: [null, STRING, null], result: VOID },
|
|
1295
|
-
// The dyn-adapted registration family (JS-lane checked-dynamic
|
|
1296
|
-
// listeners): checkListener has NO receiver (it validates the listener
|
|
1297
|
-
// argument alone); onDyn carries (recv, name, cb dyn, adapter func,
|
|
1298
|
-
// once, prepend), offDyn (recv, name, cb dyn).
|
|
1299
|
-
"emitter.checkListener": { argTypes: [DYN], result: VOID },
|
|
1300
|
-
"emitter.onDyn": { argTypes: [null, STRING, DYN, null, BOOL, BOOL], result: VOID },
|
|
1301
|
-
"emitter.onFlex": { argTypes: [null, STRING, DYN, BOOL, BOOL], result: VOID },
|
|
1302
|
-
"emitter.offDyn": { argTypes: [null, STRING, DYN], result: VOID },
|
|
1303
|
-
"emitter.removeAll": { argTypes: [null, STRING, BOOL], result: VOID },
|
|
1304
|
-
"emitter.emit": { argTypes: [null, STRING], result: BOOL },
|
|
1305
|
-
"emitter.emitFlex": { argTypes: [null, STRING], result: BOOL },
|
|
1306
|
-
"emitter.emitError": { argTypes: [null, STRING, null], result: BOOL },
|
|
1307
|
-
"emitter.count": { argTypes: [null, STRING], result: F64 },
|
|
1308
|
-
"emitter.countFn": { argTypes: [null, STRING, null], result: F64 },
|
|
1309
|
-
"emitter.countDyn": { argTypes: [null, STRING, DYN], result: F64 },
|
|
1310
|
-
"emitter.names": { argTypes: [null], result: VOID },
|
|
1311
|
-
"emitter.listeners": { argTypes: [null, STRING], result: VOID },
|
|
1312
|
-
"emitter.onData": { argTypes: [null, STRING, null, BOOL, BOOL], result: VOID },
|
|
1313
|
-
"emitter.onDataDyn": { argTypes: [null, STRING, DYN, null, BOOL, BOOL], result: VOID },
|
|
1314
|
-
"emitter.emitData": { argTypes: [null, STRING, null], result: BOOL },
|
|
1315
|
-
"emitter.setMax": { argTypes: [null, F64], result: VOID },
|
|
1316
|
-
"emitter.getMax": { argTypes: [null], result: F64 },
|
|
1317
|
-
"emitter.setDefaultMax": { argTypes: [F64], result: VOID },
|
|
1318
|
-
"emitter.getDefaultMax": { argTypes: [], result: F64 },
|
|
1319
|
-
// node:stream: receivers are stream-hierarchy objects and several
|
|
1320
|
-
// results are program-dependent (the receiver's class, unions) — the
|
|
1321
|
-
// libCall case owns those checks. The constructors and a few methods
|
|
1322
|
-
// are VARIADIC (trailing option callbacks / the optional chunk+cb tail):
|
|
1323
|
-
// argTypes here is the fixed prefix, VARIADIC_LIB_FNS admits the rest.
|
|
1324
|
-
"readable.new": { argTypes: [F64, BOOL, BOOL, F64], result: VOID },
|
|
1325
|
-
"writable.new": { argTypes: [F64, BOOL, BOOL, F64], result: VOID },
|
|
1326
|
-
"duplex.new": { argTypes: [F64, F64, BOOL, BOOL, BOOL, BOOL, BOOL, F64], result: VOID },
|
|
1327
|
-
"transform.new": { argTypes: [F64, F64, BOOL, BOOL, BOOL, BOOL, BOOL, F64], result: VOID },
|
|
1328
|
-
"passthrough.new": { argTypes: [F64, F64, BOOL, BOOL, BOOL, BOOL, BOOL, F64], result: VOID },
|
|
1329
|
-
// The subclass-initialization twins: the borrowed receiver leads, then
|
|
1330
|
-
// the .new tail (variadic callbacks likewise).
|
|
1331
|
-
// The dyn-options twins: newDyn takes the record, initDyn the borrowed
|
|
1332
|
-
// receiver + record + fallback flags (trailing wrapper closures ride
|
|
1333
|
-
// the variadic tail like the static forms).
|
|
1334
|
-
"stream.setRead": { argTypes: [null, null], result: VOID },
|
|
1335
|
-
"stream.setWrite": { argTypes: [null, null], result: VOID },
|
|
1336
|
-
"stream.setFinal": { argTypes: [null, null], result: VOID },
|
|
1337
|
-
"stream.setDestroy": { argTypes: [null, null], result: VOID },
|
|
1338
|
-
"stream.setTransform": { argTypes: [null, null], result: VOID },
|
|
1339
|
-
"stream.setFlush": { argTypes: [null, null], result: VOID },
|
|
1340
|
-
"stream.finished": { argTypes: [null, null], result: VOID },
|
|
1341
|
-
"stream.finishedDyn": { argTypes: [null, DYN], result: VOID },
|
|
1342
|
-
"stream.pipeline": { argTypes: [F64], result: VOID },
|
|
1343
|
-
"stream.pipelineDyn": { argTypes: [F64], result: VOID },
|
|
1344
|
-
"sp.finished": { argTypes: [null], result: { kind: "promise", inner: VOID } },
|
|
1345
|
-
"sp.pipeline": { argTypes: [F64], result: { kind: "promise", inner: VOID } },
|
|
1346
|
-
"sc.text": { argTypes: [null], result: { kind: "promise", inner: STRING } },
|
|
1347
|
-
"sc.json": { argTypes: [null], result: { kind: "promise", inner: DYN } },
|
|
1348
|
-
"sc.buffer": { argTypes: [null], result: { kind: "promise", inner: BYTES_U8 } },
|
|
1349
|
-
"readable.newDyn": { argTypes: [DYN], result: VOID },
|
|
1350
|
-
"writable.newDyn": { argTypes: [DYN], result: VOID },
|
|
1351
|
-
"duplex.newDyn": { argTypes: [DYN], result: VOID },
|
|
1352
|
-
"transform.newDyn": { argTypes: [DYN], result: VOID },
|
|
1353
|
-
"passthrough.newDyn": { argTypes: [DYN], result: VOID },
|
|
1354
|
-
"readable.initDyn": { argTypes: [null, DYN, F64], result: VOID },
|
|
1355
|
-
"writable.initDyn": { argTypes: [null, DYN, F64], result: VOID },
|
|
1356
|
-
"duplex.initDyn": { argTypes: [null, DYN, F64], result: VOID },
|
|
1357
|
-
"transform.initDyn": { argTypes: [null, DYN, F64], result: VOID },
|
|
1358
|
-
"passthrough.initDyn": { argTypes: [null, DYN, F64], result: VOID },
|
|
1359
|
-
"readable.init": { argTypes: [null, F64, BOOL, BOOL, F64], result: VOID },
|
|
1360
|
-
"writable.init": { argTypes: [null, F64, BOOL, BOOL, F64], result: VOID },
|
|
1361
|
-
"duplex.init": { argTypes: [null, F64, F64, BOOL, BOOL, BOOL, BOOL, BOOL, F64], result: VOID },
|
|
1362
|
-
"transform.init": { argTypes: [null, F64, F64, BOOL, BOOL, BOOL, BOOL, BOOL, F64], result: VOID },
|
|
1363
|
-
"passthrough.init": { argTypes: [null, F64, F64, BOOL, BOOL, BOOL, BOOL, BOOL, F64], result: VOID },
|
|
1364
|
-
"readable.push": { argTypes: [null, BYTES_U8], result: BOOL },
|
|
1365
|
-
"readable.pushStr": { argTypes: [null, STRING], result: BOOL },
|
|
1366
|
-
"readable.pushNull": { argTypes: [null], result: BOOL },
|
|
1367
|
-
"readable.pushU": { argTypes: [null, null], result: BOOL },
|
|
1368
|
-
"readable.pushDyn": { argTypes: [null, DYN], result: BOOL },
|
|
1369
|
-
"readable.unshift": { argTypes: [null, BYTES_U8], result: VOID },
|
|
1370
|
-
"readable.unshiftStr": { argTypes: [null, STRING], result: VOID },
|
|
1371
|
-
"stream.onDyn": { argTypes: [null, STRING, DYN, BOOL, BOOL], result: VOID },
|
|
1372
|
-
"readable.readDyn": { argTypes: [null, DYN], result: DYN },
|
|
1373
|
-
"readable.read": { argTypes: [null, F64], result: VOID },
|
|
1374
|
-
"readable.pause": { argTypes: [null], result: VOID },
|
|
1375
|
-
"readable.setEncoding": { argTypes: [null, STRING], result: VOID },
|
|
1376
|
-
"readable.pushStrEnc": { argTypes: [null, STRING, STRING], result: BOOL },
|
|
1377
|
-
"readable.pushEncoding": { argTypes: [null, STRING], result: VOID },
|
|
1378
|
-
"readable.nextChunk": { argTypes: [null], result: VOID },
|
|
1379
|
-
"readable.nextChunkDyn": { argTypes: [null], result: VOID },
|
|
1380
|
-
"readable.fromArr": { argTypes: [null, BOOL], result: VOID },
|
|
1381
|
-
"readable.resume": { argTypes: [null], result: VOID },
|
|
1382
|
-
"readable.isPaused": { argTypes: [null], result: BOOL },
|
|
1383
|
-
"readable.pipe": { argTypes: [null, null, BOOL], result: VOID },
|
|
1384
|
-
"readable.unpipe": { argTypes: [null], result: VOID },
|
|
1385
|
-
"readable.flowing": { argTypes: [null], result: VOID },
|
|
1386
|
-
"writable.write": { argTypes: [null, BYTES_U8], result: BOOL },
|
|
1387
|
-
"writable.writeStr": { argTypes: [null, STRING], result: BOOL },
|
|
1388
|
-
"writable.writeU": { argTypes: [null, null], result: BOOL },
|
|
1389
|
-
"writable.writeDyn": { argTypes: [null, DYN], result: BOOL },
|
|
1390
|
-
"writable.end": { argTypes: [null, F64], result: VOID },
|
|
1391
|
-
"writable.cork": { argTypes: [null], result: VOID },
|
|
1392
|
-
"writable.uncork": { argTypes: [null], result: VOID },
|
|
1393
|
-
"stream.destroy": { argTypes: [null], result: VOID },
|
|
1394
|
-
"stream.destroyErr": { argTypes: [null, null], result: VOID },
|
|
1395
|
-
"stream.iteratorClose": { argTypes: [null], result: VOID },
|
|
1396
|
-
"stream.prop": { argTypes: [null, STRING], result: VOID },
|
|
1397
|
-
"stream.errored": { argTypes: [null], result: VOID },
|
|
1398
|
-
// node:assert: pass/negated/deep/hasMsg are frontend-computed bools; the
|
|
1399
|
-
// message slot always carries a string ("" when hasMsg is false).
|
|
1400
|
-
"assert.ok": { argTypes: [BOOL, STRING], result: VOID },
|
|
1401
|
-
"assert.eqF64": { argTypes: [F64, F64, BOOL, BOOL, STRING, BOOL], result: VOID },
|
|
1402
|
-
"assert.eqBigInt": { argTypes: [BIGINT_T, BIGINT_T, BOOL, BOOL, STRING, BOOL], result: VOID },
|
|
1403
|
-
"assert.eqStr": { argTypes: [STRING, STRING, BOOL, BOOL, STRING, BOOL], result: VOID },
|
|
1404
|
-
"assert.eqBool": { argTypes: [BOOL, BOOL, BOOL, BOOL, STRING, BOOL], result: VOID },
|
|
1405
|
-
"assert.deepResult": { argTypes: [BOOL, BOOL, STRING, BOOL], result: VOID },
|
|
1406
|
-
"assert.sameValue": { argTypes: [F64, F64], result: BOOL },
|
|
1407
|
-
// The deep-equality pair memo: both slots are program-dependent
|
|
1408
|
-
// (any cycle-capable record/array/map type).
|
|
1409
|
-
"assert.deqEnter": { argTypes: [null, null], result: BOOL },
|
|
1410
|
-
"assert.deqLeave": { argTypes: [], result: VOID },
|
|
1411
|
-
"assert.match": { argTypes: [STRING, REGEX, BOOL, STRING, BOOL], result: VOID },
|
|
1412
|
-
"assert.throwsNone": { argTypes: [BOOL, STRING, BOOL, STRING, BOOL], result: VOID },
|
|
1413
|
-
"assert.throwsMismatch": { argTypes: [STRING, { kind: "object", className: "%Error" }, STRING, BOOL], result: VOID },
|
|
1414
|
-
"assert.throwsRegex": { argTypes: [REGEX, { kind: "object", className: "%Error" }, STRING, BOOL], result: VOID },
|
|
1415
|
-
// Symbol strict equality (pointer identity; scr_symbol.c).
|
|
1416
|
-
"assert.eqSym": { argTypes: [{ kind: "symbol" }, { kind: "symbol" }, BOOL, BOOL, STRING, BOOL], result: VOID },
|
|
1417
|
-
// The equality quartet over checked-dynamic operands (the frontend
|
|
1418
|
-
// boxes a static side into the checked-dynamic tree first).
|
|
1419
|
-
"assert.eqDyn": { argTypes: [DYN, DYN, BOOL, BOOL, STRING, BOOL], result: VOID },
|
|
1420
|
-
"assert.looseResult": { argTypes: [BOOL, BOOL, STRING, STRING, STRING, BOOL], result: VOID },
|
|
1421
|
-
// The throws(fn, {shape}) accumulator: begin/slot calls never throw;
|
|
1422
|
-
// shapeEnd throws the Comparison diff. The error slot is the
|
|
1423
|
-
// %Error-narrowed caught value.
|
|
1424
|
-
"assert.shapeBegin": { argTypes: [{ kind: "object", className: "%Error" }], result: VOID },
|
|
1425
|
-
"assert.shapeStr": { argTypes: [F64, STRING], result: VOID },
|
|
1426
|
-
"assert.shapeRe": { argTypes: [F64, REGEX], result: VOID },
|
|
1427
|
-
"assert.shapeEnd": { argTypes: [STRING, BOOL], result: VOID },
|
|
1428
|
-
"assert.regexErrTest": { argTypes: [REGEX, { kind: "object", className: "%Error" }], result: BOOL },
|
|
1429
|
-
"assert.unwantedRejection": { argTypes: [{ kind: "object", className: "%Error" }, STRING, BOOL], result: VOID },
|
|
1430
|
-
"assert.unwantedError": { argTypes: [STRING, BOOL, STRING, BOOL], result: VOID },
|
|
1431
|
-
"assert.noErrorPredicate": { argTypes: [DYN, DYN], result: BOOL },
|
|
1432
|
-
"assert.regexDynTest": { argTypes: [REGEX, DYN], result: BOOL },
|
|
1433
|
-
"assert.expectsErrDyn": { argTypes: [DYN, DYN, STRING, BOOL], result: VOID },
|
|
1434
|
-
// assert.ifError's typed entries (always throw; unit args never
|
|
1435
|
-
// lower). The error slot is program-dependent — any %Error-hierarchy
|
|
1436
|
-
// class, root or subclass (the insp.error precedent, null slot).
|
|
1437
|
-
"assert.ifErrorErr": { argTypes: [null], result: VOID },
|
|
1438
|
-
"assert.ifErrorF64": { argTypes: [F64], result: VOID },
|
|
1439
|
-
"assert.ifErrorStr": { argTypes: [STRING], result: VOID },
|
|
1440
|
-
"assert.ifErrorBool": { argTypes: [BOOL], result: VOID },
|
|
1441
|
-
"assert.ifErrorDyn": { argTypes: [DYN], result: VOID },
|
|
1442
|
-
// Bytes equality: the two value slots are any bytes kind (the frontend
|
|
1443
|
-
// gates both sides to ONE static bytes type; the libCall case checks
|
|
1444
|
-
// the kind and the pair below).
|
|
1445
|
-
"assert.refEqBytes": { argTypes: [null, null, BOOL, BOOL, STRING, BOOL], result: VOID },
|
|
1446
|
-
"assert.refEqFn": { argTypes: [null, null, BOOL, STRING, BOOL], result: VOID },
|
|
1447
|
-
"assert.bytesDeepEq": { argTypes: [null, null, BOOL], result: BOOL },
|
|
1448
|
-
// util.inspect: the error receiver is program-dependent (a builtin or
|
|
1449
|
-
// user error class — the error.toString precedent, null slot).
|
|
1450
|
-
"insp.f64": { argTypes: [F64], result: STRING },
|
|
1451
|
-
"insp.jsonDyn": { argTypes: [DYN], result: STRING },
|
|
1452
|
-
"insp.str": { argTypes: [STRING], result: STRING },
|
|
1453
|
-
"insp.regex": { argTypes: [REGEX], result: STRING },
|
|
1454
|
-
"insp.buffer": { argTypes: [BYTES_U8], result: STRING },
|
|
1455
|
-
"insp.error": { argTypes: [null, F64, F64], result: STRING },
|
|
1456
|
-
"insp.dyn": { argTypes: [DYN, F64, F64], result: STRING },
|
|
1457
|
-
"insp.dynS": { argTypes: [DYN, F64], result: STRING },
|
|
1458
|
-
"insp.jsval": { argTypes: [JSVAL, F64, F64], result: STRING },
|
|
1459
|
-
"insp.begin": { argTypes: [F64], result: VOID },
|
|
1460
|
-
"insp.entry": { argTypes: [STRING, BOOL], result: VOID },
|
|
1461
|
-
// Circular references: the receiver slot is program-dependent (any
|
|
1462
|
-
// cycle-capable record/array/map/class type — the insp.error precedent).
|
|
1463
|
-
"insp.circCheck": { argTypes: [null], result: F64 },
|
|
1464
|
-
"insp.seenPush": { argTypes: [null], result: VOID },
|
|
1465
|
-
"insp.refWrap": { argTypes: [null, STRING], result: STRING },
|
|
1466
|
-
"insp.circular": { argTypes: [F64], result: STRING },
|
|
1467
|
-
"insp.key": { argTypes: [STRING], result: STRING },
|
|
1468
|
-
"insp.moreItems": { argTypes: [F64], result: STRING },
|
|
1469
|
-
"insp.end": { argTypes: [STRING, STRING, STRING, F64, BOOL, BOOL], result: STRING },
|
|
1470
|
-
"strdec.write": { argTypes: [STRING, F64, BYTES_U8], result: STRING },
|
|
1471
|
-
"strdec.next": { argTypes: [STRING, F64, BYTES_U8], result: F64 },
|
|
1472
|
-
"strdec.end": { argTypes: [STRING, F64], result: STRING },
|
|
1473
|
-
// node:readline: the interface handle is f64; the callbacks' func types
|
|
1474
|
-
// are program-dependent (zero-param or (answer: string) — the emitter
|
|
1475
|
-
// picks the adapter), so those slots are null like child.onExit's.
|
|
1476
|
-
"rl.create": { argTypes: [], result: F64 },
|
|
1477
|
-
"rl.question": { argTypes: [F64, STRING, null], result: VOID },
|
|
1478
|
-
"rl.close": { argTypes: [F64], result: VOID },
|
|
1479
|
-
"rl.onClose": { argTypes: [F64, null], result: VOID },
|
|
1480
|
-
"tp.setTimeout": { argTypes: [F64], result: { kind: "promise", inner: VOID } },
|
|
1481
|
-
"tp.setImmediate": { argTypes: [], result: { kind: "promise", inner: VOID } },
|
|
1482
|
-
"dc.channel": { argTypes: [STRING], result: F64 },
|
|
1483
|
-
"dc.subscribe": { argTypes: [STRING, DYN], result: VOID },
|
|
1484
|
-
"dc.unsubscribe": { argTypes: [STRING, DYN], result: BOOL },
|
|
1485
|
-
"dc.hasSubscribers": { argTypes: [STRING], result: BOOL },
|
|
1486
|
-
"dc.publish": { argTypes: [F64, DYN], result: VOID },
|
|
1487
|
-
"dc.chanSubscribe": { argTypes: [F64, DYN], result: VOID },
|
|
1488
|
-
"dc.chanUnsubscribe": { argTypes: [F64, DYN], result: BOOL },
|
|
1489
|
-
"dc.chanHasSubscribers": { argTypes: [F64], result: BOOL },
|
|
1490
|
-
"dc.chanName": { argTypes: [F64], result: STRING },
|
|
1491
|
-
"timers.setImmediateFnValue": { argTypes: [], result: DYN },
|
|
1492
|
-
"timers.immediatePromise": { argTypes: [], result: { kind: "promise", inner: DYN } },
|
|
1493
|
-
"dc.tracingChannel": { argTypes: [STRING], result: F64 },
|
|
1494
|
-
"dc.tracingChannelOf": { argTypes: [F64, F64, F64, F64, F64], result: F64 },
|
|
1495
|
-
"dc.tcChannel": { argTypes: [F64, F64], result: F64 },
|
|
1496
|
-
"dc.tcHasSubscribers": { argTypes: [F64], result: BOOL },
|
|
1497
|
-
"dc.tcSubscribe": { argTypes: [F64, DYN], result: VOID },
|
|
1498
|
-
"dc.tcUnsubscribe": { argTypes: [F64, DYN], result: BOOL },
|
|
1499
|
-
"dc.tcTraceSync": { argTypes: [F64, DYN, DYN, DYN, DYN], result: DYN },
|
|
1500
|
-
"dc.tcTraceCallback": { argTypes: [F64, DYN, F64, DYN, DYN, DYN], result: DYN },
|
|
1501
|
-
"dc.tcTracePromise": { argTypes: [F64, DYN, DYN, DYN, DYN], result: { kind: "promise", inner: DYN } },
|
|
1502
|
-
"process.onUncaughtException": { argTypes: [DYN, BOOL, BOOL], result: VOID },
|
|
1503
|
-
"process.offUncaughtException": { argTypes: [DYN, BOOL], result: VOID },
|
|
1504
|
-
"process.onUnhandledRejection": { argTypes: [DYN, BOOL], result: VOID },
|
|
1505
|
-
"process.offUnhandledRejection": { argTypes: [DYN], result: VOID },
|
|
1506
|
-
"process.onRejectionHandled": { argTypes: [DYN, BOOL], result: VOID },
|
|
1507
|
-
"process.offRejectionHandled": { argTypes: [DYN], result: VOID },
|
|
1508
|
-
"process.onWarning": { argTypes: [DYN], result: VOID },
|
|
1509
|
-
"process.offWarning": { argTypes: [DYN], result: VOID },
|
|
1510
|
-
"process.emitWarning": { argTypes: [DYN], result: VOID },
|
|
1511
|
-
"async.awaitDyn": { argTypes: [DYN], result: DYN },
|
|
1512
|
-
"async.hop": { argTypes: [], result: VOID },
|
|
1513
|
-
"als.new": { argTypes: [], result: F64 },
|
|
1514
|
-
"als.get": { argTypes: [F64], result: DYN },
|
|
1515
|
-
"als.run": { argTypes: [F64, DYN, DYN, DYN], result: DYN },
|
|
1516
|
-
"als.exitRun": { argTypes: [F64, DYN, DYN], result: DYN },
|
|
1517
|
-
"als.enterWith": { argTypes: [F64, DYN], result: VOID },
|
|
1518
|
-
"als.disable": { argTypes: [F64], result: VOID },
|
|
1519
|
-
"dc.chanBindStore": { argTypes: [F64, F64, DYN], result: VOID },
|
|
1520
|
-
"dc.chanUnbindStore": { argTypes: [F64, F64], result: BOOL },
|
|
1521
|
-
"dc.chanRunStores": { argTypes: [F64, DYN, DYN, DYN, DYN], result: DYN },
|
|
1522
|
-
"number.isFinite": { argTypes: [F64], result: BOOL },
|
|
1523
|
-
"number.isNaN": { argTypes: [F64], result: BOOL },
|
|
1524
|
-
"number.isInteger": { argTypes: [F64], result: BOOL },
|
|
1525
|
-
"number.isSafeInteger": { argTypes: [F64], result: BOOL },
|
|
1526
|
-
"date.now": { argTypes: [], result: F64 },
|
|
1527
|
-
"date.newNow": { argTypes: [], result: DATE_T },
|
|
1528
|
-
"date.newMs": { argTypes: [F64], result: DATE_T },
|
|
1529
|
-
"date.newString": { argTypes: [STRING], result: DATE_T },
|
|
1530
|
-
"date.parse": { argTypes: [STRING], result: F64 },
|
|
1531
|
-
"date.getTime": { argTypes: [DATE_T], result: F64 },
|
|
1532
|
-
"date.valueOf": { argTypes: [DATE_T], result: F64 },
|
|
1533
|
-
"date.toISOString": { argTypes: [F64], result: STRING },
|
|
1534
|
-
"date.toISOStringValue": { argTypes: [DATE_T], result: STRING },
|
|
1535
|
-
"date.getFullYear": { argTypes: [DATE_T], result: F64 },
|
|
1536
|
-
"date.getUTCFullYear": { argTypes: [DATE_T], result: F64 },
|
|
1537
|
-
"date.getMonth": { argTypes: [DATE_T], result: F64 },
|
|
1538
|
-
"date.getUTCMonth": { argTypes: [DATE_T], result: F64 },
|
|
1539
|
-
"date.getDate": { argTypes: [DATE_T], result: F64 },
|
|
1540
|
-
"date.getUTCDate": { argTypes: [DATE_T], result: F64 },
|
|
1541
|
-
"date.getDay": { argTypes: [DATE_T], result: F64 },
|
|
1542
|
-
"date.getUTCDay": { argTypes: [DATE_T], result: F64 },
|
|
1543
|
-
"date.getHours": { argTypes: [DATE_T], result: F64 },
|
|
1544
|
-
"date.getUTCHours": { argTypes: [DATE_T], result: F64 },
|
|
1545
|
-
"date.getMinutes": { argTypes: [DATE_T], result: F64 },
|
|
1546
|
-
"date.getUTCMinutes": { argTypes: [DATE_T], result: F64 },
|
|
1547
|
-
"date.getSeconds": { argTypes: [DATE_T], result: F64 },
|
|
1548
|
-
"date.getUTCSeconds": { argTypes: [DATE_T], result: F64 },
|
|
1549
|
-
"date.getMilliseconds": { argTypes: [DATE_T], result: F64 },
|
|
1550
|
-
"date.getUTCMilliseconds": { argTypes: [DATE_T], result: F64 },
|
|
1551
|
-
"date.getTimezoneOffset": { argTypes: [DATE_T], result: F64 },
|
|
1552
|
-
"date.parseGetTime": { argTypes: [STRING], result: F64 },
|
|
1553
|
-
"date.utc": { argTypes: [F64, F64, F64, F64, F64, F64, F64], result: F64 },
|
|
1554
|
-
"text.decode": { argTypes: [BYTES_U8], result: STRING },
|
|
1555
|
-
"bytes.bufferSource": { argTypes: [DYN], result: BYTES_U8 },
|
|
1556
|
-
"text.decodeBufferSource": { argTypes: [DYN], result: STRING },
|
|
1557
|
-
"text.decodeOptions": { argTypes: [BYTES_U8, BOOL, BOOL], result: STRING },
|
|
1558
|
-
"text.decodeStream": { argTypes: [DYN, BYTES_U8, F64, BOOL, BOOL, BOOL], result: STRING },
|
|
1559
|
-
"text.decodeLegacyOptions": { argTypes: [BYTES_U8, F64, BOOL, BOOL], result: STRING },
|
|
1560
|
-
"text.decodeLegacy": { argTypes: [BYTES_U8, F64], result: STRING },
|
|
1561
|
-
"text.decoderEncoding": { argTypes: [DYN], result: F64 },
|
|
1562
|
-
"text.decoderName": { argTypes: [F64], result: STRING },
|
|
1563
|
-
"text.encodeInto": { argTypes: [DYN, DYN], result: DYN },
|
|
1564
|
-
"buffer.isAscii": { argTypes: [DYN], result: BOOL },
|
|
1565
|
-
"buffer.isUtf8": { argTypes: [DYN], result: BOOL },
|
|
1566
|
-
"buffer.transcode": { argTypes: [DYN, DYN, DYN], result: BYTES_U8 },
|
|
1567
|
-
"fs.mkdirRecursiveSync": { argTypes: [STRING], result: VOID },
|
|
1568
|
-
"fs.rmOptsSync": { argTypes: [STRING, BOOL, BOOL], result: VOID },
|
|
1569
|
-
"fs.rmRetrySync": { argTypes: [STRING, BOOL, BOOL, F64, F64], result: VOID },
|
|
1570
|
-
"fs.mkdtempSync": { argTypes: [STRING], result: STRING },
|
|
1571
|
-
"fs.accessSync": { argTypes: [STRING, F64], result: VOID },
|
|
1572
|
-
"fs.readFdSync": { argTypes: [F64, STRING], result: STRING },
|
|
1573
|
-
"fs.readFdSyncBytes": { argTypes: [F64], result: BYTES_U8 },
|
|
1574
|
-
"process.isTTY": { argTypes: [F64], result: BOOL },
|
|
1575
|
-
// Like process.envGet: the result is the module's interned
|
|
1576
|
-
// `number | undefined` union — checked by arms in the libCall case.
|
|
1577
|
-
"process.columns": { argTypes: [F64], result: VOID },
|
|
1578
|
-
"process.rows": { argTypes: [F64], result: VOID },
|
|
1579
|
-
"process.stdinDestroy": { argTypes: [], result: VOID },
|
|
1580
|
-
"process.stdinSetRawMode": { argTypes: [BOOL], result: VOID },
|
|
1581
|
-
// Arg 0 is a packed f64[] OR a bytes value (the spread-typed-array
|
|
1582
|
-
// form) — checked in the libCall case.
|
|
1583
|
-
"string.fromCharCode": { argTypes: [null], result: STRING },
|
|
1584
|
-
"string.fromCodePoint": { argTypes: [null], result: STRING },
|
|
1585
|
-
"string.lastIndexOf": { argTypes: [STRING, STRING], result: F64 },
|
|
1586
|
-
"string.lastIndexOfFrom": { argTypes: [STRING, STRING, F64], result: F64 },
|
|
1587
|
-
"string.raw": { argTypes: [arrayOf(STRING), arrayOf(STRING)], result: STRING },
|
|
1588
|
-
};
|
|
11
|
+
import { LIB_FN_SIGS } from "./builtin-signatures.js";
|
|
12
|
+
import { REGEX_INTRINSIC_SIGS, STR_INTRINSIC_SIGS } from "./intrinsic-signatures.js";
|
|
1589
13
|
/** True for an object type naming a runtime-provided error class. */
|
|
1590
14
|
function isBuiltinErrorObject(t) {
|
|
1591
15
|
return t.kind === "object" && RUNTIME_ERROR_CLASSES.has(t.className);
|
|
@@ -1597,12 +21,23 @@ function isBuiltinErrorObject(t) {
|
|
|
1597
21
|
* the body/call-site split is spelled out in the validator. */
|
|
1598
22
|
function callSiteReturnType(fn) {
|
|
1599
23
|
if (fn.async && fn.generator !== undefined) {
|
|
1600
|
-
return {
|
|
24
|
+
return {
|
|
25
|
+
kind: "generator",
|
|
26
|
+
async: true,
|
|
27
|
+
yieldT: fn.generator.yieldT,
|
|
28
|
+
retT: fn.returnType,
|
|
29
|
+
nextT: fn.generator.nextT,
|
|
30
|
+
};
|
|
1601
31
|
}
|
|
1602
32
|
if (fn.async)
|
|
1603
33
|
return { kind: "promise", inner: fn.returnType };
|
|
1604
34
|
if (fn.generator !== undefined) {
|
|
1605
|
-
return {
|
|
35
|
+
return {
|
|
36
|
+
kind: "generator",
|
|
37
|
+
yieldT: fn.generator.yieldT,
|
|
38
|
+
retT: fn.returnType,
|
|
39
|
+
nextT: fn.generator.nextT,
|
|
40
|
+
};
|
|
1606
41
|
}
|
|
1607
42
|
return fn.returnType;
|
|
1608
43
|
}
|
|
@@ -1631,20 +66,32 @@ export function validateModule(mod) {
|
|
|
1631
66
|
const retainedFfiCallbacks = new Map();
|
|
1632
67
|
for (const entry of mod.ffiImports ?? []) {
|
|
1633
68
|
if (entry.callbackOperation !== undefined) {
|
|
1634
|
-
const fail = (detail) => {
|
|
69
|
+
const fail = (detail) => {
|
|
70
|
+
errors.push({
|
|
71
|
+
message: `FFI callback operation "${entry.name}" ${detail}`,
|
|
72
|
+
loc: moduleLoc,
|
|
73
|
+
});
|
|
74
|
+
};
|
|
1635
75
|
if (!entry.library || entry.library.includes("\0"))
|
|
1636
76
|
fail("requires a library name");
|
|
1637
77
|
if (entry.callbackOperation === "register") {
|
|
1638
78
|
const param = entry.params[0];
|
|
1639
|
-
if (entry.params.length !== 1 ||
|
|
1640
|
-
param
|
|
1641
|
-
param
|
|
1642
|
-
|
|
79
|
+
if (entry.params.length !== 1 ||
|
|
80
|
+
!param ||
|
|
81
|
+
!isFfiCallbackParam(param) ||
|
|
82
|
+
param.callback.id !== "callback" ||
|
|
83
|
+
param.callback.lifetime !== "retained" ||
|
|
84
|
+
param.callback.invoke !== "script-thread" ||
|
|
85
|
+
param.callback.params.some((p) => typeof p !== "string" || ["cstring", "string", "bytes"].includes(p)) ||
|
|
86
|
+
entry.returns !== "pointer" ||
|
|
87
|
+
entry.callbackTarget !== undefined)
|
|
1643
88
|
fail("has an invalid registration ABI");
|
|
1644
89
|
}
|
|
1645
90
|
else if (entry.callbackOperation === "release") {
|
|
1646
91
|
const target = entry.callbackTarget ? ffiByName.get(entry.callbackTarget) : undefined;
|
|
1647
|
-
if (entry.params.length !== 0 ||
|
|
92
|
+
if (entry.params.length !== 0 ||
|
|
93
|
+
entry.returns !== "void" ||
|
|
94
|
+
target?.callbackOperation !== "register" ||
|
|
1648
95
|
target.library !== entry.library)
|
|
1649
96
|
fail("has an invalid release target or ABI");
|
|
1650
97
|
}
|
|
@@ -1652,31 +99,52 @@ export function validateModule(mod) {
|
|
|
1652
99
|
fail("has an invalid operation");
|
|
1653
100
|
}
|
|
1654
101
|
else if (entry.callbackTarget !== undefined) {
|
|
1655
|
-
errors.push({
|
|
102
|
+
errors.push({
|
|
103
|
+
message: `FFI binding "${entry.name}" has a callback target without a release operation`,
|
|
104
|
+
loc: moduleLoc,
|
|
105
|
+
});
|
|
1656
106
|
}
|
|
1657
107
|
const ids = new Set();
|
|
1658
108
|
for (const param of entry.params) {
|
|
1659
109
|
if (!isFfiCallbackParam(param))
|
|
1660
110
|
continue;
|
|
1661
111
|
if (ids.has(param.callback.id)) {
|
|
1662
|
-
errors.push({
|
|
112
|
+
errors.push({
|
|
113
|
+
message: `FFI binding "${entry.name}" has duplicate callback id "${param.callback.id}"`,
|
|
114
|
+
loc: moduleLoc,
|
|
115
|
+
});
|
|
1663
116
|
}
|
|
1664
117
|
ids.add(param.callback.id);
|
|
1665
118
|
if (param.callback.invoke !== "script-thread" && param.callback.invoke !== "foreign") {
|
|
1666
|
-
errors.push({
|
|
119
|
+
errors.push({
|
|
120
|
+
message: `FFI callback "${entry.name}:${param.callback.id}" has invalid invoke mode`,
|
|
121
|
+
loc: moduleLoc,
|
|
122
|
+
});
|
|
1667
123
|
}
|
|
1668
124
|
if (param.callback.invoke === "foreign") {
|
|
1669
125
|
if (param.callback.params.some((p) => p === "i64" || p === "u64" || p === "pointer")) {
|
|
1670
|
-
errors.push({
|
|
126
|
+
errors.push({
|
|
127
|
+
message: `FFI foreign callback "${entry.name}:${param.callback.id}" has unsupported 64-bit or pointer arguments`,
|
|
128
|
+
loc: moduleLoc,
|
|
129
|
+
});
|
|
1671
130
|
}
|
|
1672
131
|
if (param.callback.lifetime !== "retained") {
|
|
1673
|
-
errors.push({
|
|
132
|
+
errors.push({
|
|
133
|
+
message: `FFI foreign callback "${entry.name}:${param.callback.id}" is not retained`,
|
|
134
|
+
loc: moduleLoc,
|
|
135
|
+
});
|
|
1674
136
|
}
|
|
1675
137
|
if (param.callback.returns !== "void") {
|
|
1676
|
-
errors.push({
|
|
138
|
+
errors.push({
|
|
139
|
+
message: `FFI foreign callback "${entry.name}:${param.callback.id}" does not return void`,
|
|
140
|
+
loc: moduleLoc,
|
|
141
|
+
});
|
|
1677
142
|
}
|
|
1678
143
|
if (!param.callback.params.some(isFfiContextParam)) {
|
|
1679
|
-
errors.push({
|
|
144
|
+
errors.push({
|
|
145
|
+
message: `FFI foreign callback "${entry.name}:${param.callback.id}" has no context`,
|
|
146
|
+
loc: moduleLoc,
|
|
147
|
+
});
|
|
1680
148
|
}
|
|
1681
149
|
}
|
|
1682
150
|
if (param.callback.lifetime === "retained") {
|
|
@@ -1685,7 +153,10 @@ export function validateModule(mod) {
|
|
|
1685
153
|
const hasInnerContext = param.callback.params.some(isFfiContextParam);
|
|
1686
154
|
const outerContexts = entry.params.filter((candidate) => isFfiContextParam(candidate) && candidate.context === param.callback.id).length;
|
|
1687
155
|
if (hasInnerContext !== (outerContexts === 1)) {
|
|
1688
|
-
errors.push({
|
|
156
|
+
errors.push({
|
|
157
|
+
message: `FFI callback "${entry.name}:${param.callback.id}" has inconsistent context slots`,
|
|
158
|
+
loc: moduleLoc,
|
|
159
|
+
});
|
|
1689
160
|
}
|
|
1690
161
|
}
|
|
1691
162
|
}
|
|
@@ -1695,7 +166,10 @@ export function validateModule(mod) {
|
|
|
1695
166
|
continue;
|
|
1696
167
|
const target = retainedFfiCallbacks.get(param.callback.release);
|
|
1697
168
|
if (target === undefined) {
|
|
1698
|
-
errors.push({
|
|
169
|
+
errors.push({
|
|
170
|
+
message: `FFI release "${entry.name}:${param.callback.release}" has no retained target`,
|
|
171
|
+
loc: moduleLoc,
|
|
172
|
+
});
|
|
1699
173
|
continue;
|
|
1700
174
|
}
|
|
1701
175
|
// A call registering its own release target defeats the emitted
|
|
@@ -1704,7 +178,10 @@ export function validateModule(mod) {
|
|
|
1704
178
|
const registeredBySameCall = entry.params.some((candidate) => isFfiCallbackParam(candidate) &&
|
|
1705
179
|
`${entry.name}:${candidate.callback.id}` === param.callback.release);
|
|
1706
180
|
if (registeredBySameCall) {
|
|
1707
|
-
errors.push({
|
|
181
|
+
errors.push({
|
|
182
|
+
message: `FFI release "${entry.name}:${param.callback.release}" targets a retained callback registered by the same call`,
|
|
183
|
+
loc: moduleLoc,
|
|
184
|
+
});
|
|
1708
185
|
}
|
|
1709
186
|
// Structural ABI comparison: a params entry is a value-class string
|
|
1710
187
|
// or a {context} object. Key order and incidental object shape must
|
|
@@ -1719,12 +196,18 @@ export function validateModule(mod) {
|
|
|
1719
196
|
}) &&
|
|
1720
197
|
param.callback.returns === target.returns;
|
|
1721
198
|
if (!inherited) {
|
|
1722
|
-
errors.push({
|
|
199
|
+
errors.push({
|
|
200
|
+
message: `FFI release "${entry.name}:${param.callback.release}" does not inherit its target ABI`,
|
|
201
|
+
loc: moduleLoc,
|
|
202
|
+
});
|
|
1723
203
|
}
|
|
1724
204
|
const hasInnerContext = target.params.some(isFfiContextParam);
|
|
1725
205
|
const outerContexts = entry.params.filter((candidate) => isFfiContextParam(candidate) && candidate.context === param.callback.release).length;
|
|
1726
206
|
if (hasInnerContext !== (outerContexts === 1)) {
|
|
1727
|
-
errors.push({
|
|
207
|
+
errors.push({
|
|
208
|
+
message: `FFI release "${entry.name}:${param.callback.release}" has inconsistent context slots`,
|
|
209
|
+
loc: moduleLoc,
|
|
210
|
+
});
|
|
1728
211
|
}
|
|
1729
212
|
}
|
|
1730
213
|
}
|
|
@@ -1737,14 +220,23 @@ export function validateModule(mod) {
|
|
|
1737
220
|
for (const e of mod.lib.exports) {
|
|
1738
221
|
const fn = functionsByName.get(e.fnName);
|
|
1739
222
|
if (!fn) {
|
|
1740
|
-
errors.push({
|
|
223
|
+
errors.push({
|
|
224
|
+
message: `library export "${e.symbol}": missing function "${e.fnName}"`,
|
|
225
|
+
loc: entryLoc,
|
|
226
|
+
});
|
|
1741
227
|
continue;
|
|
1742
228
|
}
|
|
1743
229
|
if (fn.async === true || fn.generator !== undefined) {
|
|
1744
|
-
errors.push({
|
|
230
|
+
errors.push({
|
|
231
|
+
message: `library export "${e.symbol}": "${e.fnName}" is async/generator`,
|
|
232
|
+
loc: fn.loc,
|
|
233
|
+
});
|
|
1745
234
|
}
|
|
1746
235
|
if (fn.captures !== undefined) {
|
|
1747
|
-
errors.push({
|
|
236
|
+
errors.push({
|
|
237
|
+
message: `library export "${e.symbol}": "${e.fnName}" captures an environment`,
|
|
238
|
+
loc: fn.loc,
|
|
239
|
+
});
|
|
1748
240
|
}
|
|
1749
241
|
if (fn.params.length !== e.params.length) {
|
|
1750
242
|
errors.push({
|
|
@@ -1776,27 +268,39 @@ export function validateModule(mod) {
|
|
|
1776
268
|
}
|
|
1777
269
|
}
|
|
1778
270
|
if (!functionsByName.has(mod.entry)) {
|
|
1779
|
-
errors.push({
|
|
271
|
+
errors.push({
|
|
272
|
+
message: `library module missing its entry function "${mod.entry}"`,
|
|
273
|
+
loc: entryLoc,
|
|
274
|
+
});
|
|
1780
275
|
}
|
|
1781
276
|
// Host-callback channels: the register symbol and the channel list are
|
|
1782
277
|
// paired (the profile loader refuses otherwise, so a miss here is a
|
|
1783
278
|
// compiler bug), slots are the declaration order, and every channel
|
|
1784
279
|
// has its matching ffiImport (the lowering recognizes calls by it).
|
|
1785
280
|
const cbs = mod.lib.callbacks ?? [];
|
|
1786
|
-
if (
|
|
1787
|
-
errors.push({
|
|
281
|
+
if (cbs.length > 0 !== (mod.lib.callbackRegisterSymbol !== undefined)) {
|
|
282
|
+
errors.push({
|
|
283
|
+
message: "library callbacks and callbackRegisterSymbol must be present together",
|
|
284
|
+
loc: entryLoc,
|
|
285
|
+
});
|
|
1788
286
|
}
|
|
1789
287
|
const cbNames = new Set();
|
|
1790
288
|
cbs.forEach((cb, i) => {
|
|
1791
289
|
if (cb.slot !== i) {
|
|
1792
|
-
errors.push({
|
|
290
|
+
errors.push({
|
|
291
|
+
message: `library callback "${cb.name}": slot ${cb.slot} out of declaration order (expected ${i})`,
|
|
292
|
+
loc: entryLoc,
|
|
293
|
+
});
|
|
1793
294
|
}
|
|
1794
295
|
if (cbNames.has(cb.name)) {
|
|
1795
296
|
errors.push({ message: `duplicate library callback channel "${cb.name}"`, loc: entryLoc });
|
|
1796
297
|
}
|
|
1797
298
|
cbNames.add(cb.name);
|
|
1798
299
|
if (!(mod.ffiImports ?? []).some((f) => f.name === cb.name)) {
|
|
1799
|
-
errors.push({
|
|
300
|
+
errors.push({
|
|
301
|
+
message: `library callback "${cb.name}" has no matching ffiImport`,
|
|
302
|
+
loc: entryLoc,
|
|
303
|
+
});
|
|
1800
304
|
}
|
|
1801
305
|
});
|
|
1802
306
|
}
|
|
@@ -1808,49 +312,81 @@ export function validateModule(mod) {
|
|
|
1808
312
|
}
|
|
1809
313
|
classesByName.set(cls.name, cls);
|
|
1810
314
|
if (cls.localCaptures !== undefined && (cls.runtime || cls.genericOf !== undefined)) {
|
|
1811
|
-
errors.push({
|
|
315
|
+
errors.push({
|
|
316
|
+
message: `class ${cls.name}: local class cannot use a runtime or generic family layout`,
|
|
317
|
+
loc: cls.loc,
|
|
318
|
+
});
|
|
1812
319
|
}
|
|
1813
320
|
if (cls.localCaptures !== undefined) {
|
|
1814
321
|
const environment = cls.fields.find((field) => field.name === `%classEnvironment:${cls.name}`);
|
|
1815
322
|
if (environment?.type.kind !== "classval" || environment.type.className !== cls.name) {
|
|
1816
|
-
errors.push({
|
|
323
|
+
errors.push({
|
|
324
|
+
message: `class ${cls.name}: local class requires its constructor environment field`,
|
|
325
|
+
loc: cls.loc,
|
|
326
|
+
});
|
|
1817
327
|
}
|
|
1818
328
|
}
|
|
1819
329
|
if (cls.localBaseCapture !== undefined) {
|
|
1820
330
|
const base = cls.localCaptures?.[cls.localBaseCapture];
|
|
1821
|
-
if (!Number.isInteger(cls.localBaseCapture) ||
|
|
331
|
+
if (!Number.isInteger(cls.localBaseCapture) ||
|
|
332
|
+
base?.type.kind !== "classval" ||
|
|
333
|
+
base.type.className !== cls.base) {
|
|
1822
334
|
errors.push({ message: `class ${cls.name}: invalid local base capture`, loc: cls.loc });
|
|
1823
335
|
}
|
|
1824
336
|
}
|
|
1825
337
|
if (cls.baseValueGlobal !== undefined) {
|
|
1826
338
|
const global = mod.globals?.find((global) => global.id === cls.baseValueGlobal);
|
|
1827
|
-
if (cls.localBaseCapture !== undefined ||
|
|
339
|
+
if (cls.localBaseCapture !== undefined ||
|
|
340
|
+
!cls.base ||
|
|
341
|
+
global?.type.kind !== "classval" ||
|
|
342
|
+
global.type.className !== cls.base) {
|
|
1828
343
|
errors.push({ message: `class ${cls.name}: invalid computed base global`, loc: cls.loc });
|
|
1829
344
|
}
|
|
1830
345
|
}
|
|
1831
346
|
if (cls.jsLength !== undefined && (!Number.isSafeInteger(cls.jsLength) || cls.jsLength < 0)) {
|
|
1832
347
|
errors.push({ message: `class ${cls.name}: invalid constructor length`, loc: cls.loc });
|
|
1833
348
|
}
|
|
1834
|
-
if (cls.tracksOwnFields &&
|
|
1835
|
-
|
|
349
|
+
if (cls.tracksOwnFields &&
|
|
350
|
+
(cls.runtime ||
|
|
351
|
+
cls.fields.find((field) => field.name === DYN_CLASS_PROPERTIES)?.type.kind !== "dyn")) {
|
|
352
|
+
errors.push({
|
|
353
|
+
message: `class ${cls.name}: field presence tracking requires a native dyn property bag`,
|
|
354
|
+
loc: cls.loc,
|
|
355
|
+
});
|
|
1836
356
|
}
|
|
1837
357
|
if (cls.prototypeDataHelper !== undefined) {
|
|
1838
358
|
const helper = functionsByName.get(cls.prototypeDataHelper);
|
|
1839
|
-
if (!helper ||
|
|
1840
|
-
|
|
359
|
+
if (!helper ||
|
|
360
|
+
helper.params.length !== 0 ||
|
|
361
|
+
helper.returnType.kind !== "dyn" ||
|
|
362
|
+
helper.captures !== undefined ||
|
|
363
|
+
helper.classCaptures !== undefined) {
|
|
364
|
+
errors.push({
|
|
365
|
+
message: `class ${cls.name}: prototype data helper must be a noncapturing () => dyn function`,
|
|
366
|
+
loc: cls.loc,
|
|
367
|
+
});
|
|
1841
368
|
}
|
|
1842
369
|
}
|
|
1843
370
|
if (cls.instancePrototypeHelper !== undefined) {
|
|
1844
371
|
const helper = functionsByName.get(cls.instancePrototypeHelper);
|
|
1845
372
|
const receiver = helper?.params[0]?.type;
|
|
1846
|
-
if (!helper ||
|
|
1847
|
-
helper.
|
|
1848
|
-
|
|
373
|
+
if (!helper ||
|
|
374
|
+
helper.params.length !== 1 ||
|
|
375
|
+
receiver?.kind !== "object" ||
|
|
376
|
+
receiver.className !== cls.name ||
|
|
377
|
+
helper.returnType.kind !== "dyn" ||
|
|
378
|
+
helper.captures !== undefined ||
|
|
379
|
+
helper.classCaptures !== undefined) {
|
|
380
|
+
errors.push({
|
|
381
|
+
message: `class ${cls.name}: instance prototype helper must be a noncapturing (instance) => dyn function`,
|
|
382
|
+
loc: cls.loc,
|
|
383
|
+
});
|
|
1849
384
|
}
|
|
1850
385
|
}
|
|
1851
386
|
for (const symbol of cls.symbolFields ?? []) {
|
|
1852
387
|
const global = mod.globals?.find((global) => global.id === symbol.globalId);
|
|
1853
|
-
if (global?.type.kind !== "symbol" ||
|
|
388
|
+
if (global?.type.kind !== "symbol" ||
|
|
389
|
+
!cls.fields.some((field) => field.name === symbol.field)) {
|
|
1854
390
|
errors.push({ message: `class ${cls.name}: invalid symbol field metadata`, loc: cls.loc });
|
|
1855
391
|
}
|
|
1856
392
|
}
|
|
@@ -1864,7 +400,10 @@ export function validateModule(mod) {
|
|
|
1864
400
|
else
|
|
1865
401
|
seen.set(f.name, f.type);
|
|
1866
402
|
if (isUnitType(f.type)) {
|
|
1867
|
-
errors.push({
|
|
403
|
+
errors.push({
|
|
404
|
+
message: `class ${cls.name}: field "${f.name}" is ${f.type.kind}`,
|
|
405
|
+
loc: cls.loc,
|
|
406
|
+
});
|
|
1868
407
|
}
|
|
1869
408
|
}
|
|
1870
409
|
// Duplicate class names, like classesByName, select the last declaration.
|
|
@@ -1879,10 +418,16 @@ export function validateModule(mod) {
|
|
|
1879
418
|
// module function exists for them (and must not).
|
|
1880
419
|
for (const m of cls.abstractMethods ?? []) {
|
|
1881
420
|
if (!cls.methods?.includes(m)) {
|
|
1882
|
-
errors.push({
|
|
421
|
+
errors.push({
|
|
422
|
+
message: `class ${cls.name}: abstract method "${m}" not in methods`,
|
|
423
|
+
loc: cls.loc,
|
|
424
|
+
});
|
|
1883
425
|
}
|
|
1884
426
|
if (functionsByName.has(`%${cls.name}.${m}`)) {
|
|
1885
|
-
errors.push({
|
|
427
|
+
errors.push({
|
|
428
|
+
message: `class ${cls.name}: abstract method "${m}" has a function`,
|
|
429
|
+
loc: cls.loc,
|
|
430
|
+
});
|
|
1886
431
|
}
|
|
1887
432
|
}
|
|
1888
433
|
for (const m of cls.methods ?? []) {
|
|
@@ -1904,8 +449,13 @@ export function validateModule(mod) {
|
|
|
1904
449
|
errors.push({ message: `class ${cls.name}: undeclared base "${cls.base}"`, loc: cls.loc });
|
|
1905
450
|
continue;
|
|
1906
451
|
}
|
|
1907
|
-
if (base.localCaptures !== undefined &&
|
|
1908
|
-
|
|
452
|
+
if (base.localCaptures !== undefined &&
|
|
453
|
+
cls.localBaseCapture === undefined &&
|
|
454
|
+
cls.baseValueGlobal === undefined) {
|
|
455
|
+
errors.push({
|
|
456
|
+
message: `class ${cls.name}: local base requires a captured constructor`,
|
|
457
|
+
loc: cls.loc,
|
|
458
|
+
});
|
|
1909
459
|
}
|
|
1910
460
|
const seen = new Set([cls.name]);
|
|
1911
461
|
for (let c = base; c; c = c.base !== undefined ? classesByName.get(c.base) : undefined) {
|
|
@@ -1930,7 +480,10 @@ export function validateModule(mod) {
|
|
|
1930
480
|
continue;
|
|
1931
481
|
const family = classesByName.get(cls.genericOf);
|
|
1932
482
|
if (!family) {
|
|
1933
|
-
errors.push({
|
|
483
|
+
errors.push({
|
|
484
|
+
message: `class ${cls.name}: undeclared generic family "${cls.genericOf}"`,
|
|
485
|
+
loc: cls.loc,
|
|
486
|
+
});
|
|
1934
487
|
continue;
|
|
1935
488
|
}
|
|
1936
489
|
let ancestor = false;
|
|
@@ -1943,7 +496,10 @@ export function validateModule(mod) {
|
|
|
1943
496
|
}
|
|
1944
497
|
}
|
|
1945
498
|
if (!ancestor) {
|
|
1946
|
-
errors.push({
|
|
499
|
+
errors.push({
|
|
500
|
+
message: `class ${cls.name}: generic family "${cls.genericOf}" is not an ancestor`,
|
|
501
|
+
loc: cls.loc,
|
|
502
|
+
});
|
|
1947
503
|
}
|
|
1948
504
|
}
|
|
1949
505
|
const noLoc = { file: mod.sourceFile, start: 0, end: 0 };
|
|
@@ -1966,7 +522,10 @@ export function validateModule(mod) {
|
|
|
1966
522
|
// unit field is as malformed as a void one. dyn and jsval slots
|
|
1967
523
|
// are valid; both are refcounted values held by the record shape.
|
|
1968
524
|
if (f.type.kind === "void" || isUnitType(f.type)) {
|
|
1969
|
-
errors.push({
|
|
525
|
+
errors.push({
|
|
526
|
+
message: `record ${rec.id}: field "${f.name}" is ${f.type.kind}`,
|
|
527
|
+
loc: noLoc,
|
|
528
|
+
});
|
|
1970
529
|
}
|
|
1971
530
|
if (f.type.kind === "record" && !recordIds.has(f.type.shapeId)) {
|
|
1972
531
|
errors.push({
|
|
@@ -1980,13 +539,18 @@ export function validateModule(mod) {
|
|
|
1980
539
|
// shapes share one index. All indexes belong to this validation call.
|
|
1981
540
|
recordValidation.set(rec.id, {
|
|
1982
541
|
fields,
|
|
1983
|
-
initializationFields: fields.size === rec.fields.length
|
|
542
|
+
initializationFields: fields.size === rec.fields.length
|
|
543
|
+
? fields
|
|
544
|
+
: new Map(rec.fields.map((field) => [field.name, field.type])),
|
|
1984
545
|
hasAccessorSlots: shapeHasAccessorSlots(rec),
|
|
1985
546
|
});
|
|
1986
547
|
// Canonical order is the shape's identity — enforce it.
|
|
1987
548
|
const sorted = [...rec.fields].map((f) => f.name).sort();
|
|
1988
549
|
if (rec.fields.some((f, i) => f.name !== sorted[i])) {
|
|
1989
|
-
errors.push({
|
|
550
|
+
errors.push({
|
|
551
|
+
message: `record ${rec.id}: fields are not in canonical (sorted) order`,
|
|
552
|
+
loc: noLoc,
|
|
553
|
+
});
|
|
1990
554
|
}
|
|
1991
555
|
// Tuple shapes carry exactly the positional fields "0".."n-1" (arity =
|
|
1992
556
|
// field count) — anything else has no honest index/JSON story.
|
|
@@ -1999,13 +563,17 @@ export function validateModule(mod) {
|
|
|
1999
563
|
break;
|
|
2000
564
|
}
|
|
2001
565
|
}
|
|
2002
|
-
if (rec.fields.length === 0 ||
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
566
|
+
if (rec.fields.length === 0 || names.size !== rec.fields.length || !positionsComplete) {
|
|
567
|
+
errors.push({
|
|
568
|
+
message: `record ${rec.id}: tuple fields are not "0".."${rec.fields.length - 1}"`,
|
|
569
|
+
loc: noLoc,
|
|
570
|
+
});
|
|
2006
571
|
}
|
|
2007
572
|
if (rec.indexValue) {
|
|
2008
|
-
errors.push({
|
|
573
|
+
errors.push({
|
|
574
|
+
message: `record ${rec.id}: a tuple cannot carry an index signature`,
|
|
575
|
+
loc: noLoc,
|
|
576
|
+
});
|
|
2009
577
|
}
|
|
2010
578
|
}
|
|
2011
579
|
// Index-signature shapes: the overflow value type is fenced to the map
|
|
@@ -2036,12 +604,21 @@ export function validateModule(mod) {
|
|
|
2036
604
|
const arm = u.arms[candidate.tag];
|
|
2037
605
|
const record = arm?.kind === "record" ? recordsById.get(arm.shapeId) : undefined;
|
|
2038
606
|
const member = record ? recordValidation.get(record.id)?.fields.get(field) : undefined;
|
|
2039
|
-
if (!Number.isInteger(candidate.tag) ||
|
|
2040
|
-
|
|
607
|
+
if (!Number.isInteger(candidate.tag) ||
|
|
608
|
+
candidate.tag < 0 ||
|
|
609
|
+
!member ||
|
|
610
|
+
tags.has(candidate.tag)) {
|
|
611
|
+
errors.push({
|
|
612
|
+
message: `union ${u.id}: invalid discriminant tag ${candidate.tag}`,
|
|
613
|
+
loc: noLoc,
|
|
614
|
+
});
|
|
2041
615
|
}
|
|
2042
616
|
tags.add(candidate.tag);
|
|
2043
617
|
if (candidate.values.length === 0) {
|
|
2044
|
-
errors.push({
|
|
618
|
+
errors.push({
|
|
619
|
+
message: `union ${u.id}: empty discriminant values for tag ${candidate.tag}`,
|
|
620
|
+
loc: noLoc,
|
|
621
|
+
});
|
|
2045
622
|
}
|
|
2046
623
|
for (const value of candidate.values) {
|
|
2047
624
|
if (value === undefined) {
|
|
@@ -2049,20 +626,31 @@ export function validateModule(mod) {
|
|
|
2049
626
|
continue;
|
|
2050
627
|
}
|
|
2051
628
|
const fieldTypes = member?.kind === "union"
|
|
2052
|
-
? unionsById.get(member.unionId)?.arms ?? []
|
|
2053
|
-
|
|
2054
|
-
|
|
629
|
+
? (unionsById.get(member.unionId)?.arms ?? [])
|
|
630
|
+
: member
|
|
631
|
+
? [member]
|
|
632
|
+
: [];
|
|
633
|
+
const valid = fieldTypes.some((type) => typeof value === "string"
|
|
634
|
+
? type.kind === "string"
|
|
635
|
+
: typeof value === "boolean"
|
|
636
|
+
? type.kind === "bool"
|
|
2055
637
|
: typeof value === "number" && Number.isFinite(value) && type.kind === "f64");
|
|
2056
638
|
const key = typeof value + ":" + String(value);
|
|
2057
639
|
if (!valid || values.has(key)) {
|
|
2058
|
-
errors.push({
|
|
640
|
+
errors.push({
|
|
641
|
+
message: `union ${u.id}: invalid or repeated discriminant value ${key}`,
|
|
642
|
+
loc: noLoc,
|
|
643
|
+
});
|
|
2059
644
|
}
|
|
2060
645
|
values.add(key);
|
|
2061
646
|
}
|
|
2062
647
|
}
|
|
2063
648
|
for (let tag = 0; tag < u.arms.length; tag++) {
|
|
2064
649
|
if (u.arms[tag].kind === "record" && !tags.has(tag)) {
|
|
2065
|
-
errors.push({
|
|
650
|
+
errors.push({
|
|
651
|
+
message: `union ${u.id}: missing discriminant for record arm ${tag}`,
|
|
652
|
+
loc: noLoc,
|
|
653
|
+
});
|
|
2066
654
|
}
|
|
2067
655
|
}
|
|
2068
656
|
}
|
|
@@ -2081,7 +669,10 @@ export function validateModule(mod) {
|
|
|
2081
669
|
}
|
|
2082
670
|
if ((arm.kind === "map" || arm.kind === "set" || arm.kind === "promise") &&
|
|
2083
671
|
!unionContainerArmsOk(u.arms)) {
|
|
2084
|
-
errors.push({
|
|
672
|
+
errors.push({
|
|
673
|
+
message: `union ${u.id}: ${arm.kind} arm ${i} beside non-unit arms`,
|
|
674
|
+
loc: noLoc,
|
|
675
|
+
});
|
|
2085
676
|
}
|
|
2086
677
|
if (arm.kind === "record" && !recordsById.has(arm.shapeId)) {
|
|
2087
678
|
errors.push({
|
|
@@ -2173,7 +764,10 @@ export function validateModule(mod) {
|
|
|
2173
764
|
};
|
|
2174
765
|
for (const g of mod.globals ?? []) {
|
|
2175
766
|
if (g.tdz && g.type.kind !== "record" && g.type.kind !== "func" && g.type.kind !== "dyn") {
|
|
2176
|
-
errors.push({
|
|
767
|
+
errors.push({
|
|
768
|
+
message: `TDZ global "${g.name}" must have record, function, or checked-value storage`,
|
|
769
|
+
loc: noLoc,
|
|
770
|
+
});
|
|
2177
771
|
}
|
|
2178
772
|
if (isUnitType(g.type)) {
|
|
2179
773
|
errors.push({ message: `global "${g.name}" has bare unit type ${g.type.kind}`, loc: noLoc });
|
|
@@ -2216,7 +810,9 @@ export function validateModule(mod) {
|
|
|
2216
810
|
// membership, and virtual-call resolution local to this validation invocation.
|
|
2217
811
|
const classValidation = {
|
|
2218
812
|
fields: classFields,
|
|
2219
|
-
hierarchy: new Set(),
|
|
813
|
+
hierarchy: new Set(),
|
|
814
|
+
implementations: new Map(),
|
|
815
|
+
virtualCalls: new Map(),
|
|
2220
816
|
};
|
|
2221
817
|
for (const cls of classesByName.values()) {
|
|
2222
818
|
if (cls.base !== undefined) {
|
|
@@ -2366,7 +962,9 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
2366
962
|
// Same-kind mismatches (func vs func, record vs record) would be
|
|
2367
963
|
// unreadable as bare kinds — the structural keys show WHERE the two
|
|
2368
964
|
// types diverge.
|
|
2369
|
-
const detail = want.kind === expr.type.kind
|
|
965
|
+
const detail = want.kind === expr.type.kind
|
|
966
|
+
? ` (expected ${typeKey(want)}, got ${typeKey(expr.type)})`
|
|
967
|
+
: "";
|
|
2370
968
|
err(`${what}: expected ${want.kind}, got ${expr.type.kind}${detail}`, expr.loc);
|
|
2371
969
|
}
|
|
2372
970
|
};
|
|
@@ -2465,8 +1063,12 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
2465
1063
|
continue;
|
|
2466
1064
|
}
|
|
2467
1065
|
if (e.kind === "logical") {
|
|
2468
|
-
if (e.type.kind !== "f64" &&
|
|
2469
|
-
e.type.kind !== "
|
|
1066
|
+
if (e.type.kind !== "f64" &&
|
|
1067
|
+
e.type.kind !== "string" &&
|
|
1068
|
+
e.type.kind !== "bool" &&
|
|
1069
|
+
e.type.kind !== "jsval" &&
|
|
1070
|
+
e.type.kind !== "union" &&
|
|
1071
|
+
e.type.kind !== "dyn") {
|
|
2470
1072
|
err(`logical ${e.op} must be f64|string|bool|jsval|union|dyn, got ${e.type.kind}`, e.loc);
|
|
2471
1073
|
}
|
|
2472
1074
|
if (e.type.kind === "union")
|
|
@@ -2616,7 +1218,8 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
2616
1218
|
// procStream is the ONE non-f64 numLit: process.stdout/stderr as
|
|
2617
1219
|
// first-class values mint the stream's fd (1/2) as the scalar —
|
|
2618
1220
|
// the prefixStream idiom.
|
|
2619
|
-
if (e.type.kind !== "f64" &&
|
|
1221
|
+
if (e.type.kind !== "f64" &&
|
|
1222
|
+
!(e.type.kind === "procStream" && (e.value === 1 || e.value === 2))) {
|
|
2620
1223
|
err("numLit must be f64", e.loc);
|
|
2621
1224
|
}
|
|
2622
1225
|
break;
|
|
@@ -2783,7 +1386,22 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
2783
1386
|
// choose ARRAY_VALUE versus ARRAY_UNDEFINED before the final result
|
|
2784
1387
|
// is evaluated. Delegation also needs a local loop. Nested control
|
|
2785
1388
|
// flow is checked recursively; jumps still cannot leave the region.
|
|
2786
|
-
const allowed = new Set([
|
|
1389
|
+
const allowed = new Set([
|
|
1390
|
+
"varDecl",
|
|
1391
|
+
"assign",
|
|
1392
|
+
"exprStmt",
|
|
1393
|
+
"fieldSet",
|
|
1394
|
+
"recordSet",
|
|
1395
|
+
"recordKeySet",
|
|
1396
|
+
"arraySet",
|
|
1397
|
+
"arraySetLength",
|
|
1398
|
+
"arraySetUndefined",
|
|
1399
|
+
"arrayDelete",
|
|
1400
|
+
"bytesSet",
|
|
1401
|
+
"block",
|
|
1402
|
+
"if",
|
|
1403
|
+
"while",
|
|
1404
|
+
]);
|
|
2787
1405
|
if (e.generatorDelegate) {
|
|
2788
1406
|
if (!fn.generator || fn.async)
|
|
2789
1407
|
err("delegation sequence outside a synchronous generator", e.loc);
|
|
@@ -3024,7 +1642,8 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
3024
1642
|
if (!helper) {
|
|
3025
1643
|
err(`orDefault retag calls undeclared function "${e.retag}"`, e.loc);
|
|
3026
1644
|
}
|
|
3027
|
-
else if (helper.params.length !== 1 ||
|
|
1645
|
+
else if (helper.params.length !== 1 ||
|
|
1646
|
+
!typeEquals(helper.params[0].type, e.left.type)) {
|
|
3028
1647
|
err(`orDefault retag ${e.retag} must take exactly the left union`, e.loc);
|
|
3029
1648
|
}
|
|
3030
1649
|
else if (!typeEquals(callSiteReturnType(helper), e.type)) {
|
|
@@ -3049,8 +1668,12 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
3049
1668
|
if (!def) {
|
|
3050
1669
|
err(`toString of unknown union ${e.operand.type.unionId}`, e.loc);
|
|
3051
1670
|
}
|
|
3052
|
-
else if (!def.arms.every((a) => a.kind === "undefinedT" ||
|
|
3053
|
-
a.kind === "
|
|
1671
|
+
else if (!def.arms.every((a) => a.kind === "undefinedT" ||
|
|
1672
|
+
a.kind === "nullT" ||
|
|
1673
|
+
a.kind === "string" ||
|
|
1674
|
+
a.kind === "f64" ||
|
|
1675
|
+
a.kind === "bigint" ||
|
|
1676
|
+
a.kind === "bool" ||
|
|
3054
1677
|
(a.kind === "bytes" && a.elem === "u8"))) {
|
|
3055
1678
|
err("toString union operand has a non-stringable arm (frontend must fence)", e.loc);
|
|
3056
1679
|
}
|
|
@@ -3250,11 +1873,29 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
3250
1873
|
// view; dataViewNew and byteOffset take ANY elem kind (views form
|
|
3251
1874
|
// over any typed array's storage, owners answer byteOffset 0).
|
|
3252
1875
|
const isDv = e.method.startsWith("dvGet") || e.method.startsWith("dvSet");
|
|
3253
|
-
const isNum = e.method === "readNum" ||
|
|
1876
|
+
const isNum = e.method === "readNum" ||
|
|
1877
|
+
e.method === "writeNum" ||
|
|
1878
|
+
e.method === "readNumVar" ||
|
|
1879
|
+
e.method === "writeNumVar";
|
|
3254
1880
|
const U8_ONLY_EXTRA = new Set([
|
|
3255
|
-
"toString",
|
|
3256
|
-
"
|
|
3257
|
-
"
|
|
1881
|
+
"toString",
|
|
1882
|
+
"toStringVar",
|
|
1883
|
+
"equals",
|
|
1884
|
+
"compareBuf",
|
|
1885
|
+
"indexOf",
|
|
1886
|
+
"lastIndexOf",
|
|
1887
|
+
"includes",
|
|
1888
|
+
"indexOfNum",
|
|
1889
|
+
"lastIndexOfNum",
|
|
1890
|
+
"includesNum",
|
|
1891
|
+
"fill",
|
|
1892
|
+
"fillNum",
|
|
1893
|
+
"fillStr",
|
|
1894
|
+
"copy",
|
|
1895
|
+
"swap16",
|
|
1896
|
+
"swap32",
|
|
1897
|
+
"swap64",
|
|
1898
|
+
"writeStr",
|
|
3258
1899
|
]);
|
|
3259
1900
|
const u8Only = U8_ONLY_EXTRA.has(e.method) || isNum || isDv;
|
|
3260
1901
|
if (u8Only && recv.elem !== "u8") {
|
|
@@ -3266,7 +1907,9 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
3266
1907
|
if (isNum && e.args[0]?.kind !== "strLit") {
|
|
3267
1908
|
err(`bytesIntrinsic ${e.method} args[0] must be a strLit kind token`, e.loc);
|
|
3268
1909
|
}
|
|
3269
|
-
else if (isNum &&
|
|
1910
|
+
else if (isNum &&
|
|
1911
|
+
e.args[0]?.kind === "strLit" &&
|
|
1912
|
+
!validByteNumberToken(e.method, e.args[0].value)) {
|
|
3270
1913
|
err(`bytesIntrinsic ${e.method} invalid kind token '${e.args[0].value}'`, e.loc);
|
|
3271
1914
|
}
|
|
3272
1915
|
// fillStr/writeStr carry their NORMALIZED encoding as args[1],
|
|
@@ -3302,49 +1945,61 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
3302
1945
|
// Object.hasOwn: "toString" is a real method name here and must
|
|
3303
1946
|
// not answer from Object.prototype.
|
|
3304
1947
|
const extraSig = Object.hasOwn(EXTRA_SIGS, e.method) ? EXTRA_SIGS[e.method] : undefined;
|
|
3305
|
-
const sig = extraSig ??
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
1948
|
+
const sig = extraSig ??
|
|
1949
|
+
(e.method === "length" || e.method === "byteLength" || e.method === "byteOffset"
|
|
1950
|
+
? { argTypes: [], minArgs: 0, result: F64 }
|
|
1951
|
+
: e.method === "get"
|
|
1952
|
+
? { argTypes: [F64], minArgs: 1, result: F64 }
|
|
1953
|
+
: e.method === "slice" || e.method === "subarray"
|
|
1954
|
+
? { argTypes: [F64, F64], minArgs: 0, result: bytesOf(recv.elem) }
|
|
1955
|
+
: e.method === "toReversed"
|
|
1956
|
+
? { argTypes: [], minArgs: 0, result: bytesOf(recv.elem) }
|
|
1957
|
+
: e.method === "with"
|
|
1958
|
+
? { argTypes: [F64, F64], minArgs: 2, result: bytesOf(recv.elem) }
|
|
1959
|
+
: e.method === "join"
|
|
1960
|
+
? { argTypes: [STRING], minArgs: 1, result: STRING }
|
|
1961
|
+
: e.method === "toArray"
|
|
1962
|
+
? { argTypes: [], minArgs: 0, result: arrayOf(F64) }
|
|
1963
|
+
: e.method === "setFrom"
|
|
1964
|
+
? {
|
|
1965
|
+
argTypes: [
|
|
1966
|
+
e.args[0]?.type.kind === "bytes"
|
|
1967
|
+
? e.args[0].type
|
|
1968
|
+
: bytesOf(recv.elem),
|
|
1969
|
+
F64,
|
|
1970
|
+
],
|
|
1971
|
+
minArgs: 1,
|
|
1972
|
+
result: VOID,
|
|
1973
|
+
}
|
|
1974
|
+
: e.method === "toString" || e.method === "toStringVar"
|
|
1975
|
+
? { argTypes: [STRING, F64, F64], minArgs: 1, result: STRING }
|
|
1976
|
+
: e.method === "readNum"
|
|
1977
|
+
? { argTypes: [STRING, F64], minArgs: 2, result: F64 }
|
|
1978
|
+
: e.method === "writeNum"
|
|
3328
1979
|
? { argTypes: [STRING, F64, F64], minArgs: 3, result: F64 }
|
|
3329
|
-
: e.method === "
|
|
3330
|
-
? { argTypes: [STRING, F64, F64
|
|
3331
|
-
: e.method === "
|
|
3332
|
-
? { argTypes: [F64, F64], minArgs:
|
|
3333
|
-
: e.method
|
|
3334
|
-
? {
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
:
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
1980
|
+
: e.method === "readNumVar"
|
|
1981
|
+
? { argTypes: [STRING, F64, F64], minArgs: 3, result: F64 }
|
|
1982
|
+
: e.method === "writeNumVar"
|
|
1983
|
+
? { argTypes: [STRING, F64, F64, F64], minArgs: 4, result: F64 }
|
|
1984
|
+
: e.method === "dataViewNew"
|
|
1985
|
+
? { argTypes: [F64, F64], minArgs: 0, result: BYTES_U8 }
|
|
1986
|
+
: e.method.startsWith("dvSet")
|
|
1987
|
+
? {
|
|
1988
|
+
// dvSet*: [offset, value], the 8-bit setters take no littleEndian.
|
|
1989
|
+
argTypes: e.method === "dvSetUint8" || e.method === "dvSetInt8"
|
|
1990
|
+
? [F64, F64]
|
|
1991
|
+
: [F64, F64, BOOL],
|
|
1992
|
+
minArgs: 2,
|
|
1993
|
+
result: VOID,
|
|
1994
|
+
}
|
|
1995
|
+
: {
|
|
1996
|
+
// dvGet*: the 8-bit getters take no littleEndian.
|
|
1997
|
+
argTypes: e.method === "dvGetUint8" || e.method === "dvGetInt8"
|
|
1998
|
+
? [F64]
|
|
1999
|
+
: [F64, BOOL],
|
|
2000
|
+
minArgs: 1,
|
|
2001
|
+
result: F64,
|
|
2002
|
+
});
|
|
3348
2003
|
if (e.args.length < sig.minArgs || e.args.length > sig.argTypes.length) {
|
|
3349
2004
|
err(`bytesIntrinsic ${e.method}: ${e.args.length} args`, e.loc);
|
|
3350
2005
|
}
|
|
@@ -3366,47 +2021,64 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
3366
2021
|
break;
|
|
3367
2022
|
}
|
|
3368
2023
|
const elem = e.receiver.type.elem;
|
|
3369
|
-
const sig = e.method === "
|
|
3370
|
-
? { argTypes:
|
|
3371
|
-
: e.method === "
|
|
3372
|
-
? { argTypes: [
|
|
3373
|
-
: e.method === "
|
|
3374
|
-
? { argTypes: [F64], result:
|
|
3375
|
-
: e.method === "
|
|
3376
|
-
? { argTypes:
|
|
3377
|
-
: e.method === "
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
:
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
2024
|
+
const sig = e.method === "copyWithin"
|
|
2025
|
+
? { argTypes: [F64, F64, F64], result: e.receiver.type }
|
|
2026
|
+
: e.method === "fill"
|
|
2027
|
+
? { argTypes: [elem, F64, F64], result: e.receiver.type }
|
|
2028
|
+
: e.method === "fillUndefined"
|
|
2029
|
+
? { argTypes: [F64, F64], result: e.receiver.type }
|
|
2030
|
+
: e.method === "push" || e.method === "unshift"
|
|
2031
|
+
? { argTypes: e.args.map(() => elem), result: F64 }
|
|
2032
|
+
: e.method === "pushSpread" ||
|
|
2033
|
+
e.method === "concatSpread" ||
|
|
2034
|
+
e.method === "unshiftSpread"
|
|
2035
|
+
? { argTypes: [e.receiver.type], result: F64 }
|
|
2036
|
+
: e.method === "nextPresent" || e.method === "getNumber"
|
|
2037
|
+
? { argTypes: [F64], result: F64 }
|
|
2038
|
+
: e.method === "indexEq"
|
|
2039
|
+
? { argTypes: [F64, e.receiver.type, F64], result: BOOL }
|
|
2040
|
+
: e.method === "pop"
|
|
2041
|
+
? { argTypes: [], result: e.type } // union-checked below
|
|
2042
|
+
: e.method === "indexOf"
|
|
2043
|
+
? { argTypes: [elem], result: F64 }
|
|
2044
|
+
: e.method === "includes"
|
|
2045
|
+
? { argTypes: [elem], result: BOOL }
|
|
2046
|
+
: e.method === "join"
|
|
2047
|
+
? { argTypes: [STRING], result: STRING }
|
|
2048
|
+
: e.method === "slice"
|
|
2049
|
+
? { argTypes: [F64, F64], result: e.receiver.type }
|
|
2050
|
+
: e.method === "toReversed"
|
|
2051
|
+
? { argTypes: [], result: e.receiver.type }
|
|
2052
|
+
: e.method === "reverse"
|
|
2053
|
+
? { argTypes: [], result: e.receiver.type }
|
|
2054
|
+
: e.method === "toSpliced"
|
|
2055
|
+
? {
|
|
2056
|
+
argTypes: [F64, F64, e.receiver.type],
|
|
2057
|
+
result: e.receiver.type,
|
|
2058
|
+
}
|
|
2059
|
+
: e.method === "with"
|
|
2060
|
+
? { argTypes: [F64, elem], result: e.receiver.type }
|
|
2061
|
+
: e.method === "withUndefined"
|
|
2062
|
+
? { argTypes: [F64], result: e.receiver.type }
|
|
2063
|
+
: e.method === "splice"
|
|
2064
|
+
? { argTypes: [F64, F64], result: e.receiver.type }
|
|
2065
|
+
: e.method === "spliceInsert"
|
|
2066
|
+
? {
|
|
2067
|
+
argTypes: [F64, F64, e.receiver.type],
|
|
2068
|
+
result: e.receiver.type,
|
|
2069
|
+
}
|
|
2070
|
+
: e.method === "flatCopy" || e.method === "flatOne"
|
|
2071
|
+
? { argTypes: [e.type], result: e.type }
|
|
2072
|
+
: e.method === "shift"
|
|
2073
|
+
? { argTypes: [], result: e.type } // union-checked below
|
|
2074
|
+
: { argTypes: [], result: F64 }; // length
|
|
3406
2075
|
if (e.method === "getNumber" && elem.kind !== "f64") {
|
|
3407
2076
|
err(`arrIntrinsic getNumber requires f64 elements, got ${elem.kind}`, e.loc);
|
|
3408
2077
|
}
|
|
3409
|
-
if (e.method === "indexEq" &&
|
|
2078
|
+
if (e.method === "indexEq" &&
|
|
2079
|
+
elem.kind !== "f64" &&
|
|
2080
|
+
elem.kind !== "bool" &&
|
|
2081
|
+
elem.kind !== "string") {
|
|
3410
2082
|
err(`arrIntrinsic indexEq requires primitive elements, got ${elem.kind}`, e.loc);
|
|
3411
2083
|
}
|
|
3412
2084
|
if (e.method === "flatCopy" && !typeEquals(e.type, e.receiver.type)) {
|
|
@@ -3416,7 +2088,9 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
3416
2088
|
err("arrIntrinsic flatOne result must match the nested array type", e.loc);
|
|
3417
2089
|
}
|
|
3418
2090
|
if (e.method === "join" &&
|
|
3419
|
-
elem.kind !== "f64" &&
|
|
2091
|
+
elem.kind !== "f64" &&
|
|
2092
|
+
elem.kind !== "string" &&
|
|
2093
|
+
elem.kind !== "bool" &&
|
|
3420
2094
|
!(elem.kind === "union" &&
|
|
3421
2095
|
(unions
|
|
3422
2096
|
.get(elem.unionId)
|
|
@@ -3429,11 +2103,14 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
3429
2103
|
// misjudge JS ===; the frontend fences these.
|
|
3430
2104
|
err(`arrIntrinsic ${e.method} on union elements (frontend must reject)`, e.loc);
|
|
3431
2105
|
}
|
|
3432
|
-
if ((e.method === "shift" || e.method === "pop") &&
|
|
2106
|
+
if ((e.method === "shift" || e.method === "pop") &&
|
|
2107
|
+
!(elem.kind === "dyn" && e.type.kind === "dyn")) {
|
|
3433
2108
|
const rdef = e.type.kind === "union" ? unions.get(e.type.unionId) : undefined;
|
|
3434
2109
|
if (!rdef ||
|
|
3435
2110
|
!rdef.arms.some((arm) => arm.kind === "undefinedT") ||
|
|
3436
|
-
!(elem.kind === "union"
|
|
2111
|
+
!(elem.kind === "union"
|
|
2112
|
+
? typeEquals(elem, e.type)
|
|
2113
|
+
: rdef.arms.some((arm) => typeEquals(arm, elem)))) {
|
|
3437
2114
|
err(`arrIntrinsic ${e.method} result must be the elem|undefined union`, e.loc);
|
|
3438
2115
|
}
|
|
3439
2116
|
}
|
|
@@ -3523,13 +2200,17 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
3523
2200
|
}
|
|
3524
2201
|
break;
|
|
3525
2202
|
}
|
|
3526
|
-
if (e.method === "valueSet" &&
|
|
2203
|
+
if (e.method === "valueSet" &&
|
|
2204
|
+
!isSupportedSetElem(value, value.kind === "union" ? unions.get(value.unionId)?.arms : undefined)) {
|
|
3527
2205
|
err(`mapIntrinsic valueSet element kind ${value.kind} (frontend must fence)`, e.loc);
|
|
3528
2206
|
}
|
|
3529
2207
|
const sig = e.method === "clone"
|
|
3530
2208
|
? { argTypes: [], result: e.receiver.type }
|
|
3531
2209
|
: e.method === "keySet" || e.method === "valueSet"
|
|
3532
|
-
? {
|
|
2210
|
+
? {
|
|
2211
|
+
argTypes: [],
|
|
2212
|
+
result: { kind: "set", elem: e.method === "keySet" ? key : value },
|
|
2213
|
+
}
|
|
3533
2214
|
: e.method === "set"
|
|
3534
2215
|
? { argTypes: [key, value], result: VOID }
|
|
3535
2216
|
: e.method === "has" || e.method === "delete"
|
|
@@ -3929,7 +2610,8 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
3929
2610
|
// word to read; a standalone target class has one possible value
|
|
3930
2611
|
// and the frontend folds it statically.
|
|
3931
2612
|
if (classes.get(e.classValue.type.className)?.localCaptures !== undefined &&
|
|
3932
|
-
e.value.type.kind === "object" &&
|
|
2613
|
+
e.value.type.kind === "object" &&
|
|
2614
|
+
classes.get(e.value.type.className)?.localCaptures !== undefined)
|
|
3933
2615
|
break;
|
|
3934
2616
|
if (!hierarchy.has(e.classValue.type.className)) {
|
|
3935
2617
|
err(`instanceOfValue against standalone class "${e.classValue.type.className}"`, e.loc);
|
|
@@ -4120,12 +2802,14 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4120
2802
|
// literal key naming no declared field) skip the declared check
|
|
4121
2803
|
// and require the overflow to exist.
|
|
4122
2804
|
const surfaces = (t) => typeEquals(t, e.type) ||
|
|
4123
|
-
(e.type.kind === "union" &&
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
(!!
|
|
4128
|
-
|
|
2805
|
+
(e.type.kind === "union" &&
|
|
2806
|
+
(() => {
|
|
2807
|
+
const result = unions.get(e.type.unionId);
|
|
2808
|
+
const source = t.kind === "union" ? unions.get(t.unionId) : undefined;
|
|
2809
|
+
return (!!result &&
|
|
2810
|
+
(result.arms.some((a) => typeEquals(a, t)) ||
|
|
2811
|
+
(!!source && unionWideningTags(source.arms, result.arms) !== null)));
|
|
2812
|
+
})()) ||
|
|
4129
2813
|
e.type.kind === "dyn";
|
|
4130
2814
|
if (e.overflowOnly && !shape.indexValue) {
|
|
4131
2815
|
err(`recordKeyGet on ${e.shapeId}: overflowOnly read of a shape without an index signature`, e.loc);
|
|
@@ -4336,7 +3020,8 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4336
3020
|
expectType(e.value, { kind: "dyn" }, "dynTest operand");
|
|
4337
3021
|
if (e.type.kind !== "bool")
|
|
4338
3022
|
err("dynTest must be bool", e.loc);
|
|
4339
|
-
if (e.bytesElem !== undefined &&
|
|
3023
|
+
if (e.bytesElem !== undefined &&
|
|
3024
|
+
(e.test !== "bytes" || !Object.hasOwn(BYTES_ELEMENT_NAME, e.bytesElem))) {
|
|
4340
3025
|
err("dynTest bytesElem requires a valid bytes test", e.loc);
|
|
4341
3026
|
}
|
|
4342
3027
|
break;
|
|
@@ -4414,7 +3099,9 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4414
3099
|
checkExpr(e.value);
|
|
4415
3100
|
expectType(e.value, { kind: "caught" }, "caughtNarrow operand");
|
|
4416
3101
|
const t = e.type;
|
|
4417
|
-
const ok = t.kind === "f64" ||
|
|
3102
|
+
const ok = t.kind === "f64" ||
|
|
3103
|
+
t.kind === "bool" ||
|
|
3104
|
+
t.kind === "string" ||
|
|
4418
3105
|
(t.kind === "object" && hierarchy.has(t.className));
|
|
4419
3106
|
if (!ok) {
|
|
4420
3107
|
err(`caughtNarrow to ${t.kind === "object" ? `non-hierarchy class "${t.className}"` : t.kind}`, e.loc);
|
|
@@ -4502,11 +3189,14 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4502
3189
|
// non-unit arms have no keyed read at all. Number keys read ARRAY
|
|
4503
3190
|
// arms; string keys read RECORD arms.
|
|
4504
3191
|
const resultUnion = e.type.kind === "union" ? unions.get(e.type.unionId) : undefined;
|
|
4505
|
-
const surfaces = (t) => typeEquals(t, e.type) ||
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
3192
|
+
const surfaces = (t) => typeEquals(t, e.type) ||
|
|
3193
|
+
!!resultUnion?.arms.some((a) => typeEquals(a, t)) ||
|
|
3194
|
+
(t.kind === "union" &&
|
|
3195
|
+
!!resultUnion &&
|
|
3196
|
+
(() => {
|
|
3197
|
+
const source = unions.get(t.unionId);
|
|
3198
|
+
return !!source && unionWideningTags(source.arms, resultUnion.arms) !== null;
|
|
3199
|
+
})());
|
|
4510
3200
|
def.arms.forEach((arm, i) => {
|
|
4511
3201
|
if (arm.kind === "undefinedT" || arm.kind === "nullT") {
|
|
4512
3202
|
if (!resultUnion?.arms.some((a) => a.kind === "undefinedT")) {
|
|
@@ -4684,25 +3374,32 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4684
3374
|
// The stream constructors (trailing option callbacks), write/end
|
|
4685
3375
|
// (the optional chunk/cb tail), and unpipe (the optional
|
|
4686
3376
|
// destination) admit a longer list the same way.
|
|
4687
|
-
const variadic = e.fn === "emitter.emit" ||
|
|
4688
|
-
e.fn === "
|
|
4689
|
-
e.fn === "
|
|
3377
|
+
const variadic = e.fn === "emitter.emit" ||
|
|
3378
|
+
e.fn === "emitter.emitFlex" ||
|
|
3379
|
+
e.fn === "readable.new" ||
|
|
3380
|
+
e.fn === "writable.new" ||
|
|
3381
|
+
e.fn === "duplex.new" ||
|
|
3382
|
+
e.fn === "transform.new" ||
|
|
4690
3383
|
e.fn === "passthrough.new" ||
|
|
4691
|
-
e.fn === "readable.init" ||
|
|
4692
|
-
e.fn === "
|
|
3384
|
+
e.fn === "readable.init" ||
|
|
3385
|
+
e.fn === "writable.init" ||
|
|
3386
|
+
e.fn === "duplex.init" ||
|
|
3387
|
+
e.fn === "transform.init" ||
|
|
4693
3388
|
e.fn === "passthrough.init" ||
|
|
4694
|
-
e.fn === "readable.initDyn" ||
|
|
4695
|
-
e.fn === "
|
|
3389
|
+
e.fn === "readable.initDyn" ||
|
|
3390
|
+
e.fn === "writable.initDyn" ||
|
|
3391
|
+
e.fn === "duplex.initDyn" ||
|
|
3392
|
+
e.fn === "transform.initDyn" ||
|
|
4696
3393
|
e.fn === "passthrough.initDyn" ||
|
|
4697
|
-
e.fn === "stream.pipeline" ||
|
|
3394
|
+
e.fn === "stream.pipeline" ||
|
|
3395
|
+
e.fn === "stream.pipelineDyn" ||
|
|
4698
3396
|
e.fn === "sp.pipeline" ||
|
|
4699
3397
|
e.fn === "writable.write" ||
|
|
4700
|
-
e.fn === "writable.writeStr" ||
|
|
3398
|
+
e.fn === "writable.writeStr" ||
|
|
3399
|
+
e.fn === "writable.writeU" ||
|
|
4701
3400
|
e.fn === "writable.end" ||
|
|
4702
3401
|
e.fn === "readable.unpipe";
|
|
4703
|
-
if (variadic
|
|
4704
|
-
? e.args.length < sig.argTypes.length
|
|
4705
|
-
: e.args.length !== sig.argTypes.length) {
|
|
3402
|
+
if (variadic ? e.args.length < sig.argTypes.length : e.args.length !== sig.argTypes.length) {
|
|
4706
3403
|
err(`libCall ${e.fn}: ${e.args.length} args, expected ${sig.argTypes.length}`, e.loc);
|
|
4707
3404
|
}
|
|
4708
3405
|
e.args.forEach((a, i) => {
|
|
@@ -4725,7 +3422,12 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4725
3422
|
return;
|
|
4726
3423
|
if (checkLibEmitterCall(e, sig.result))
|
|
4727
3424
|
return;
|
|
4728
|
-
if (e.fn === "error.stack" ||
|
|
3425
|
+
if (e.fn === "error.stack" ||
|
|
3426
|
+
e.fn === "error.cause" ||
|
|
3427
|
+
e.fn === "error.hasCause" ||
|
|
3428
|
+
e.fn === "error.setCause" ||
|
|
3429
|
+
e.fn === "error.defineCause" ||
|
|
3430
|
+
e.fn === "error.deleteCause") {
|
|
4729
3431
|
const recv = e.args[0];
|
|
4730
3432
|
let cls = recv?.type.kind === "object" ? classes.get(recv.type.className) : undefined;
|
|
4731
3433
|
while (cls?.base)
|
|
@@ -4748,7 +3450,11 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4748
3450
|
}
|
|
4749
3451
|
}
|
|
4750
3452
|
function checkLibValueCall(e) {
|
|
4751
|
-
if (e.fn === "fileHandle.read" ||
|
|
3453
|
+
if (e.fn === "fileHandle.read" ||
|
|
3454
|
+
e.fn === "fileHandle.writeBytes" ||
|
|
3455
|
+
e.fn === "fileHandle.writeStr" ||
|
|
3456
|
+
e.fn === "fileHandle.readv" ||
|
|
3457
|
+
e.fn === "fileHandle.writev") {
|
|
4752
3458
|
const inner = e.type.kind === "promise" ? e.type.inner : undefined;
|
|
4753
3459
|
const shape = inner?.kind === "record" ? records.get(inner.shapeId) : undefined;
|
|
4754
3460
|
const countName = e.fn === "fileHandle.read" || e.fn === "fileHandle.readv" ? "bytesRead" : "bytesWritten";
|
|
@@ -4756,8 +3462,13 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4756
3462
|
const payload = e.args[1]?.type;
|
|
4757
3463
|
const count = shape ? recordValidation.get(shape.id)?.fields.get(countName) : undefined;
|
|
4758
3464
|
const buffer = shape ? recordValidation.get(shape.id)?.fields.get(payloadName) : undefined;
|
|
4759
|
-
const ok = shape !== undefined &&
|
|
4760
|
-
|
|
3465
|
+
const ok = shape !== undefined &&
|
|
3466
|
+
!shape.tuple &&
|
|
3467
|
+
shape.indexValue === undefined &&
|
|
3468
|
+
shape.fields.length === 2 &&
|
|
3469
|
+
count?.kind === "f64" &&
|
|
3470
|
+
payload !== undefined &&
|
|
3471
|
+
buffer !== undefined &&
|
|
4761
3472
|
typeEquals(buffer, payload);
|
|
4762
3473
|
if (!ok) {
|
|
4763
3474
|
err(`libCall ${e.fn} must return a promise of { ${countName}: number, ${payloadName} }`, e.loc);
|
|
@@ -4787,8 +3498,7 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4787
3498
|
const inner = e.type.kind === "promise" ? e.type.inner : null;
|
|
4788
3499
|
const union = inner?.kind === "union" ? unions.get(inner.unionId) : undefined;
|
|
4789
3500
|
if (inner === null ||
|
|
4790
|
-
(!typeEquals(inner, valueType) &&
|
|
4791
|
-
!union?.arms.some((arm) => typeEquals(arm, valueType)))) {
|
|
3501
|
+
(!typeEquals(inner, valueType) && !union?.arms.some((arm) => typeEquals(arm, valueType)))) {
|
|
4792
3502
|
err(`libCall ${e.fn} must return a promise whose value includes ${valueType.kind}`, e.loc);
|
|
4793
3503
|
}
|
|
4794
3504
|
return true;
|
|
@@ -4864,7 +3574,8 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4864
3574
|
}
|
|
4865
3575
|
if (e.fn === "http2.serverOnSessionError") {
|
|
4866
3576
|
const cbT = e.args[1]?.type;
|
|
4867
|
-
const ok = cbT?.kind === "func" &&
|
|
3577
|
+
const ok = cbT?.kind === "func" &&
|
|
3578
|
+
cbT.ret.kind === "void" &&
|
|
4868
3579
|
cbT.params.length <= 2 &&
|
|
4869
3580
|
(cbT.params[0] === undefined ||
|
|
4870
3581
|
(cbT.params[0].kind === "object" && cbT.params[0].className === "%Error")) &&
|
|
@@ -4937,16 +3648,24 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4937
3648
|
}
|
|
4938
3649
|
return true;
|
|
4939
3650
|
}
|
|
4940
|
-
if (e.fn === "http.requestCb" ||
|
|
4941
|
-
e.fn === "
|
|
4942
|
-
e.fn === "http.
|
|
3651
|
+
if (e.fn === "http.requestCb" ||
|
|
3652
|
+
e.fn === "https.requestCb" ||
|
|
3653
|
+
e.fn === "http.requestUrlCb" ||
|
|
3654
|
+
e.fn === "http.clientOnResponse" ||
|
|
3655
|
+
e.fn === "http.requestAgentCb" ||
|
|
3656
|
+
e.fn === "https.requestAgentCb" ||
|
|
4943
3657
|
e.fn === "https.requestUrlCb") {
|
|
4944
3658
|
// The response listener: void, no params or exactly (res: httpReq).
|
|
4945
|
-
const cbT = e.args[e.fn === "http.requestCb"
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
|
|
3659
|
+
const cbT = e.args[e.fn === "http.requestCb"
|
|
3660
|
+
? 7
|
|
3661
|
+
: e.fn === "https.requestCb"
|
|
3662
|
+
? 9
|
|
3663
|
+
: e.fn === "http.requestUrlCb" || e.fn === "https.requestUrlCb"
|
|
3664
|
+
? 3
|
|
3665
|
+
: e.fn === "http.requestAgentCb"
|
|
3666
|
+
? 8
|
|
3667
|
+
: e.fn === "https.requestAgentCb"
|
|
3668
|
+
? 10
|
|
4950
3669
|
: 1]?.type;
|
|
4951
3670
|
let ok = cbT?.kind === "func" && cbT.ret.kind === "void" && cbT.params.length <= 1;
|
|
4952
3671
|
if (ok && cbT?.kind === "func" && cbT.params.length === 1) {
|
|
@@ -4982,7 +3701,8 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4982
3701
|
}
|
|
4983
3702
|
return true;
|
|
4984
3703
|
}
|
|
4985
|
-
if (e.fn === "http.serverOnUpgrade" ||
|
|
3704
|
+
if (e.fn === "http.serverOnUpgrade" ||
|
|
3705
|
+
e.fn === "http.clientOnUpgrade" ||
|
|
4986
3706
|
e.fn === "http.serverOnConnect") {
|
|
4987
3707
|
// (req, socket, head) or any shorter prefix, void return. The
|
|
4988
3708
|
// 'connect' registration additionally admits a socket slot
|
|
@@ -5019,8 +3739,11 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5019
3739
|
let ok = funcOk(t);
|
|
5020
3740
|
if (!ok && t?.kind === "union") {
|
|
5021
3741
|
const def = unions.get(t.unionId);
|
|
5022
|
-
ok =
|
|
5023
|
-
def
|
|
3742
|
+
ok =
|
|
3743
|
+
!!def &&
|
|
3744
|
+
def.arms.length === 2 &&
|
|
3745
|
+
def.arms.some((a) => funcOk(a)) &&
|
|
3746
|
+
def.arms.some((a) => a.kind === "undefinedT");
|
|
5024
3747
|
}
|
|
5025
3748
|
if (!ok) {
|
|
5026
3749
|
err(`libCall ${e.fn} callback shape (frontend must fence)`, e.loc);
|
|
@@ -5033,13 +3756,20 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5033
3756
|
// void — the emitter synthesizes the answer thunk from these
|
|
5034
3757
|
// types, so the structure must hold.
|
|
5035
3758
|
const t = e.args[2]?.type;
|
|
5036
|
-
let ok = t?.kind === "func" &&
|
|
5037
|
-
t.
|
|
3759
|
+
let ok = t?.kind === "func" &&
|
|
3760
|
+
t.ret.kind === "void" &&
|
|
3761
|
+
t.params.length === 3 &&
|
|
3762
|
+
t.params[0].kind === "string" &&
|
|
3763
|
+
t.params[1].kind === "dyn";
|
|
5038
3764
|
if (ok && t?.kind === "func") {
|
|
5039
3765
|
const cbT = t.params[2];
|
|
5040
|
-
ok =
|
|
5041
|
-
cbT.
|
|
5042
|
-
|
|
3766
|
+
ok =
|
|
3767
|
+
cbT.kind === "func" &&
|
|
3768
|
+
cbT.ret.kind === "void" &&
|
|
3769
|
+
cbT.params.length === 2 &&
|
|
3770
|
+
cbT.params[0].kind === "union" &&
|
|
3771
|
+
cbT.params[1].kind === "array" &&
|
|
3772
|
+
cbT.params[1].elem.kind === "record";
|
|
5043
3773
|
}
|
|
5044
3774
|
if (!ok) {
|
|
5045
3775
|
err(`libCall net.connectLookup resolver shape (frontend must fence)`, e.loc);
|
|
@@ -5054,7 +3784,9 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5054
3784
|
}
|
|
5055
3785
|
if (e.fn === "http.requestConnCb") {
|
|
5056
3786
|
const cbT = e.args[6]?.type;
|
|
5057
|
-
const ok = cbT?.kind === "func" &&
|
|
3787
|
+
const ok = cbT?.kind === "func" &&
|
|
3788
|
+
cbT.ret.kind === "void" &&
|
|
3789
|
+
cbT.params.length <= 1 &&
|
|
5058
3790
|
(cbT.params[0] === undefined || cbT.params[0].kind === "httpReq");
|
|
5059
3791
|
if (!ok)
|
|
5060
3792
|
err(`libCall ${e.fn} callback shape (frontend must fence)`, e.loc);
|
|
@@ -5075,7 +3807,8 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5075
3807
|
}
|
|
5076
3808
|
if (e.fn === "http.resSocket") {
|
|
5077
3809
|
const def = e.type.kind === "union" ? unions.get(e.type.unionId) : undefined;
|
|
5078
|
-
const ok = def &&
|
|
3810
|
+
const ok = def &&
|
|
3811
|
+
def.arms.length === 2 &&
|
|
5079
3812
|
def.arms.some((a) => a.kind === "netSocket") &&
|
|
5080
3813
|
def.arms.some((a) => a.kind === "nullT");
|
|
5081
3814
|
if (!ok)
|
|
@@ -5084,14 +3817,18 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5084
3817
|
}
|
|
5085
3818
|
if (e.fn === "http.reqH2Stream") {
|
|
5086
3819
|
const def = e.type.kind === "union" ? unions.get(e.type.unionId) : undefined;
|
|
5087
|
-
const ok = def &&
|
|
3820
|
+
const ok = def &&
|
|
3821
|
+
def.arms.length === 2 &&
|
|
5088
3822
|
def.arms.some((a) => a.kind === "http2Stream") &&
|
|
5089
3823
|
def.arms.some((a) => a.kind === "undefinedT");
|
|
5090
3824
|
if (!ok)
|
|
5091
3825
|
err(`libCall http.reqH2Stream must return the 'Http2Stream | undefined' union`, e.loc);
|
|
5092
3826
|
return true;
|
|
5093
3827
|
}
|
|
5094
|
-
if (e.fn === "http.reqHeader" ||
|
|
3828
|
+
if (e.fn === "http.reqHeader" ||
|
|
3829
|
+
e.fn === "http.reqTrailer" ||
|
|
3830
|
+
e.fn === "http.resGetHeader" ||
|
|
3831
|
+
e.fn === "http.clientGetHeader") {
|
|
5095
3832
|
// Result is the interned `string | undefined` union (envGet's).
|
|
5096
3833
|
const def = e.type.kind === "union" ? unions.get(e.type.unionId) : undefined;
|
|
5097
3834
|
const ok = def &&
|
|
@@ -5105,24 +3842,30 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5105
3842
|
}
|
|
5106
3843
|
if (e.fn === "http.reqHeaderValues" || e.fn === "http.reqTrailerValues") {
|
|
5107
3844
|
const def = e.type.kind === "union" ? unions.get(e.type.unionId) : undefined;
|
|
5108
|
-
const ok = def &&
|
|
5109
|
-
def.arms
|
|
3845
|
+
const ok = def &&
|
|
3846
|
+
def.arms.length === 2 &&
|
|
3847
|
+
def.arms[0].kind === "array" &&
|
|
3848
|
+
def.arms[0].elem.kind === "string" &&
|
|
5110
3849
|
def.arms[1].kind === "undefinedT";
|
|
5111
3850
|
if (!ok)
|
|
5112
3851
|
err(`libCall ${e.fn} must return the 'string[] | undefined' union`, e.loc);
|
|
5113
3852
|
return true;
|
|
5114
3853
|
}
|
|
5115
|
-
if (e.fn === "net.createServerCb" ||
|
|
3854
|
+
if (e.fn === "net.createServerCb" ||
|
|
3855
|
+
e.fn === "net.serverOnConnection" ||
|
|
5116
3856
|
e.fn === "net.serverOnSecureConnection" ||
|
|
5117
|
-
e.fn === "http.serverSetTimeoutCb" ||
|
|
3857
|
+
e.fn === "http.serverSetTimeoutCb" ||
|
|
3858
|
+
e.fn === "http.serverOnTimeout" ||
|
|
5118
3859
|
e.fn === "http.clientOnSocket" ||
|
|
5119
|
-
e.fn === "net.sockOnData" ||
|
|
3860
|
+
e.fn === "net.sockOnData" ||
|
|
3861
|
+
e.fn === "net.serverOnError" ||
|
|
5120
3862
|
e.fn === "net.sockOnError") {
|
|
5121
3863
|
// The program-dependent listener shapes: a void closure with no
|
|
5122
3864
|
// params, or exactly the one supported parameter per event
|
|
5123
3865
|
// (socket handle / data chunk bytes / error %Error). The
|
|
5124
3866
|
// callback slot is arg 0 for createServerCb, arg 1 otherwise.
|
|
5125
|
-
const cbT = e.args[e.fn === "net.createServerCb" ? 0 : e.fn === "http.serverSetTimeoutCb" ? 2 : 1]
|
|
3867
|
+
const cbT = e.args[e.fn === "net.createServerCb" ? 0 : e.fn === "http.serverSetTimeoutCb" ? 2 : 1]
|
|
3868
|
+
?.type;
|
|
5126
3869
|
let ok = cbT?.kind === "func" && cbT.ret.kind === "void" && cbT.params.length <= 1;
|
|
5127
3870
|
if (ok && cbT?.kind === "func" && cbT.params.length === 1) {
|
|
5128
3871
|
const p = cbT.params[0];
|
|
@@ -5147,15 +3890,20 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5147
3890
|
// (Error|null, SecureContext|undefined) whose arms the emitted
|
|
5148
3891
|
// answer thunk decodes; here the structural func shape is what
|
|
5149
3892
|
// the validator can pin.
|
|
5150
|
-
const sniOk = (t) => t?.kind === "func" &&
|
|
5151
|
-
t.
|
|
3893
|
+
const sniOk = (t) => t?.kind === "func" &&
|
|
3894
|
+
t.ret.kind === "void" &&
|
|
3895
|
+
t.params.length === 2 &&
|
|
3896
|
+
t.params[0].kind === "string" &&
|
|
3897
|
+
t.params[1].kind === "func";
|
|
5152
3898
|
const argT = e.args[2]?.type;
|
|
5153
3899
|
let ok = sniOk(argT);
|
|
5154
3900
|
if (!ok && argT?.kind === "union") {
|
|
5155
3901
|
const def = unions.get(argT.unionId);
|
|
5156
|
-
ok =
|
|
5157
|
-
def
|
|
5158
|
-
|
|
3902
|
+
ok =
|
|
3903
|
+
def !== undefined &&
|
|
3904
|
+
def.arms.length === 2 &&
|
|
3905
|
+
def.arms.some((a) => a.kind === "undefinedT") &&
|
|
3906
|
+
def.arms.some((a) => sniOk(a));
|
|
5159
3907
|
}
|
|
5160
3908
|
if (!ok) {
|
|
5161
3909
|
err(`libCall ${e.fn} SNI callback shape (frontend must fence)`, e.loc);
|
|
@@ -5215,20 +3963,26 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5215
3963
|
return false;
|
|
5216
3964
|
}
|
|
5217
3965
|
function checkLibFileCall(e) {
|
|
5218
|
-
if (e.fn === "zlib.deflateCb" ||
|
|
5219
|
-
e.fn === "zlib.
|
|
5220
|
-
e.fn === "zlib.
|
|
3966
|
+
if (e.fn === "zlib.deflateCb" ||
|
|
3967
|
+
e.fn === "zlib.inflateCb" ||
|
|
3968
|
+
e.fn === "zlib.deflateRawCb" ||
|
|
3969
|
+
e.fn === "zlib.inflateRawCb" ||
|
|
3970
|
+
e.fn === "zlib.gzipCb" ||
|
|
3971
|
+
e.fn === "zlib.gunzipCb" ||
|
|
3972
|
+
e.fn === "zlib.unzipCb") {
|
|
5221
3973
|
const cbT = e.args[1]?.type;
|
|
5222
3974
|
let ok = cbT?.kind === "func" && cbT.ret.kind === "void" && cbT.params.length <= 2;
|
|
5223
3975
|
if (ok && cbT?.kind === "func" && cbT.params.length >= 1) {
|
|
5224
3976
|
const error = cbT.params[0];
|
|
5225
3977
|
if (error.kind !== "dyn") {
|
|
5226
3978
|
const def = error.kind === "union" ? unions.get(error.unionId) : undefined;
|
|
5227
|
-
ok =
|
|
5228
|
-
def
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
(arm
|
|
3979
|
+
ok =
|
|
3980
|
+
def !== undefined &&
|
|
3981
|
+
def.arms.some((arm) => arm.kind === "nullT") &&
|
|
3982
|
+
def.arms.some((arm) => arm.kind === "object" && arm.className === "%Error") &&
|
|
3983
|
+
def.arms.every((arm) => arm.kind === "nullT" ||
|
|
3984
|
+
arm.kind === "undefinedT" ||
|
|
3985
|
+
(arm.kind === "object" && arm.className === "%Error"));
|
|
5232
3986
|
}
|
|
5233
3987
|
}
|
|
5234
3988
|
if (ok && cbT?.kind === "func" && cbT.params.length === 2) {
|
|
@@ -5258,7 +4012,8 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5258
4012
|
def !== undefined &&
|
|
5259
4013
|
def.arms.some((a) => a.kind === "nullT") &&
|
|
5260
4014
|
def.arms.some((a) => a.kind === "object" && a.className === "%Error") &&
|
|
5261
|
-
def.arms.every((a) => a.kind === "nullT" ||
|
|
4015
|
+
def.arms.every((a) => a.kind === "nullT" ||
|
|
4016
|
+
a.kind === "undefinedT" ||
|
|
5262
4017
|
(a.kind === "object" && a.className === "%Error"));
|
|
5263
4018
|
}
|
|
5264
4019
|
}
|
|
@@ -5273,9 +4028,12 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5273
4028
|
const shape = e.type.kind === "record" ? records.get(e.type.shapeId) : undefined;
|
|
5274
4029
|
const ok = shape !== undefined &&
|
|
5275
4030
|
shape.fields.length === 3 &&
|
|
5276
|
-
shape.fields[0].name === "address" &&
|
|
5277
|
-
shape.fields[
|
|
5278
|
-
shape.fields[
|
|
4031
|
+
shape.fields[0].name === "address" &&
|
|
4032
|
+
shape.fields[0].type.kind === "string" &&
|
|
4033
|
+
shape.fields[1].name === "family" &&
|
|
4034
|
+
shape.fields[1].type.kind === "string" &&
|
|
4035
|
+
shape.fields[2].name === "port" &&
|
|
4036
|
+
shape.fields[2].type.kind === "f64";
|
|
5279
4037
|
if (!ok) {
|
|
5280
4038
|
err(`libCall net.serverAddress must return the {address, family, port} record`, e.loc);
|
|
5281
4039
|
}
|
|
@@ -5286,9 +4044,12 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5286
4044
|
const shape = e.type.kind === "record" ? records.get(e.type.shapeId) : undefined;
|
|
5287
4045
|
const ok = shape !== undefined &&
|
|
5288
4046
|
shape.fields.length === 3 &&
|
|
5289
|
-
shape.fields[0].name === "address" &&
|
|
5290
|
-
shape.fields[
|
|
5291
|
-
shape.fields[
|
|
4047
|
+
shape.fields[0].name === "address" &&
|
|
4048
|
+
shape.fields[0].type.kind === "string" &&
|
|
4049
|
+
shape.fields[1].name === "family" &&
|
|
4050
|
+
shape.fields[1].type.kind === "string" &&
|
|
4051
|
+
shape.fields[2].name === "port" &&
|
|
4052
|
+
shape.fields[2].type.kind === "f64";
|
|
5292
4053
|
if (!ok) {
|
|
5293
4054
|
err(`libCall dgram.address must return the {address, family, port} record`, e.loc);
|
|
5294
4055
|
}
|
|
@@ -5299,7 +4060,9 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5299
4060
|
// name: string, parentPath: string} rows (canonical field
|
|
5300
4061
|
// order; the structure lowerFsReaddirTypesCall pinned).
|
|
5301
4062
|
const result = e.fn === "fsp.readdirTypes"
|
|
5302
|
-
? e.type.kind === "promise"
|
|
4063
|
+
? e.type.kind === "promise"
|
|
4064
|
+
? e.type.inner
|
|
4065
|
+
: undefined
|
|
5303
4066
|
: e.type;
|
|
5304
4067
|
const shape = result?.kind === "array" && result.elem.kind === "record"
|
|
5305
4068
|
? records.get(result.elem.shapeId)
|
|
@@ -5308,9 +4071,12 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5308
4071
|
!shape.tuple &&
|
|
5309
4072
|
shape.indexValue === undefined &&
|
|
5310
4073
|
shape.fields.length === 3 &&
|
|
5311
|
-
shape.fields[0].name === "%dtype" &&
|
|
5312
|
-
shape.fields[
|
|
5313
|
-
shape.fields[
|
|
4074
|
+
shape.fields[0].name === "%dtype" &&
|
|
4075
|
+
shape.fields[0].type.kind === "f64" &&
|
|
4076
|
+
shape.fields[1].name === "name" &&
|
|
4077
|
+
shape.fields[1].type.kind === "string" &&
|
|
4078
|
+
shape.fields[2].name === "parentPath" &&
|
|
4079
|
+
shape.fields[2].type.kind === "string";
|
|
5314
4080
|
if (!ok) {
|
|
5315
4081
|
err(`libCall ${e.fn} must return ${e.fn === "fsp.readdirTypes" ? "a promise of " : ""}the Dirent record array`, e.loc);
|
|
5316
4082
|
}
|
|
@@ -5322,12 +4088,28 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5322
4088
|
// scopeid f64, the other's `number | undefined`) — the structure
|
|
5323
4089
|
// lowerOsNetworkInterfacesCall pinned.
|
|
5324
4090
|
const shape = e.type.kind === "record" ? records.get(e.type.shapeId) : undefined;
|
|
5325
|
-
let ok = shape !== undefined &&
|
|
5326
|
-
|
|
4091
|
+
let ok = shape !== undefined &&
|
|
4092
|
+
!shape.tuple &&
|
|
4093
|
+
shape.fields.length === 0 &&
|
|
4094
|
+
shape.indexValue !== undefined;
|
|
4095
|
+
const ivDef = ok && shape.indexValue.kind === "union"
|
|
4096
|
+
? unions.get(shape.indexValue.unionId)
|
|
4097
|
+
: undefined;
|
|
5327
4098
|
const arrArm = ivDef?.arms.find((a) => a.kind === "array");
|
|
5328
|
-
ok =
|
|
5329
|
-
|
|
5330
|
-
|
|
4099
|
+
ok =
|
|
4100
|
+
ok &&
|
|
4101
|
+
ivDef !== undefined &&
|
|
4102
|
+
ivDef.arms.length === 2 &&
|
|
4103
|
+
arrArm !== undefined &&
|
|
4104
|
+
ivDef.arms.some((a) => a.kind === "undefinedT");
|
|
4105
|
+
const infoDef = ok && arrArm.kind === "array" && arrArm.elem.kind === "union"
|
|
4106
|
+
? unions.get(arrArm.elem.unionId)
|
|
4107
|
+
: undefined;
|
|
4108
|
+
ok =
|
|
4109
|
+
ok &&
|
|
4110
|
+
infoDef !== undefined &&
|
|
4111
|
+
infoDef.arms.length === 2 &&
|
|
4112
|
+
infoDef.arms.every((a) => a.kind === "record");
|
|
5331
4113
|
if (!ok) {
|
|
5332
4114
|
err(`libCall os.networkInterfaces must return the NetworkInterfaceInfo dictionary record`, e.loc);
|
|
5333
4115
|
}
|
|
@@ -5341,12 +4123,22 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5341
4123
|
// number arm, type-level only) — the structure
|
|
5342
4124
|
// lowerQuerystringParseCall pinned.
|
|
5343
4125
|
const shape = e.type.kind === "record" ? records.get(e.type.shapeId) : undefined;
|
|
5344
|
-
let ok = shape !== undefined &&
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
4126
|
+
let ok = shape !== undefined &&
|
|
4127
|
+
!shape.tuple &&
|
|
4128
|
+
shape.fields.length === 0 &&
|
|
4129
|
+
shape.indexValue !== undefined;
|
|
4130
|
+
const ivDef = ok && shape.indexValue.kind === "union"
|
|
4131
|
+
? unions.get(shape.indexValue.unionId)
|
|
4132
|
+
: undefined;
|
|
4133
|
+
ok =
|
|
4134
|
+
ok &&
|
|
4135
|
+
ivDef !== undefined &&
|
|
4136
|
+
ivDef.arms.some((a) => a.kind === "string") &&
|
|
4137
|
+
ivDef.arms.some((a) => a.kind === "array" && a.elem.kind === "string") &&
|
|
4138
|
+
ivDef.arms.every((a) => a.kind === "string" ||
|
|
4139
|
+
a.kind === "array" ||
|
|
4140
|
+
a.kind === "undefinedT" ||
|
|
4141
|
+
a.kind === "f64");
|
|
5350
4142
|
if (!ok) {
|
|
5351
4143
|
err(`libCall qs.parse must return the ParsedUrlQuery dictionary record`, e.loc);
|
|
5352
4144
|
}
|
|
@@ -5357,14 +4149,18 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5357
4149
|
function checkLibProcessCall(e) {
|
|
5358
4150
|
if (e.fn === "cp.execFile") {
|
|
5359
4151
|
const cb = e.args[2]?.type;
|
|
5360
|
-
if (cb?.kind !== "func" ||
|
|
4152
|
+
if (cb?.kind !== "func" ||
|
|
4153
|
+
cb.rest === true ||
|
|
4154
|
+
cb.params.length > 3 ||
|
|
4155
|
+
cb.ret.kind !== "void") {
|
|
5361
4156
|
err(`libCall cp.execFile callback must be a non-rest void function with at most three parameters`, e.loc);
|
|
5362
4157
|
}
|
|
5363
4158
|
else {
|
|
5364
4159
|
const error = cb.params[0];
|
|
5365
4160
|
if (error !== undefined) {
|
|
5366
4161
|
const def = error.kind === "union" ? unions.get(error.unionId) : undefined;
|
|
5367
|
-
if (!def ||
|
|
4162
|
+
if (!def ||
|
|
4163
|
+
def.arms.length !== 2 ||
|
|
5368
4164
|
!def.arms.some((arm) => arm.kind === "nullT") ||
|
|
5369
4165
|
!def.arms.some((arm) => arm.kind === "object" && arm.className === "%Error")) {
|
|
5370
4166
|
err(`libCall cp.execFile callback error parameter must be Error | null`, e.loc);
|
|
@@ -5382,7 +4178,10 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5382
4178
|
}
|
|
5383
4179
|
if (e.fn === "child.onSpawn") {
|
|
5384
4180
|
const cb = e.args[1];
|
|
5385
|
-
if (!cb ||
|
|
4181
|
+
if (!cb ||
|
|
4182
|
+
cb.type.kind !== "func" ||
|
|
4183
|
+
cb.type.params.length !== 0 ||
|
|
4184
|
+
cb.type.ret.kind !== "void")
|
|
5386
4185
|
err("child.onSpawn callback must be () => void", e.loc);
|
|
5387
4186
|
}
|
|
5388
4187
|
if (e.fn === "child.onExit" || e.fn === "child.onClose" || e.fn === "child.onError") {
|
|
@@ -5434,8 +4233,10 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5434
4233
|
err(`libCall ${e.fn} callback shape (frontend must fence)`, e.loc);
|
|
5435
4234
|
return true;
|
|
5436
4235
|
}
|
|
5437
|
-
if (e.fn === "process.onExit" ||
|
|
5438
|
-
e.fn === "
|
|
4236
|
+
if (e.fn === "process.onExit" ||
|
|
4237
|
+
e.fn === "process.offExit" ||
|
|
4238
|
+
e.fn === "stdin.onData" ||
|
|
4239
|
+
e.fn === "stdin.onError") {
|
|
5439
4240
|
// The listener: a void closure with no params, or exactly the
|
|
5440
4241
|
// one supported parameter shape per event (code number / data
|
|
5441
4242
|
// chunk bytes / error %Error).
|
|
@@ -5544,7 +4345,8 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5544
4345
|
const t = e.type;
|
|
5545
4346
|
const cbU = t.kind === "func" && t.params.length === 1 ? t.params[0] : null;
|
|
5546
4347
|
const def = cbU?.kind === "union" ? unions.get(cbU.unionId) : undefined;
|
|
5547
|
-
const ok = t.kind === "func" &&
|
|
4348
|
+
const ok = t.kind === "func" &&
|
|
4349
|
+
(t.ret.kind === "netServer" || t.ret.kind === "void") &&
|
|
5548
4350
|
def &&
|
|
5549
4351
|
def.arms.some((a) => a.kind === "func" && a.params.length <= 1 && a.ret.kind === "void") &&
|
|
5550
4352
|
def.arms.some((a) => a.kind === "undefinedT");
|
|
@@ -5581,10 +4383,17 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5581
4383
|
// of the undefined global mapped to (never materialized).
|
|
5582
4384
|
return true;
|
|
5583
4385
|
}
|
|
5584
|
-
if (e.fn === "error.nodeThrow" ||
|
|
5585
|
-
e.fn === "
|
|
5586
|
-
e.fn === "
|
|
5587
|
-
e.fn === "fs.
|
|
4386
|
+
if (e.fn === "error.nodeThrow" ||
|
|
4387
|
+
e.fn === "error.argTypeThrow" ||
|
|
4388
|
+
e.fn === "error.propTypeThrow" ||
|
|
4389
|
+
e.fn === "fs.mkdtempChk" ||
|
|
4390
|
+
e.fn === "fs.readFileChk" ||
|
|
4391
|
+
e.fn === "fs.opendirChk" ||
|
|
4392
|
+
e.fn === "fs.watchFileChk" ||
|
|
4393
|
+
e.fn === "fs.lchmodChk" ||
|
|
4394
|
+
e.fn === "fs.readChk" ||
|
|
4395
|
+
e.fn === "fs.streamOptsChk" ||
|
|
4396
|
+
e.fn === "net.connectOptsChk" ||
|
|
5588
4397
|
e.fn === "tls.caCertsChk") {
|
|
5589
4398
|
// Always throws — the result type is the replaced expression's
|
|
5590
4399
|
// own (never materialized; the global.undefRead pattern). The
|
|
@@ -5606,7 +4415,10 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5606
4415
|
}
|
|
5607
4416
|
return true;
|
|
5608
4417
|
}
|
|
5609
|
-
if (e.fn === "error.domCode" ||
|
|
4418
|
+
if (e.fn === "error.domCode" ||
|
|
4419
|
+
e.fn === "error.domHasCause" ||
|
|
4420
|
+
e.fn === "error.domCause" ||
|
|
4421
|
+
e.fn === "error.domClone") {
|
|
5610
4422
|
// Receiver: exactly %DOMException (subclassing is fenced — the
|
|
5611
4423
|
// hidden runtime slots admit no other layout).
|
|
5612
4424
|
const recv = e.args[0];
|
|
@@ -5664,12 +4476,19 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5664
4476
|
return false;
|
|
5665
4477
|
}
|
|
5666
4478
|
function checkLibStreamCall(e, fixedArgs, result) {
|
|
5667
|
-
if (e.fn.startsWith("readable.") ||
|
|
5668
|
-
e.fn.startsWith("
|
|
5669
|
-
e.fn.startsWith("
|
|
5670
|
-
e.fn
|
|
5671
|
-
e.fn
|
|
5672
|
-
e.fn === "stream.
|
|
4479
|
+
if (e.fn.startsWith("readable.") ||
|
|
4480
|
+
e.fn.startsWith("writable.") ||
|
|
4481
|
+
e.fn.startsWith("duplex.") ||
|
|
4482
|
+
e.fn.startsWith("transform.") ||
|
|
4483
|
+
e.fn.startsWith("passthrough.") ||
|
|
4484
|
+
e.fn === "stream.destroy" ||
|
|
4485
|
+
e.fn === "stream.destroyErr" ||
|
|
4486
|
+
e.fn === "stream.iteratorClose" ||
|
|
4487
|
+
e.fn === "stream.prop" ||
|
|
4488
|
+
e.fn === "stream.errored" ||
|
|
4489
|
+
e.fn === "stream.finished" ||
|
|
4490
|
+
e.fn === "stream.finishedDyn" ||
|
|
4491
|
+
e.fn === "stream.pipeline" ||
|
|
5673
4492
|
e.fn === "stream.pipelineDyn") {
|
|
5674
4493
|
// Receiver/result: stream-hierarchy objects (a class whose base
|
|
5675
4494
|
// chain reaches a runtime stream class). Constructors have no
|
|
@@ -5772,10 +4591,14 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5772
4591
|
}
|
|
5773
4592
|
return true;
|
|
5774
4593
|
}
|
|
5775
|
-
if (e.fn === "readable.pause" ||
|
|
5776
|
-
e.fn === "readable.
|
|
5777
|
-
e.fn === "readable.
|
|
5778
|
-
e.fn === "
|
|
4594
|
+
if (e.fn === "readable.pause" ||
|
|
4595
|
+
e.fn === "readable.resume" ||
|
|
4596
|
+
e.fn === "readable.unpipe" ||
|
|
4597
|
+
e.fn === "writable.end" ||
|
|
4598
|
+
e.fn === "readable.setEncoding" ||
|
|
4599
|
+
e.fn === "readable.pushEncoding" ||
|
|
4600
|
+
e.fn === "stream.destroy" ||
|
|
4601
|
+
e.fn === "stream.destroyErr" ||
|
|
5779
4602
|
e.fn === "stream.iteratorClose") {
|
|
5780
4603
|
if (!typeEquals(e.type, e.args[0].type)) {
|
|
5781
4604
|
err(`libCall ${e.fn} must return its receiver's type (the chaining 'this')`, e.loc);
|
|
@@ -5790,11 +4613,15 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5790
4613
|
}
|
|
5791
4614
|
if (e.fn === "readable.read" || e.fn === "readable.flowing" || e.fn === "stream.errored") {
|
|
5792
4615
|
const def = e.type.kind === "union" ? unions.get(e.type.unionId) : undefined;
|
|
5793
|
-
const wantArm = (t) => e.fn === "readable.read"
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
4616
|
+
const wantArm = (t) => e.fn === "readable.read"
|
|
4617
|
+
? t.kind === "bytes"
|
|
4618
|
+
: e.fn === "readable.flowing"
|
|
4619
|
+
? t.kind === "bool"
|
|
4620
|
+
: t.kind === "object";
|
|
4621
|
+
const ok = def &&
|
|
4622
|
+
def.arms.length === 2 &&
|
|
4623
|
+
def.arms.some(wantArm) &&
|
|
4624
|
+
def.arms.some((a) => a.kind === "nullT");
|
|
5798
4625
|
if (!ok)
|
|
5799
4626
|
err(`libCall ${e.fn} must return its nullable union`, e.loc);
|
|
5800
4627
|
return true;
|
|
@@ -5813,9 +4640,11 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5813
4640
|
return false;
|
|
5814
4641
|
}
|
|
5815
4642
|
function checkLibEmitterCall(e, result) {
|
|
5816
|
-
if ((e.fn.startsWith("emitter.") || e.fn === "stream.onDyn") &&
|
|
4643
|
+
if ((e.fn.startsWith("emitter.") || e.fn === "stream.onDyn") &&
|
|
4644
|
+
e.fn !== "emitter.setDefaultMax" &&
|
|
5817
4645
|
e.fn !== "emitter.setDefaultMaxChk" &&
|
|
5818
|
-
e.fn !== "emitter.getDefaultMax" &&
|
|
4646
|
+
e.fn !== "emitter.getDefaultMax" &&
|
|
4647
|
+
e.fn !== "emitter.checkListener") {
|
|
5819
4648
|
// Receiver: an emitter-hierarchy object (the %EventEmitter class
|
|
5820
4649
|
// itself, or a class whose base chain reaches it). emitter.new
|
|
5821
4650
|
// has no receiver — its RESULT is the bare emitter class.
|
|
@@ -5841,20 +4670,28 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5841
4670
|
return true;
|
|
5842
4671
|
}
|
|
5843
4672
|
// The chaining forms return the receiver's own static class.
|
|
5844
|
-
if (e.fn === "emitter.on" ||
|
|
5845
|
-
e.fn === "emitter.
|
|
5846
|
-
e.fn === "emitter.
|
|
5847
|
-
e.fn === "emitter.
|
|
4673
|
+
if (e.fn === "emitter.on" ||
|
|
4674
|
+
e.fn === "emitter.off" ||
|
|
4675
|
+
e.fn === "emitter.onDyn" ||
|
|
4676
|
+
e.fn === "emitter.onFlex" ||
|
|
4677
|
+
e.fn === "stream.onDyn" ||
|
|
4678
|
+
e.fn === "emitter.offDyn" ||
|
|
4679
|
+
e.fn === "emitter.onData" ||
|
|
4680
|
+
e.fn === "emitter.onDataDyn" ||
|
|
4681
|
+
e.fn === "emitter.removeAll" ||
|
|
4682
|
+
e.fn === "emitter.setMax" ||
|
|
5848
4683
|
e.fn === "emitter.setMaxChk") {
|
|
5849
4684
|
if (!typeEquals(e.type, e.args[0].type)) {
|
|
5850
4685
|
err(`libCall ${e.fn} must return its receiver's type (the chaining 'this')`, e.loc);
|
|
5851
4686
|
}
|
|
5852
4687
|
// The listener slots carry closures (the dyn family's checked-
|
|
5853
4688
|
// dynamic listener is table-checked; its adapter is a func).
|
|
5854
|
-
if ((e.fn === "emitter.on" || e.fn === "emitter.off" || e.fn === "emitter.onData") &&
|
|
4689
|
+
if ((e.fn === "emitter.on" || e.fn === "emitter.off" || e.fn === "emitter.onData") &&
|
|
4690
|
+
e.args[2]?.type.kind !== "func") {
|
|
5855
4691
|
err(`libCall ${e.fn} listener must be a func`, e.loc);
|
|
5856
4692
|
}
|
|
5857
|
-
if ((e.fn === "emitter.onDyn" || e.fn === "emitter.onDataDyn") &&
|
|
4693
|
+
if ((e.fn === "emitter.onDyn" || e.fn === "emitter.onDataDyn") &&
|
|
4694
|
+
e.args[3]?.type.kind !== "func") {
|
|
5858
4695
|
err(`libCall ${e.fn} adapter must be a func`, e.loc);
|
|
5859
4696
|
}
|
|
5860
4697
|
return true;
|
|
@@ -5894,9 +4731,14 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5894
4731
|
err("libCall emitter.emitFlex payloads must be checked-dynamic", e.loc);
|
|
5895
4732
|
}
|
|
5896
4733
|
}
|
|
5897
|
-
if (e.fn === "emitter.emit" ||
|
|
5898
|
-
e.fn === "emitter.
|
|
5899
|
-
e.fn === "emitter.
|
|
4734
|
+
if (e.fn === "emitter.emit" ||
|
|
4735
|
+
e.fn === "emitter.emitFlex" ||
|
|
4736
|
+
e.fn === "emitter.count" ||
|
|
4737
|
+
e.fn === "emitter.getMax" ||
|
|
4738
|
+
e.fn === "emitter.ctor" ||
|
|
4739
|
+
e.fn === "emitter.countFn" ||
|
|
4740
|
+
e.fn === "emitter.countDyn" ||
|
|
4741
|
+
e.fn === "emitter.emitError") {
|
|
5900
4742
|
if (!typeEquals(e.type, result)) {
|
|
5901
4743
|
err(`libCall ${e.fn} must be ${result.kind}, got ${e.type.kind}`, e.loc);
|
|
5902
4744
|
}
|
|
@@ -5933,7 +4775,9 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5933
4775
|
// reads), which matches exactly the undefined arm.
|
|
5934
4776
|
const jsonOk = (t) => isJsonSafeType(t, (id) => records.get(id), (id) => unions.get(id));
|
|
5935
4777
|
const undefArmedOk = e.type.kind === "union" &&
|
|
5936
|
-
(unions
|
|
4778
|
+
(unions
|
|
4779
|
+
.get(e.type.unionId)
|
|
4780
|
+
?.arms.every((a) => a.kind === "undefinedT" ||
|
|
5937
4781
|
jsonOk(a) ||
|
|
5938
4782
|
isDynTypedRefType(a) ||
|
|
5939
4783
|
DYN_HANDLE_KINDS.has(a.kind)) ??
|
|
@@ -5951,7 +4795,13 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5951
4795
|
// Runtime HANDLE targets unwrap the checked-dynamic tree's handle kind by tag (a
|
|
5952
4796
|
// retained reference, no copy — DYN_HANDLE_KINDS).
|
|
5953
4797
|
const handleOk = DYN_HANDLE_KINDS.has(e.type.kind);
|
|
5954
|
-
if (!canDynCheckTo(e.type, (id) => records.get(id), (id) => unions.get(id)) &&
|
|
4798
|
+
if (!canDynCheckTo(e.type, (id) => records.get(id), (id) => unions.get(id)) &&
|
|
4799
|
+
!undefArmedOk &&
|
|
4800
|
+
!bytesOk &&
|
|
4801
|
+
!errorOk &&
|
|
4802
|
+
!classOk &&
|
|
4803
|
+
!funcOk &&
|
|
4804
|
+
!handleOk) {
|
|
5955
4805
|
err(`dynCheck against non-JSON-representable type ${e.type.kind}`, e.loc);
|
|
5956
4806
|
}
|
|
5957
4807
|
break;
|
|
@@ -5992,7 +4842,9 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5992
4842
|
// The undefined next-channel has no C value form: such yields are
|
|
5993
4843
|
// void-typed (statement position only — the frontend fences reads).
|
|
5994
4844
|
if (e.captureCompletion) {
|
|
5995
|
-
if (fn.async ||
|
|
4845
|
+
if (fn.async ||
|
|
4846
|
+
e.type.kind !== "dyn" ||
|
|
4847
|
+
!typeEquals(e.captureCompletion.returnType, fn.returnType)) {
|
|
5996
4848
|
err("invalid captured generator completion", e.loc);
|
|
5997
4849
|
}
|
|
5998
4850
|
}
|
|
@@ -6161,7 +5013,8 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
6161
5013
|
if (resolve.kind !== "func" || resolve.ret.kind !== "void") {
|
|
6162
5014
|
err("promiseWithResolvers resolve must be a void-returning function", e.loc);
|
|
6163
5015
|
}
|
|
6164
|
-
else if (inner.kind === "void"
|
|
5016
|
+
else if (inner.kind === "void"
|
|
5017
|
+
? resolve.params.length !== 0
|
|
6165
5018
|
: resolve.params.length !== 1 || !typeEquals(resolve.params[0], inner)) {
|
|
6166
5019
|
err(`promiseWithResolvers resolve param must match the promise's inner type`, e.loc);
|
|
6167
5020
|
}
|
|
@@ -6215,26 +5068,64 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
6215
5068
|
if (e.type.kind !== jsOpResultKind(e.op)) {
|
|
6216
5069
|
err(`jsOp ${e.op} must be ${jsOpResultKind(e.op)}, got ${e.type.kind}`, e.loc);
|
|
6217
5070
|
}
|
|
6218
|
-
const named = e.op === "getProp" ||
|
|
5071
|
+
const named = e.op === "getProp" ||
|
|
5072
|
+
e.op === "setProp" ||
|
|
5073
|
+
e.op === "callMethod" ||
|
|
5074
|
+
e.op === "optCallMethod" ||
|
|
5075
|
+
e.op === "globalGet" ||
|
|
6219
5076
|
e.op === "callSpread"; // the spread expression's source spelling (V8's nullish text spells it)
|
|
6220
5077
|
if (named !== (e.name !== undefined)) {
|
|
6221
5078
|
err(`jsOp ${e.op} ${named ? "requires" : "forbids"} a name`, e.loc);
|
|
6222
5079
|
}
|
|
6223
5080
|
const arity = {
|
|
6224
|
-
add: 2,
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
5081
|
+
add: 2,
|
|
5082
|
+
sub: 2,
|
|
5083
|
+
mul: 2,
|
|
5084
|
+
div: 2,
|
|
5085
|
+
mod: 2,
|
|
5086
|
+
pow: 2,
|
|
5087
|
+
lt: 2,
|
|
5088
|
+
le: 2,
|
|
5089
|
+
gt: 2,
|
|
5090
|
+
ge: 2,
|
|
5091
|
+
eq: 2,
|
|
5092
|
+
neq: 2,
|
|
5093
|
+
instanceOf: 2,
|
|
5094
|
+
neg: 1,
|
|
5095
|
+
plus: 1,
|
|
5096
|
+
truthy: 1,
|
|
5097
|
+
not: 1,
|
|
5098
|
+
typeof: 1,
|
|
5099
|
+
toStr: 1,
|
|
5100
|
+
getProp: 1,
|
|
5101
|
+
setProp: 2,
|
|
5102
|
+
getIdx: 2,
|
|
5103
|
+
setIdx: 3,
|
|
5104
|
+
globalGet: 0,
|
|
5105
|
+
undefLit: 0,
|
|
5106
|
+
nullLit: 0,
|
|
5107
|
+
iterNew: 1,
|
|
5108
|
+
defineGetter: 3,
|
|
5109
|
+
objSpread: 2,
|
|
6229
5110
|
callSpread: 3, // callee + pre array + spread source
|
|
6230
|
-
callMethod: null,
|
|
6231
|
-
|
|
5111
|
+
callMethod: null,
|
|
5112
|
+
optCallMethod: null,
|
|
5113
|
+
callFn: null,
|
|
5114
|
+
callFnThis: null,
|
|
5115
|
+
construct: null, // receiver/callee + any number of args
|
|
5116
|
+
objLit: null,
|
|
5117
|
+
arrLit: null,
|
|
5118
|
+
tplStrings: null, // variable length (objLit: key/value pairs; tplStrings: n cooked + n raw)
|
|
6232
5119
|
};
|
|
6233
5120
|
const want = arity[e.op];
|
|
6234
5121
|
if (want !== null && want !== undefined && e.args.length !== want) {
|
|
6235
5122
|
err(`jsOp ${e.op} takes ${want} arg(s), got ${e.args.length}`, e.loc);
|
|
6236
5123
|
}
|
|
6237
|
-
if (want === null &&
|
|
5124
|
+
if (want === null &&
|
|
5125
|
+
e.op !== "objLit" &&
|
|
5126
|
+
e.op !== "arrLit" &&
|
|
5127
|
+
e.op !== "tplStrings" &&
|
|
5128
|
+
e.args.length < 1) {
|
|
6238
5129
|
err(`jsOp ${e.op} needs a receiver/callee arg`, e.loc);
|
|
6239
5130
|
}
|
|
6240
5131
|
if (e.op === "callFnThis" && e.args.length < 2) {
|
|
@@ -6571,7 +5462,9 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
6571
5462
|
checkExpr(s.value);
|
|
6572
5463
|
// dyn throws are allowed: the dyn node rides the REF cell arm by
|
|
6573
5464
|
// reference (the JS-lane `throw err` of a dyn argument).
|
|
6574
|
-
if (s.value.type.kind === "void" ||
|
|
5465
|
+
if (s.value.type.kind === "void" ||
|
|
5466
|
+
s.value.type.kind === "caught" ||
|
|
5467
|
+
s.value.type.kind === "date") {
|
|
6575
5468
|
err(`throw of a ${s.value.type.kind} value`, s.loc);
|
|
6576
5469
|
}
|
|
6577
5470
|
break;
|