@scriptc/compiler 0.2.3 → 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.d.ts +15 -0
- package/dist/backend/llvm/borrowed-inputs.js +28 -0
- package/dist/backend/llvm/borrowed-inputs.js.map +1 -0
- 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.d.ts +10 -0
- package/dist/backend/llvm/byte-numbers.js +240 -0
- package/dist/backend/llvm/byte-numbers.js.map +1 -0
- package/dist/backend/llvm/bytes-bounds.d.ts +9 -0
- package/dist/backend/llvm/bytes-bounds.js +240 -0
- package/dist/backend/llvm/bytes-bounds.js.map +1 -0
- package/dist/backend/llvm/call-lifetimes.d.ts +10 -0
- package/dist/backend/llvm/call-lifetimes.js +83 -20
- package/dist/backend/llvm/call-lifetimes.js.map +1 -1
- package/dist/backend/llvm/call-lifetimes.test.js +203 -18
- package/dist/backend/llvm/call-lifetimes.test.js.map +1 -1
- package/dist/backend/llvm/checked-value-lifetimes.d.ts +13 -0
- package/dist/backend/llvm/checked-value-lifetimes.js +45 -0
- package/dist/backend/llvm/checked-value-lifetimes.js.map +1 -0
- 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.d.ts +6 -0
- package/dist/backend/llvm/counted-loops.js +35 -0
- package/dist/backend/llvm/counted-loops.js.map +1 -0
- 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 +34 -12
- package/dist/backend/llvm/emitter.js +357 -124
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/backend/llvm/emitter.test.js +237 -46
- package/dist/backend/llvm/emitter.test.js.map +1 -1
- package/dist/backend/llvm/expr-async.js +28 -8
- package/dist/backend/llvm/expr-async.js.map +1 -1
- package/dist/backend/llvm/expr-bytes.d.ts +4 -4
- package/dist/backend/llvm/expr-bytes.js +78 -36
- 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 +40 -21
- package/dist/backend/llvm/expr-calls.js.map +1 -1
- package/dist/backend/llvm/expr-containers.d.ts +4 -1
- package/dist/backend/llvm/expr-containers.js +157 -76
- package/dist/backend/llvm/expr-containers.js.map +1 -1
- package/dist/backend/llvm/expr-context.d.ts +11 -0
- package/dist/backend/llvm/expr-control.js +27 -8
- 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 +50 -33
- 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 +139 -37
- 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 +16 -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.d.ts +10 -0
- package/dist/backend/llvm/integer-values.js +52 -0
- package/dist/backend/llvm/integer-values.js.map +1 -0
- package/dist/backend/llvm/integer-views.d.ts +7 -0
- package/dist/backend/llvm/integer-views.js +83 -0
- package/dist/backend/llvm/integer-views.js.map +1 -0
- package/dist/backend/llvm/integer-views.test.d.ts +1 -0
- package/dist/backend/llvm/integer-views.test.js +69 -0
- package/dist/backend/llvm/integer-views.test.js.map +1 -0
- 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 +36 -15
- package/dist/backend/llvm/lib-dispatch.js.map +1 -1
- package/dist/backend/llvm/lib-filesystem.js +38 -23
- 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 +3 -4
- package/dist/backend/llvm/local-array-reads.js +100 -121
- package/dist/backend/llvm/local-array-reads.js.map +1 -1
- package/dist/backend/llvm/local-array-reads.test.js +379 -71
- 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 +46 -16
- package/dist/backend/llvm/map-read-lifetimes.js.map +1 -1
- package/dist/backend/llvm/map-read-lifetimes.test.js +93 -17
- package/dist/backend/llvm/map-read-lifetimes.test.js.map +1 -1
- package/dist/backend/llvm/reference-effects.d.ts +23 -0
- package/dist/backend/llvm/reference-effects.js +179 -0
- package/dist/backend/llvm/reference-effects.js.map +1 -0
- package/dist/backend/llvm/reference-effects.test.d.ts +1 -0
- package/dist/backend/llvm/reference-effects.test.js +157 -0
- package/dist/backend/llvm/reference-effects.test.js.map +1 -0
- package/dist/backend/llvm/shapes.d.ts +7 -4
- package/dist/backend/llvm/shapes.js +82 -22
- 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 +172 -32
- package/dist/backend/llvm/stack-unions.test.js.map +1 -1
- package/dist/backend/llvm/string-construction.d.ts +10 -0
- package/dist/backend/llvm/string-construction.js +38 -0
- package/dist/backend/llvm/string-construction.js.map +1 -0
- package/dist/backend/llvm/string-construction.test.d.ts +1 -0
- package/dist/backend/llvm/string-construction.test.js +90 -0
- package/dist/backend/llvm/string-construction.test.js.map +1 -0
- package/dist/backend/llvm/string-lifetimes.d.ts +2 -2
- package/dist/backend/llvm/string-lifetimes.js +19 -11
- package/dist/backend/llvm/string-lifetimes.js.map +1 -1
- package/dist/backend/llvm/string-lifetimes.test.js +127 -32
- 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 +359 -67
- 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 +585 -157
- 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 +1704 -727
- 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 +3455 -1153
- 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 +1031 -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 +547 -206
- 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 +97 -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.d.ts +20 -0
- package/dist/ir/byte-numbers.js +116 -0
- package/dist/ir/byte-numbers.js.map +1 -0
- package/dist/ir/byte-numbers.test.d.ts +1 -0
- package/dist/ir/byte-numbers.test.js +55 -0
- package/dist/ir/byte-numbers.test.js.map +1 -0
- 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.d.ts +19 -0
- package/dist/ir/integer-loops.js +172 -11
- package/dist/ir/integer-loops.js.map +1 -1
- package/dist/ir/integer-loops.test.js +122 -9
- package/dist/ir/integer-loops.test.js.map +1 -1
- package/dist/ir/integer-ranges.d.ts +8 -6
- package/dist/ir/integer-ranges.js +416 -90
- package/dist/ir/integer-ranges.js.map +1 -1
- package/dist/ir/integer-ranges.test.js +239 -10
- 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 +14 -2155
- package/dist/ir/ir.js +169 -1394
- 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 +826 -1915
- package/dist/ir/validate.js.map +1 -1
- package/dist/ir/validate.test.js +627 -111
- 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 +74 -29
- package/dist/native/toolchain.js.map +1 -1
- package/dist/native/toolchain.test.js +95 -18
- 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 -8984
- 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 -7366
- package/dist/frontend/lowering/lower-containers.js.map +0 -1
package/dist/ir/validate.js
CHANGED
|
@@ -1,1585 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/* IR validation — runs on every compile as the backstop for frontend bugs.
|
|
2
|
+
* A violation is an internal compiler error (the frontend should never
|
|
3
|
+
* produce invalid IR), but it still carries the user's source location:
|
|
4
|
+
* an ICE that points at source is a gift to whoever debugs it.
|
|
5
|
+
*/
|
|
6
|
+
import { validByteNumberToken } from "./byte-numbers.js";
|
|
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";
|
|
3
9
|
import { unionWideningTags } from "./analysis.js";
|
|
4
10
|
import { alwaysReturns } from "./control-flow.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* from the end (backends fill the documented defaults). Exported for the
|
|
8
|
-
* frontend's lib-boundary pass (lib-boundary.ts), which coerces or fences
|
|
9
|
-
* checked-dynamic arguments against the same table the validator enforces. */
|
|
10
|
-
export const STR_INTRINSIC_SIGS = {
|
|
11
|
-
length: { argTypes: [], minArgs: 0, result: F64 },
|
|
12
|
-
charCodeAt: { argTypes: [F64], minArgs: 1, result: F64 },
|
|
13
|
-
charAt: { argTypes: [F64], minArgs: 1, result: STRING },
|
|
14
|
-
indexOf: { argTypes: [STRING, F64], minArgs: 1, result: F64 },
|
|
15
|
-
includes: { argTypes: [STRING, F64], minArgs: 1, result: BOOL },
|
|
16
|
-
startsWith: { argTypes: [STRING, F64], minArgs: 1, result: BOOL },
|
|
17
|
-
endsWith: { argTypes: [STRING, F64], minArgs: 1, result: BOOL },
|
|
18
|
-
slice: { argTypes: [F64, F64], minArgs: 0, result: STRING },
|
|
19
|
-
substring: { argTypes: [F64, F64], minArgs: 1, result: STRING },
|
|
20
|
-
repeat: { argTypes: [F64], minArgs: 1, result: STRING },
|
|
21
|
-
trim: { argTypes: [], minArgs: 0, result: STRING },
|
|
22
|
-
trimStart: { argTypes: [], minArgs: 0, result: STRING },
|
|
23
|
-
trimEnd: { argTypes: [], minArgs: 0, result: STRING },
|
|
24
|
-
split: { argTypes: [STRING, F64], minArgs: 2, result: arrayOf(STRING) },
|
|
25
|
-
padStart: { argTypes: [F64, STRING], minArgs: 2, result: STRING },
|
|
26
|
-
padEnd: { argTypes: [F64, STRING], minArgs: 2, result: STRING },
|
|
27
|
-
toLowerCase: { argTypes: [], minArgs: 0, result: STRING },
|
|
28
|
-
toUpperCase: { argTypes: [], minArgs: 0, result: STRING },
|
|
29
|
-
normalize: { argTypes: [STRING], minArgs: 1, result: STRING },
|
|
30
|
-
isWellFormed: { argTypes: [], minArgs: 0, result: BOOL },
|
|
31
|
-
toWellFormed: { argTypes: [], minArgs: 0, result: STRING },
|
|
32
|
-
cpAt: { argTypes: [F64], minArgs: 1, result: STRING },
|
|
33
|
-
};
|
|
34
|
-
/** Per-method signature for regexIntrinsic. test/source/flags take the
|
|
35
|
-
* regex as receiver; replace/replaceAll/split take the STRING as receiver
|
|
36
|
-
* with the regex as args[0] (mirroring the source syntax). All positions
|
|
37
|
-
* are required — the surface has no optionals. */
|
|
38
|
-
export const REGEX_INTRINSIC_SIGS = {
|
|
39
|
-
test: { receiver: REGEX, argTypes: [STRING], result: BOOL },
|
|
40
|
-
// match's result is the program-dependent `string[] | null` union —
|
|
41
|
-
// VOID here is the process.envGet sentinel; the regexIntrinsic case
|
|
42
|
-
// checks the union's arms.
|
|
43
|
-
match: { receiver: STRING, argTypes: [REGEX], result: VOID },
|
|
44
|
-
exec: { receiver: STRING, argTypes: [REGEX], result: VOID },
|
|
45
|
-
lastIndex: { receiver: REGEX, argTypes: [], result: F64 },
|
|
46
|
-
matchAll: { receiver: STRING, argTypes: [REGEX], result: arrayOf(arrayOf(STRING)) },
|
|
47
|
-
matchAllInto: { receiver: STRING, argTypes: [REGEX, arrayOf(F64)], result: arrayOf(arrayOf(STRING)) },
|
|
48
|
-
search: { receiver: STRING, argTypes: [REGEX], result: F64 },
|
|
49
|
-
source: { receiver: REGEX, argTypes: [], result: STRING },
|
|
50
|
-
flags: { receiver: REGEX, argTypes: [], result: STRING },
|
|
51
|
-
toString: { receiver: REGEX, argTypes: [], result: STRING },
|
|
52
|
-
replace: { receiver: STRING, argTypes: [REGEX, STRING], result: STRING },
|
|
53
|
-
replaceAll: { receiver: STRING, argTypes: [REGEX, STRING], result: STRING },
|
|
54
|
-
split: { receiver: STRING, argTypes: [REGEX, F64], result: arrayOf(STRING) },
|
|
55
|
-
};
|
|
56
|
-
/** Closed-union signature table for `libCall` (mirrors ambient/scriptc.d.ts).
|
|
57
|
-
* All argument positions are required — the surface has no optionals.
|
|
58
|
-
* readFileSync's second argument is the (always-"utf8") encoding: it is
|
|
59
|
-
* evaluated for JS-exact side-effect order and ignored by the runtime.
|
|
60
|
-
* A `null` argument slot is program-dependent (a builtin-error receiver) —
|
|
61
|
-
* the libCall case checks it specially, like process.envGet's result.
|
|
62
|
-
* Exported for the frontend's lib-boundary pass (lib-boundary.ts). */
|
|
63
|
-
export const LIB_FN_SIGS = {
|
|
64
|
-
"fetch.start": { argTypes: [STRING, DYN], result: { kind: "promise", inner: DYN } },
|
|
65
|
-
"fetch.responseNew": { argTypes: [DYN, DYN], result: DYN },
|
|
66
|
-
"fetch.input": { argTypes: [DYN, DYN], result: { kind: "promise", inner: DYN } },
|
|
67
|
-
"abort.controllerNew": { argTypes: [], result: DYN },
|
|
68
|
-
"abort.timeout": { argTypes: [DYN], result: DYN },
|
|
69
|
-
"abort.now": { argTypes: [DYN], result: DYN },
|
|
70
|
-
"abort.any": { argTypes: [DYN], result: DYN },
|
|
71
|
-
"fetch.function": { argTypes: [], result: DYN },
|
|
72
|
-
"fetch.requestNew": { argTypes: [DYN, DYN], result: DYN },
|
|
73
|
-
"fetch.headersNew": { argTypes: [DYN], result: DYN },
|
|
74
|
-
"fetch.responseArrayBuffer": { argTypes: [DYN], result: { kind: "promise", inner: DYN } },
|
|
75
|
-
"fetch.responseJson": { argTypes: [DYN], result: { kind: "promise", inner: DYN } },
|
|
76
|
-
"fetch.responseText": { argTypes: [DYN], result: { kind: "promise", inner: STRING } },
|
|
77
|
-
"fetch.responseBytes": { argTypes: [DYN], result: { kind: "promise", inner: BYTES_U8 } },
|
|
78
|
-
"fetch.abortControllerNew": { argTypes: [], result: DYN },
|
|
79
|
-
"fetch.abortTimeout": { argTypes: [DYN], result: DYN },
|
|
80
|
-
"fetch.abortNow": { argTypes: [DYN], result: DYN },
|
|
81
|
-
"fetch.abortAny": { argTypes: [DYN], result: DYN },
|
|
82
|
-
"fetch.streamNew": { argTypes: [DYN], result: DYN },
|
|
83
|
-
// Program-dependent iterable: typed arrays/bytes/string stay intact so
|
|
84
|
-
// the native stream can pull lazily; checked-dynamic values are the
|
|
85
|
-
// fallback. The libCall validator below checks the closed set.
|
|
86
|
-
"fetch.webIs": { argTypes: [DYN, STRING], result: BOOL },
|
|
87
|
-
"fetch.streamIs": { argTypes: [DYN], result: BOOL },
|
|
88
|
-
"fetch.streamFrom": { argTypes: [null], result: DYN },
|
|
89
|
-
// The chunk/result record depends on ReadableStream<T>; validated below.
|
|
90
|
-
"fetch.readerRead": { argTypes: [DYN], result: VOID },
|
|
91
|
-
"island.eval": { argTypes: [STRING], result: STRING },
|
|
92
|
-
"island.import": { argTypes: [STRING, STRING, STRING], result: JSVAL },
|
|
93
|
-
"island.importDyn": { argTypes: [STRING], result: JSVAL },
|
|
94
|
-
// Result is the cast's mapped PROMISE target (program-dependent) —
|
|
95
|
-
// checked in the libCall case, like error.new.
|
|
96
|
-
"island.castFail": { argTypes: [JSVAL, STRING], result: VOID },
|
|
97
|
-
"json.parse": { argTypes: [STRING], result: DYN },
|
|
98
|
-
"json.parseReviver": { argTypes: [STRING, DYN], result: DYN },
|
|
99
|
-
"json.stringifyReplacer": { argTypes: [DYN, DYN, STRING], result: DYN },
|
|
100
|
-
"json.stringifyValue": { argTypes: [DYN, DYN, DYN], result: DYN },
|
|
101
|
-
"dyn.keySet": { argTypes: [DYN, STRING, DYN], result: VOID },
|
|
102
|
-
"dyn.keySetComputed": { argTypes: [DYN, DYN, DYN], result: VOID },
|
|
103
|
-
"dyn.keyDelete": { argTypes: [DYN, STRING, BOOL], result: VOID },
|
|
104
|
-
"dyn.keyDeleteComputed": { argTypes: [DYN, DYN, BOOL], result: VOID },
|
|
105
|
-
"dyn.hasKeyComputed": { argTypes: [DYN, DYN], result: BOOL },
|
|
106
|
-
"dyn.hasOwnComputed": { argTypes: [DYN, DYN], result: BOOL },
|
|
107
|
-
"dyn.propertyIsEnumerableComputed": { argTypes: [DYN, DYN], result: BOOL },
|
|
108
|
-
"dyn.globalSymbolGet": { argTypes: [SYMBOL_T], result: DYN },
|
|
109
|
-
"dyn.globalSymbolSet": { argTypes: [SYMBOL_T, DYN], result: VOID },
|
|
110
|
-
"dyn.globalSymbolHas": { argTypes: [SYMBOL_T], result: BOOL },
|
|
111
|
-
"dyn.globalSymbolDelete": { argTypes: [SYMBOL_T], result: VOID },
|
|
112
|
-
"dyn.typedRefIs": { argTypes: [DYN, STRING], result: BOOL },
|
|
113
|
-
"dyn.classIs": { argTypes: [DYN, STRING], result: BOOL },
|
|
114
|
-
"dyn.iterPack": { argTypes: [DYN, STRING], result: DYN },
|
|
115
|
-
"dyn.arrayFromIterator": { argTypes: [DYN], result: DYN },
|
|
116
|
-
"dyn.iterator": { argTypes: [DYN, STRING], result: DYN },
|
|
117
|
-
"dyn.iteratorResult": { argTypes: [DYN], result: DYN },
|
|
118
|
-
"dyn.mapSeedEntries": { argTypes: [DYN], result: DYN },
|
|
119
|
-
"dyn.mapSeedEntry": { argTypes: [DYN], result: DYN },
|
|
120
|
-
"dyn.arrLen": { argTypes: [DYN], result: F64 },
|
|
121
|
-
"dyn.arrAt": { argTypes: [DYN, F64], result: DYN },
|
|
122
|
-
"dyn.hasKey": { argTypes: [DYN, STRING], result: BOOL },
|
|
123
|
-
"dyn.freeze": { argTypes: [DYN], result: DYN },
|
|
124
|
-
"dyn.isFrozen": { argTypes: [DYN], result: BOOL },
|
|
125
|
-
"dyn.nativeSetNew": { argTypes: [DYN], result: DYN },
|
|
126
|
-
"dyn.nativeSetIs": { argTypes: [DYN], result: BOOL },
|
|
127
|
-
"dyn.nativeMapIs": { argTypes: [DYN], result: BOOL },
|
|
128
|
-
"dyn.nativeUrlIs": { argTypes: [DYN], result: BOOL },
|
|
129
|
-
"dyn.nativeDateIs": { argTypes: [DYN], result: BOOL },
|
|
130
|
-
"date.nativeNew": { argTypes: [DYN], result: DYN },
|
|
131
|
-
"date.checkedValue": { argTypes: [DYN], result: DATE_T },
|
|
132
|
-
"dyn.nativeRegexIs": { argTypes: [DYN], result: BOOL },
|
|
133
|
-
"dyn.toString": { argTypes: [DYN, DYN, STRING], result: STRING },
|
|
134
|
-
"dyn.defineProps": { argTypes: [DYN, DYN], result: DYN },
|
|
135
|
-
"dyn.defineProperty": { argTypes: [DYN, DYN, DYN], result: DYN },
|
|
136
|
-
"dyn.getOwnPropertyDescriptor": { argTypes: [DYN, DYN], result: DYN },
|
|
137
|
-
"dyn.arrayProtoCall": { argTypes: [DYN, STRING, DYN], result: DYN },
|
|
138
|
-
"dyn.promiseAll": { argTypes: [DYN], result: { kind: "promise", inner: DYN } },
|
|
139
|
-
"dyn.typeof": { argTypes: [DYN], result: STRING },
|
|
140
|
-
"dyn.objectTag": { argTypes: [DYN], result: STRING },
|
|
141
|
-
"module.registryInit": { argTypes: [F64], result: VOID },
|
|
142
|
-
"module.define": { argTypes: [F64, STRING, STRING, STRING, arrayOf(STRING), BOOL], result: VOID },
|
|
143
|
-
"module.enter": { argTypes: [F64], result: VOID },
|
|
144
|
-
"module.link": { argTypes: [F64, F64], result: VOID },
|
|
145
|
-
"module.finish": { argTypes: [F64], result: VOID },
|
|
146
|
-
"module.fail": { argTypes: [F64], result: VOID },
|
|
147
|
-
"module.filename": { argTypes: [F64], result: STRING },
|
|
148
|
-
"module.id": { argTypes: [F64], result: STRING },
|
|
149
|
-
"module.path": { argTypes: [F64], result: STRING },
|
|
150
|
-
"module.paths": { argTypes: [F64], result: arrayOf(STRING) },
|
|
151
|
-
"module.children": { argTypes: [F64], result: arrayOf(F64) },
|
|
152
|
-
"module.parent": { argTypes: [F64], result: F64 },
|
|
153
|
-
"module.loaded": { argTypes: [F64], result: BOOL },
|
|
154
|
-
"module.cacheGet": { argTypes: [STRING], result: F64 },
|
|
155
|
-
"module.cacheHas": { argTypes: [STRING], result: BOOL },
|
|
156
|
-
"module.cacheKeys": { argTypes: [], result: arrayOf(STRING) },
|
|
157
|
-
"timers.setTimeout": { argTypes: [{ kind: "func", params: [], ret: VOID }, F64], result: VOID },
|
|
158
|
-
"timers.setInterval": { argTypes: [{ kind: "func", params: [], ret: VOID }, F64], result: F64 },
|
|
159
|
-
"timers.clearInterval": { argTypes: [F64], result: VOID },
|
|
160
|
-
"timers.setTimeoutHandle": { argTypes: [{ kind: "func", params: [], ret: VOID }, F64], result: F64 },
|
|
161
|
-
"timers.clearTimeout": { argTypes: [F64], result: VOID },
|
|
162
|
-
"timers.unref": { argTypes: [F64], result: F64 },
|
|
163
|
-
"timers.ref": { argTypes: [F64], result: F64 },
|
|
164
|
-
"timers.hasRef": { argTypes: [F64], result: BOOL },
|
|
165
|
-
"timers.refresh": { argTypes: [F64], result: F64 },
|
|
166
|
-
"timers.setImmediate": { argTypes: [{ kind: "func", params: [], ret: VOID }], result: F64 },
|
|
167
|
-
"timers.queueMicrotask": { argTypes: [{ kind: "func", params: [], ret: VOID }], result: VOID },
|
|
168
|
-
"timers.queueMicrotaskDyn": { argTypes: [DYN], result: VOID },
|
|
169
|
-
"timers.clearImmediate": { argTypes: [F64], result: VOID },
|
|
170
|
-
"process.nextTick": { argTypes: [{ kind: "func", params: [], ret: VOID }], result: VOID },
|
|
171
|
-
"process.uptime": { argTypes: [], result: F64 },
|
|
172
|
-
"perf.now": { argTypes: [], result: F64 },
|
|
173
|
-
"process.availableMemory": { argTypes: [], result: F64 },
|
|
174
|
-
"process.constrainedMemory": { argTypes: [], result: F64 },
|
|
175
|
-
"process.cpuUser": { argTypes: [], result: F64 },
|
|
176
|
-
"process.cpuSystem": { argTypes: [], result: F64 },
|
|
177
|
-
"process.cpuUserDiff": { argTypes: [F64], result: F64 },
|
|
178
|
-
"process.cpuSystemDiff": { argTypes: [F64], result: F64 },
|
|
179
|
-
"process.threadCpuUser": { argTypes: [], result: F64 },
|
|
180
|
-
"process.threadCpuSystem": { argTypes: [], result: F64 },
|
|
181
|
-
"process.threadCpuUserDiff": { argTypes: [F64], result: F64 },
|
|
182
|
-
"process.threadCpuSystemDiff": { argTypes: [F64], result: F64 },
|
|
183
|
-
"process.cpuPrevValidate": { argTypes: [F64, F64], result: VOID },
|
|
184
|
-
"process.rusage": { argTypes: [F64], result: F64 },
|
|
185
|
-
"process.activeResources": { argTypes: [], result: arrayOf(STRING) },
|
|
186
|
-
"timers.immediateUnref": { argTypes: [F64], result: F64 },
|
|
187
|
-
"timers.immediateRef": { argTypes: [F64], result: F64 },
|
|
188
|
-
"timers.immediateHasRef": { argTypes: [F64], result: BOOL },
|
|
189
|
-
"timers.clearNoop": { argTypes: [], result: VOID },
|
|
190
|
-
// Signal listeners are zero-param (the ambient shape); exit/stdin
|
|
191
|
-
// callbacks carry program-dependent one-param shapes — null slots, the
|
|
192
|
-
// libCall case checks them (child.onExit precedent).
|
|
193
|
-
"process.onSignal": { argTypes: [STRING, DYN, BOOL], result: VOID },
|
|
194
|
-
"process.offSignal": { argTypes: [STRING, DYN], result: VOID },
|
|
195
|
-
"process.onExit": { argTypes: [null, BOOL], result: VOID },
|
|
196
|
-
"process.offExit": { argTypes: [null], result: VOID },
|
|
197
|
-
"stdin.onData": { argTypes: [null, BOOL], result: VOID },
|
|
198
|
-
"stdin.onEnd": { argTypes: [{ kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
199
|
-
"stdin.onError": { argTypes: [null, BOOL], result: VOID },
|
|
200
|
-
"stdin.nextChunk": { argTypes: [], result: { kind: "promise", inner: BYTES_U8 } },
|
|
201
|
-
"fs.readFileSync": { argTypes: [STRING, STRING], result: STRING },
|
|
202
|
-
"fs.readFileSyncBuf": { argTypes: [STRING], result: BYTES_U8 },
|
|
203
|
-
"fs.readFileSyncDyn": { argTypes: [STRING, DYN], result: DYN },
|
|
204
|
-
"fs.writeFileSync": { argTypes: [STRING, STRING], result: VOID },
|
|
205
|
-
"fs.appendFileSync": { argTypes: [STRING, STRING], result: VOID },
|
|
206
|
-
"fs.existsSync": { argTypes: [STRING], result: BOOL },
|
|
207
|
-
"fs.mkdirSync": { argTypes: [STRING], result: VOID },
|
|
208
|
-
"fs.rmSync": { argTypes: [STRING], result: VOID },
|
|
209
|
-
"fs.rmdirSync": { argTypes: [STRING], result: VOID },
|
|
210
|
-
"fs.readdirSync": { argTypes: [STRING], result: arrayOf(STRING) },
|
|
211
|
-
// Result is the call site's Dirent record array (VOID is the
|
|
212
|
-
// structure-checked sentinel, the os.networkInterfaces pattern).
|
|
213
|
-
"fs.readdirTypesSync": { argTypes: [STRING], result: VOID },
|
|
214
|
-
"path.join": { argTypes: [arrayOf(STRING)], result: STRING },
|
|
215
|
-
"path.resolve": { argTypes: [arrayOf(STRING)], result: STRING },
|
|
216
|
-
"path.normalize": { argTypes: [STRING], result: STRING },
|
|
217
|
-
"path.dirname": { argTypes: [STRING], result: STRING },
|
|
218
|
-
"path.basename": { argTypes: [STRING, STRING], result: STRING },
|
|
219
|
-
"path.extname": { argTypes: [STRING], result: STRING },
|
|
220
|
-
"path.isAbsolute": { argTypes: [STRING], result: BOOL },
|
|
221
|
-
"path.relative": { argTypes: [STRING, STRING], result: STRING },
|
|
222
|
-
"path.toNamespacedPath": { argTypes: [STRING], result: STRING },
|
|
223
|
-
"path.win32Join": { argTypes: [arrayOf(STRING)], result: STRING },
|
|
224
|
-
"path.win32Resolve": { argTypes: [arrayOf(STRING)], result: STRING },
|
|
225
|
-
"path.win32Normalize": { argTypes: [STRING], result: STRING },
|
|
226
|
-
"path.win32Dirname": { argTypes: [STRING], result: STRING },
|
|
227
|
-
"path.win32Basename": { argTypes: [STRING, STRING], result: STRING },
|
|
228
|
-
"path.win32Extname": { argTypes: [STRING], result: STRING },
|
|
229
|
-
"path.win32IsAbsolute": { argTypes: [STRING], result: BOOL },
|
|
230
|
-
"path.win32Relative": { argTypes: [STRING, STRING], result: STRING },
|
|
231
|
-
"path.win32ToNamespacedPath": { argTypes: [STRING], result: STRING },
|
|
232
|
-
"os.homedir": { argTypes: [], result: STRING },
|
|
233
|
-
"os.release": { argTypes: [], result: STRING },
|
|
234
|
-
"os.type": { argTypes: [], result: STRING },
|
|
235
|
-
"os.totalmem": { argTypes: [], result: F64 },
|
|
236
|
-
"process.umask": { argTypes: [F64], result: F64 },
|
|
237
|
-
"process.chdir": { argTypes: [STRING], result: VOID },
|
|
238
|
-
"process.loadEnvFile": { argTypes: [DYN], result: VOID },
|
|
239
|
-
"process.exiting": { argTypes: [], result: BOOL },
|
|
240
|
-
"net.getAutoSelTimeout": { argTypes: [], result: F64 },
|
|
241
|
-
"net.setAutoSelTimeout": { argTypes: [F64], result: VOID },
|
|
242
|
-
"fs.realpathSync": { argTypes: [STRING], result: STRING },
|
|
243
|
-
"fs.realpathNativeSync": { argTypes: [STRING], result: STRING },
|
|
244
|
-
"os.userName": { argTypes: [], result: STRING },
|
|
245
|
-
"os.userShell": { argTypes: [], result: STRING },
|
|
246
|
-
"os.userHomedir": { argTypes: [], result: STRING },
|
|
247
|
-
"os.tmpdir": { argTypes: [], result: STRING },
|
|
248
|
-
// Result is the call site's Dict<NetworkInterfaceInfo[]> record (VOID is
|
|
249
|
-
// the dgram.address sentinel — the libCall case checks the structure).
|
|
250
|
-
"os.networkInterfaces": { argTypes: [], result: VOID },
|
|
251
|
-
"math.maxArr": { argTypes: [arrayOf(F64)], result: F64 },
|
|
252
|
-
"math.minArr": { argTypes: [arrayOf(F64)], result: F64 },
|
|
253
|
-
"math.hypotArr": { argTypes: [arrayOf(F64)], result: F64 },
|
|
254
|
-
"math.floor": { argTypes: [F64], result: F64 },
|
|
255
|
-
"math.abs": { argTypes: [F64], result: F64 },
|
|
256
|
-
"math.round": { argTypes: [F64], result: F64 },
|
|
257
|
-
"math.trunc": { argTypes: [F64], result: F64 },
|
|
258
|
-
"math.ceil": { argTypes: [F64], result: F64 },
|
|
259
|
-
"math.sin": { argTypes: [F64], result: F64 },
|
|
260
|
-
"math.sinh": { argTypes: [F64], result: F64 },
|
|
261
|
-
"math.cos": { argTypes: [F64], result: F64 },
|
|
262
|
-
"math.cosh": { argTypes: [F64], result: F64 },
|
|
263
|
-
"math.tan": { argTypes: [F64], result: F64 },
|
|
264
|
-
"math.tanh": { argTypes: [F64], result: F64 },
|
|
265
|
-
"math.asin": { argTypes: [F64], result: F64 },
|
|
266
|
-
"math.asinh": { argTypes: [F64], result: F64 },
|
|
267
|
-
"math.acos": { argTypes: [F64], result: F64 },
|
|
268
|
-
"math.acosh": { argTypes: [F64], result: F64 },
|
|
269
|
-
"math.atan": { argTypes: [F64], result: F64 },
|
|
270
|
-
"math.atanh": { argTypes: [F64], result: F64 },
|
|
271
|
-
"math.cbrt": { argTypes: [F64], result: F64 },
|
|
272
|
-
"math.clz32": { argTypes: [F64], result: F64 },
|
|
273
|
-
"math.sign": { argTypes: [F64], result: F64 },
|
|
274
|
-
"math.exp": { argTypes: [F64], result: F64 },
|
|
275
|
-
"math.expm1": { argTypes: [F64], result: F64 },
|
|
276
|
-
"math.fround": { argTypes: [F64], result: F64 },
|
|
277
|
-
"math.sqrt": { argTypes: [F64], result: F64 },
|
|
278
|
-
"math.log": { argTypes: [F64], result: F64 },
|
|
279
|
-
"math.log1p": { argTypes: [F64], result: F64 },
|
|
280
|
-
"math.log2": { argTypes: [F64], result: F64 },
|
|
281
|
-
"math.log10": { argTypes: [F64], result: F64 },
|
|
282
|
-
"math.atan2": { argTypes: [F64, F64], result: F64 },
|
|
283
|
-
"math.pow": { argTypes: [F64, F64], result: F64 },
|
|
284
|
-
"math.imul": { argTypes: [F64, F64], result: F64 },
|
|
285
|
-
"math.min": { argTypes: [F64, F64], result: F64 },
|
|
286
|
-
"math.max": { argTypes: [F64, F64], result: F64 },
|
|
287
|
-
"math.random": { argTypes: [], result: F64 },
|
|
288
|
-
"num.parseInt": { argTypes: [STRING, F64], result: F64 },
|
|
289
|
-
"num.parseFloat": { argTypes: [STRING], result: F64 },
|
|
290
|
-
"num.fromString": { argTypes: [STRING], result: F64 },
|
|
291
|
-
"num.isNaN": { argTypes: [F64], result: BOOL },
|
|
292
|
-
"str.encodeUriComponent": { argTypes: [STRING], result: STRING },
|
|
293
|
-
// The base64 globals: the argument is a dyn value (WebIDL ToString
|
|
294
|
-
// runs in the runtime); the zero-argument form always throws.
|
|
295
|
-
"str.atob": { argTypes: [DYN], result: STRING },
|
|
296
|
-
"str.btoa": { argTypes: [DYN], result: STRING },
|
|
297
|
-
"str.b64Missing": { argTypes: [], result: STRING },
|
|
298
|
-
"str.decodeUriComponent": { argTypes: [STRING], result: STRING },
|
|
299
|
-
"str.decodeUri": { argTypes: [STRING], result: STRING },
|
|
300
|
-
"str.encodeUri": { argTypes: [STRING], result: STRING },
|
|
301
|
-
"regexp.escape": { argTypes: [STRING], result: STRING },
|
|
302
|
-
"num.toExponential": { argTypes: [F64], result: STRING },
|
|
303
|
-
"num.toFixed0": { argTypes: [F64], result: STRING },
|
|
304
|
-
"num.toFixed": { argTypes: [F64, F64], result: STRING },
|
|
305
|
-
"num.toStringRadix": { argTypes: [F64, DYN], result: STRING },
|
|
306
|
-
"num.sameValue": { argTypes: [F64, F64], result: BOOL },
|
|
307
|
-
"intl.numFormatEnUs": { argTypes: [F64], result: STRING },
|
|
308
|
-
"sym.new": { argTypes: [STRING], result: SYMBOL_T },
|
|
309
|
-
"sym.newAnon": { argTypes: [], result: SYMBOL_T },
|
|
310
|
-
"sym.for": { argTypes: [STRING], result: SYMBOL_T },
|
|
311
|
-
"sym.wellKnown": { argTypes: [STRING], result: SYMBOL_T },
|
|
312
|
-
// Result is the interned `string | undefined` union — the libCall case
|
|
313
|
-
// checks the arms (the spawnRes.error pattern).
|
|
314
|
-
"sym.keyFor": { argTypes: [SYMBOL_T], result: VOID },
|
|
315
|
-
"sym.desc": { argTypes: [SYMBOL_T], result: VOID },
|
|
316
|
-
"sym.toString": { argTypes: [SYMBOL_T], result: STRING },
|
|
317
|
-
"bigint.parse": { argTypes: [STRING], result: BIGINT_T },
|
|
318
|
-
"bigint.fromF64": { argTypes: [F64], result: BIGINT_T },
|
|
319
|
-
"bigint.neg": { argTypes: [BIGINT_T], result: BIGINT_T },
|
|
320
|
-
"bigint.not": { argTypes: [BIGINT_T], result: BIGINT_T },
|
|
321
|
-
"bigint.add": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
322
|
-
"bigint.sub": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
323
|
-
"bigint.mul": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
324
|
-
"bigint.div": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
325
|
-
"bigint.mod": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
326
|
-
"bigint.pow": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
327
|
-
"bigint.and": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
328
|
-
"bigint.or": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
329
|
-
"bigint.xor": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
330
|
-
"bigint.shl": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
331
|
-
"bigint.shr": { argTypes: [BIGINT_T, BIGINT_T], result: BIGINT_T },
|
|
332
|
-
"bigint.eq": { argTypes: [BIGINT_T, BIGINT_T], result: BOOL },
|
|
333
|
-
"bigint.eqString": { argTypes: [BIGINT_T, STRING], result: BOOL },
|
|
334
|
-
"bigint.cmp": { argTypes: [BIGINT_T, BIGINT_T], result: F64 },
|
|
335
|
-
"bigint.cmpNumber": { argTypes: [BIGINT_T, F64], result: F64 },
|
|
336
|
-
"bigint.truthy": { argTypes: [BIGINT_T], result: BOOL },
|
|
337
|
-
"bigint.toString": { argTypes: [BIGINT_T, F64], result: STRING },
|
|
338
|
-
"bigint.inspect": { argTypes: [BIGINT_T], result: STRING },
|
|
339
|
-
"bigint.toF64": { argTypes: [BIGINT_T], result: F64 },
|
|
340
|
-
"bigint.asUintN": { argTypes: [F64, BIGINT_T], result: BIGINT_T },
|
|
341
|
-
"bigint.asIntN": { argTypes: [F64, BIGINT_T], result: BIGINT_T },
|
|
342
|
-
"bigint.bufferRead": { argTypes: [BYTES_U8, F64, BOOL, BOOL], result: BIGINT_T },
|
|
343
|
-
"bigint.bufferWrite": { argTypes: [BYTES_U8, BIGINT_T, F64, BOOL, BOOL], result: F64 },
|
|
344
|
-
"bigint.dataViewGet": { argTypes: [BYTES_U8, F64, BOOL, BOOL], result: BIGINT_T },
|
|
345
|
-
"bigint.dataViewSet": { argTypes: [BYTES_U8, F64, BIGINT_T, BOOL], result: VOID },
|
|
346
|
-
"url.new": { argTypes: [STRING], result: URL_T },
|
|
347
|
-
"url.newBase": { argTypes: [STRING, STRING], result: URL_T },
|
|
348
|
-
"url.canParse": { argTypes: [STRING], result: BOOL },
|
|
349
|
-
"url.canParseBase": { argTypes: [STRING, STRING], result: BOOL },
|
|
350
|
-
"url.parse": { argTypes: [STRING], result: DYN },
|
|
351
|
-
"url.parseBase": { argTypes: [STRING, STRING], result: DYN },
|
|
352
|
-
"url.protocol": { argTypes: [URL_T], result: STRING },
|
|
353
|
-
"url.origin": { argTypes: [URL_T], result: STRING },
|
|
354
|
-
"url.username": { argTypes: [URL_T], result: STRING },
|
|
355
|
-
"url.password": { argTypes: [URL_T], result: STRING },
|
|
356
|
-
"url.host": { argTypes: [URL_T], result: STRING },
|
|
357
|
-
"url.hostname": { argTypes: [URL_T], result: STRING },
|
|
358
|
-
"url.port": { argTypes: [URL_T], result: STRING },
|
|
359
|
-
"url.pathname": { argTypes: [URL_T], result: STRING },
|
|
360
|
-
"url.href": { argTypes: [URL_T], result: STRING },
|
|
361
|
-
"url.set": { argTypes: [URL_T, STRING, STRING], result: VOID },
|
|
362
|
-
"url.setChecked": { argTypes: [URL_T, STRING, DYN], result: VOID },
|
|
363
|
-
"url.fileURLToPathUrl": { argTypes: [URL_T], result: STRING },
|
|
364
|
-
"url.fileURLToPathChecked": { argTypes: [DYN], result: STRING },
|
|
365
|
-
"url.fileURLToPathOptions": { argTypes: [DYN, DYN], result: STRING },
|
|
366
|
-
"url.fileURLToPathBuffer": { argTypes: [DYN, DYN], result: BYTES_U8 },
|
|
367
|
-
"url.pathToFileURLChecked": { argTypes: [DYN, DYN], result: URL_T },
|
|
368
|
-
"url.fileURLToPathStr": { argTypes: [STRING], result: STRING },
|
|
369
|
-
"url.pathToFileURL": { argTypes: [STRING], result: URL_T },
|
|
370
|
-
"url.pathToFileURLPlatform": { argTypes: [STRING, BOOL], result: URL_T },
|
|
371
|
-
"url.pathToFileURLWin32": { argTypes: [STRING], result: URL_T },
|
|
372
|
-
"sp.new": { argTypes: [], result: SEARCH_PARAMS_T },
|
|
373
|
-
"sp.newChecked": { argTypes: [DYN], result: SEARCH_PARAMS_T },
|
|
374
|
-
"sp.parse": { argTypes: [STRING], result: SEARCH_PARAMS_T },
|
|
375
|
-
"sp.copy": { argTypes: [SEARCH_PARAMS_T], result: SEARCH_PARAMS_T },
|
|
376
|
-
// The pairs argument is string[][] — checked structurally below (the
|
|
377
|
-
// generic array-of slot has no named constant here).
|
|
378
|
-
"sp.fromPairs": { argTypes: [null], result: SEARCH_PARAMS_T },
|
|
379
|
-
"sp.with": { argTypes: [SEARCH_PARAMS_T, STRING, STRING], result: SEARCH_PARAMS_T },
|
|
380
|
-
"url.searchParams": { argTypes: [URL_T], result: SEARCH_PARAMS_T },
|
|
381
|
-
"url.search": { argTypes: [URL_T], result: STRING },
|
|
382
|
-
"url.hash": { argTypes: [URL_T], result: STRING },
|
|
383
|
-
// Result is the interned `string | null` union — the libCall case
|
|
384
|
-
// checks the arms (the spawnRes.signal pattern).
|
|
385
|
-
"sp.get": { argTypes: [SEARCH_PARAMS_T, STRING], result: VOID },
|
|
386
|
-
"sp.getAll": { argTypes: [SEARCH_PARAMS_T, STRING], result: arrayOf(STRING) },
|
|
387
|
-
"sp.append": { argTypes: [SEARCH_PARAMS_T, STRING, STRING], result: VOID },
|
|
388
|
-
"sp.set": { argTypes: [SEARCH_PARAMS_T, STRING, STRING], result: VOID },
|
|
389
|
-
"sp.delete": { argTypes: [SEARCH_PARAMS_T, STRING], result: VOID },
|
|
390
|
-
"sp.deleteValue": { argTypes: [SEARCH_PARAMS_T, STRING, STRING], result: VOID },
|
|
391
|
-
"sp.has": { argTypes: [SEARCH_PARAMS_T, STRING], result: BOOL },
|
|
392
|
-
"sp.hasValue": { argTypes: [SEARCH_PARAMS_T, STRING, STRING], result: BOOL },
|
|
393
|
-
"sp.sort": { argTypes: [SEARCH_PARAMS_T], result: VOID },
|
|
394
|
-
"sp.size": { argTypes: [SEARCH_PARAMS_T], result: F64 },
|
|
395
|
-
"sp.toString": { argTypes: [SEARCH_PARAMS_T], result: STRING },
|
|
396
|
-
"sp.keyAt": { argTypes: [SEARCH_PARAMS_T, F64], result: STRING },
|
|
397
|
-
"sp.valAt": { argTypes: [SEARCH_PARAMS_T, F64], result: STRING },
|
|
398
|
-
// node:querystring. qs.parse's result is the call site's ParsedUrlQuery
|
|
399
|
-
// dictionary record (VOID is the networkInterfaces sentinel — the
|
|
400
|
-
// libCall case checks the structure); qs.stringify's object argument
|
|
401
|
-
// is a dyn value (the frontend dynFroms typed records).
|
|
402
|
-
"qs.parse": { argTypes: [STRING, STRING, STRING, F64], result: VOID },
|
|
403
|
-
"qs.stringify": { argTypes: [DYN, STRING, STRING], result: STRING },
|
|
404
|
-
"qs.escape": { argTypes: [STRING], result: STRING },
|
|
405
|
-
"qs.unescape": { argTypes: [STRING], result: STRING },
|
|
406
|
-
"util.parseArgs": { argTypes: [DYN], result: DYN },
|
|
407
|
-
"util.parseEnv": { argTypes: [DYN], result: DYN },
|
|
408
|
-
"util.getSystemErrorName": { argTypes: [DYN], result: STRING },
|
|
409
|
-
"util.getSystemErrorMessage": { argTypes: [DYN], result: STRING },
|
|
410
|
-
"util.systemErrorEntries": { argTypes: [], result: DYN },
|
|
411
|
-
"util.stripVTControlCharacters": { argTypes: [DYN], result: STRING },
|
|
412
|
-
"util.toUSVString": { argTypes: [DYN], result: STRING },
|
|
413
|
-
"util.isDeepStrictEqual": { argTypes: [DYN, DYN, DYN], result: BOOL },
|
|
414
|
-
"util.styleText": { argTypes: [DYN, DYN, DYN], result: STRING },
|
|
415
|
-
"util.typeIs": { argTypes: [DYN, STRING], result: BOOL },
|
|
416
|
-
"util.typeValue": { argTypes: [DYN, STRING], result: DYN },
|
|
417
|
-
"fs.statSync": { argTypes: [STRING], result: STATS_T },
|
|
418
|
-
"fs.lstatSync": { argTypes: [STRING], result: STATS_T },
|
|
419
|
-
"fs.fstatSync": { argTypes: [F64], result: STATS_T },
|
|
420
|
-
"fs.fchmodSync": { argTypes: [F64, F64], result: VOID },
|
|
421
|
-
"fs.fsyncSync": { argTypes: [F64], result: VOID },
|
|
422
|
-
"fs.fdatasyncSync": { argTypes: [F64], result: VOID },
|
|
423
|
-
"fs.ftruncateSync": { argTypes: [F64, F64], result: VOID },
|
|
424
|
-
"fs.utimesSync": { argTypes: [DYN, DYN, DYN], result: VOID },
|
|
425
|
-
"fs.futimesSync": { argTypes: [DYN, DYN, DYN], result: VOID },
|
|
426
|
-
"fs.lutimesSync": { argTypes: [DYN, DYN, DYN], result: VOID },
|
|
427
|
-
"fs.readvSync": { argTypes: [F64, arrayOf(BYTES_U8), F64], result: F64 },
|
|
428
|
-
"fs.writevSync": { argTypes: [F64, arrayOf(BYTES_U8), F64], result: F64 },
|
|
429
|
-
"fs.linkSync": { argTypes: [DYN, DYN], result: VOID },
|
|
430
|
-
"fs.symlinkSync": { argTypes: [DYN, DYN, DYN], result: VOID },
|
|
431
|
-
"fs.readlinkSync": { argTypes: [DYN, DYN], result: DYN },
|
|
432
|
-
"fs.statfsSync": { argTypes: [DYN, DYN], result: DYN },
|
|
433
|
-
"fs.readlinkSyncStr": { argTypes: [DYN, DYN], result: STRING },
|
|
434
|
-
"fs.readlinkSyncBuffer": { argTypes: [DYN, DYN], result: BYTES_U8 },
|
|
435
|
-
"fs.openSync": { argTypes: [STRING, STRING], result: F64 },
|
|
436
|
-
"fs.openNumericSync": { argTypes: [STRING, F64, F64], result: F64 },
|
|
437
|
-
"fs.readSync": { argTypes: [F64, BYTES_U8, F64, F64, F64], result: F64 },
|
|
438
|
-
"fs.writeSync": { argTypes: [F64, BYTES_U8, F64, F64, F64], result: F64 },
|
|
439
|
-
"fs.writeStrSync": { argTypes: [F64, STRING, F64, STRING], result: F64 },
|
|
440
|
-
// fs.watch's callback func type is program-dependent (zero params, or
|
|
441
|
-
// the eventType string) — the slot pins arity and the path/receiver.
|
|
442
|
-
"fs.watch": { argTypes: [STRING], result: FSWATCHER_T },
|
|
443
|
-
"fs.watchCb": { argTypes: [STRING, null], result: FSWATCHER_T },
|
|
444
|
-
"watcher.close": { argTypes: [FSWATCHER_T], result: VOID },
|
|
445
|
-
"crypto.x509Fingerprint": { argTypes: [BYTES_U8], result: STRING },
|
|
446
|
-
"crypto.x509FingerprintStr": { argTypes: [STRING], result: STRING },
|
|
447
|
-
"crypto.x509ValidFrom": { argTypes: [BYTES_U8], result: STRING },
|
|
448
|
-
"crypto.x509ValidFromStr": { argTypes: [STRING], result: STRING },
|
|
449
|
-
"crypto.x509ValidTo": { argTypes: [BYTES_U8], result: STRING },
|
|
450
|
-
"crypto.x509ValidToStr": { argTypes: [STRING], result: STRING },
|
|
451
|
-
"fs.closeSync": { argTypes: [F64], result: VOID },
|
|
452
|
-
"stats.isFile": { argTypes: [STATS_T], result: BOOL },
|
|
453
|
-
"stats.isDirectory": { argTypes: [STATS_T], result: BOOL },
|
|
454
|
-
"stats.isSymbolicLink": { argTypes: [STATS_T], result: BOOL },
|
|
455
|
-
"stats.size": { argTypes: [STATS_T], result: F64 },
|
|
456
|
-
"stats.dev": { argTypes: [STATS_T], result: F64 },
|
|
457
|
-
"stats.ino": { argTypes: [STATS_T], result: F64 },
|
|
458
|
-
"stats.blocks": { argTypes: [STATS_T], result: F64 },
|
|
459
|
-
"stats.nlink": { argTypes: [STATS_T], result: F64 },
|
|
460
|
-
"stats.atimeMs": { argTypes: [STATS_T], result: F64 },
|
|
461
|
-
"stats.mtimeMs": { argTypes: [STATS_T], result: F64 },
|
|
462
|
-
"stats.ctimeMs": { argTypes: [STATS_T], result: F64 },
|
|
463
|
-
// The wider sync fs slice (unlink/chmod/chown/copyfile and the
|
|
464
|
-
// mode-carrying write/mkdir forms).
|
|
465
|
-
"fs.unlinkSync": { argTypes: [STRING], result: VOID },
|
|
466
|
-
"fs.chmodSync": { argTypes: [STRING, F64], result: VOID },
|
|
467
|
-
"fs.chownSync": { argTypes: [STRING, F64, F64], result: VOID },
|
|
468
|
-
"fs.copyFileSync": { argTypes: [STRING, STRING], result: VOID },
|
|
469
|
-
"fs.renameSync": { argTypes: [STRING, STRING], result: VOID },
|
|
470
|
-
// Callback type is program-dependent (zero params or Error | null).
|
|
471
|
-
"fs.renameCb": { argTypes: [STRING, STRING, null], result: VOID },
|
|
472
|
-
"fs.writeFileModeSync": { argTypes: [STRING, STRING, F64], result: VOID },
|
|
473
|
-
"fs.mkdirModeSync": { argTypes: [STRING, F64], result: VOID },
|
|
474
|
-
"fs.mkdirRecursiveModeSync": { argTypes: [STRING, F64], result: VOID },
|
|
475
|
-
// Atomics.wait over an Int32Array — the synchronous-sleep idiom.
|
|
476
|
-
"atomics.wait": { argTypes: [bytesOf("i32"), F64, F64, F64], result: STRING },
|
|
477
|
-
"cp.spawnSync": { argTypes: [STRING, arrayOf(STRING)], result: SPAWNRES_T },
|
|
478
|
-
// spawnSync's options form: timeout, killSignal name ("" = SIGTERM),
|
|
479
|
-
// and the three stdio modes.
|
|
480
|
-
"cp.spawnSyncOpts": {
|
|
481
|
-
argTypes: [STRING, arrayOf(STRING), F64, STRING, F64, F64, F64],
|
|
482
|
-
result: SPAWNRES_T,
|
|
483
|
-
},
|
|
484
|
-
"cp.spawnSyncStdioStr": {
|
|
485
|
-
argTypes: [STRING, arrayOf(STRING), F64, STRING, STRING],
|
|
486
|
-
result: SPAWNRES_T,
|
|
487
|
-
},
|
|
488
|
-
// node:net (scr_net.c). Listener slots are program-dependent closures —
|
|
489
|
-
// null slots, checked in the libCall case (the child.onExit precedent);
|
|
490
|
-
// the zero-param callbacks pin the exact func type here. The trailing
|
|
491
|
-
// BOOL on registrations is the once flag.
|
|
492
|
-
"net.createServer": { argTypes: [], result: NETSERVER_T },
|
|
493
|
-
"net.createServerCb": { argTypes: [null], result: NETSERVER_T },
|
|
494
|
-
"net.listen": { argTypes: [NETSERVER_T, F64], result: VOID },
|
|
495
|
-
"net.listenCb": { argTypes: [NETSERVER_T, F64, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
496
|
-
"net.listenOpts": { argTypes: [NETSERVER_T, F64, STRING, BOOL], result: VOID },
|
|
497
|
-
// The callback slot is a zero-param void closure OR its
|
|
498
|
-
// `(() => void) | undefined` optional-binding union (checked specially).
|
|
499
|
-
"net.listenOptsCb": { argTypes: [NETSERVER_T, F64, STRING, BOOL, null], result: VOID },
|
|
500
|
-
"net.listenOptsReusePort": { argTypes: [NETSERVER_T, F64, STRING, BOOL, BOOL], result: VOID },
|
|
501
|
-
// The callback is a zero-param void closure OR its optional-binding union;
|
|
502
|
-
// the callback follows the reusePort BOOL in this additive ABI.
|
|
503
|
-
"net.listenOptsReusePortCb": { argTypes: [NETSERVER_T, F64, STRING, BOOL, BOOL, null], result: VOID },
|
|
504
|
-
"net.serverPort": { argTypes: [NETSERVER_T], result: F64 },
|
|
505
|
-
"net.serverListening": { argTypes: [NETSERVER_T], result: BOOL },
|
|
506
|
-
// net.serverAddress's record result is shape-checked in the libCall case
|
|
507
|
-
// (the dgram.address sentinel pattern).
|
|
508
|
-
"net.serverAddress": { argTypes: [NETSERVER_T], result: VOID },
|
|
509
|
-
"net.serverClose": { argTypes: [NETSERVER_T], result: VOID },
|
|
510
|
-
"net.serverCloseCb": { argTypes: [NETSERVER_T, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
511
|
-
"net.serverOnError": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
|
|
512
|
-
"net.serverOnClose": { argTypes: [NETSERVER_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
513
|
-
"net.serverOnConnection": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
|
|
514
|
-
"net.serverOnSecureConnection": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
|
|
515
|
-
"net.connect": { argTypes: [F64, STRING], result: NETSOCKET_T },
|
|
516
|
-
"net.connectAttempt": { argTypes: [F64, STRING, DYN], result: NETSOCKET_T },
|
|
517
|
-
"net.connectOptsChk": { argTypes: [DYN, STRING], result: VOID },
|
|
518
|
-
"net.connectCb": { argTypes: [F64, STRING, { kind: "func", params: [], ret: VOID }], result: NETSOCKET_T },
|
|
519
|
-
// The lookup's exact func shape is program data (its answer callback's
|
|
520
|
-
// union/record types) — checked specially in the libCall case.
|
|
521
|
-
"net.connectLookup": { argTypes: [F64, STRING, null], result: NETSOCKET_T },
|
|
522
|
-
"net.sockWrite": { argTypes: [NETSOCKET_T, STRING], result: VOID },
|
|
523
|
-
"net.sockWriteBytes": { argTypes: [NETSOCKET_T, BYTES_U8], result: VOID },
|
|
524
|
-
"net.sockEnd": { argTypes: [NETSOCKET_T], result: VOID },
|
|
525
|
-
"net.sockEndStr": { argTypes: [NETSOCKET_T, STRING], result: VOID },
|
|
526
|
-
"net.sockEndBytes": { argTypes: [NETSOCKET_T, BYTES_U8], result: VOID },
|
|
527
|
-
"net.sockWriteDyn": { argTypes: [NETSOCKET_T, DYN], result: VOID },
|
|
528
|
-
"net.sockEndDyn": { argTypes: [NETSOCKET_T, DYN], result: VOID },
|
|
529
|
-
"net.sockDestroy": { argTypes: [NETSOCKET_T], result: VOID },
|
|
530
|
-
"net.sockPipe": { argTypes: [NETSOCKET_T, NETSOCKET_T], result: VOID },
|
|
531
|
-
"net.sockPipeRes": { argTypes: [NETSOCKET_T, HTTPRES_T], result: VOID },
|
|
532
|
-
"net.sockOnData": { argTypes: [NETSOCKET_T, null, BOOL], result: VOID },
|
|
533
|
-
"net.sockOnEnd": { argTypes: [NETSOCKET_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
534
|
-
"net.sockOnClose": { argTypes: [NETSOCKET_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
535
|
-
"net.sockOnError": { argTypes: [NETSOCKET_T, null, BOOL], result: VOID },
|
|
536
|
-
"net.sockOnConnect": { argTypes: [NETSOCKET_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
537
|
-
// node:dgram + node:dns (scr_dgram.c). The message/error listeners and
|
|
538
|
-
// dns.lookup's callback are program-dependent closures (null slots,
|
|
539
|
-
// checked in the libCall case); dgram.address's record result is
|
|
540
|
-
// program-dependent too (VOID here is the envGet sentinel — the libCall
|
|
541
|
-
// case checks the {address, family, port} shape).
|
|
542
|
-
"dgram.createSocket": { argTypes: [BOOL], result: DGRAMSOCK_T },
|
|
543
|
-
"dgram.bind": { argTypes: [DGRAMSOCK_T, F64, STRING], result: VOID },
|
|
544
|
-
"dgram.bindCb": { argTypes: [DGRAMSOCK_T, F64, STRING, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
545
|
-
"dgram.connect": { argTypes: [DGRAMSOCK_T, F64, STRING], result: VOID },
|
|
546
|
-
"dgram.connectCb": { argTypes: [DGRAMSOCK_T, F64, STRING, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
547
|
-
"dgram.sendStr": { argTypes: [DGRAMSOCK_T, STRING, F64, STRING], result: VOID },
|
|
548
|
-
"dgram.sendBytes": { argTypes: [DGRAMSOCK_T, BYTES_U8, F64, STRING], result: VOID },
|
|
549
|
-
"dgram.sendChk": { argTypes: [DGRAMSOCK_T, DYN, DYN, DYN, DYN, DYN, STRING], result: VOID },
|
|
550
|
-
"dgram.address": { argTypes: [DGRAMSOCK_T], result: VOID },
|
|
551
|
-
"dgram.close": { argTypes: [DGRAMSOCK_T], result: VOID },
|
|
552
|
-
"dgram.closeCb": { argTypes: [DGRAMSOCK_T, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
553
|
-
"dgram.unref": { argTypes: [DGRAMSOCK_T], result: VOID },
|
|
554
|
-
"dgram.ref": { argTypes: [DGRAMSOCK_T], result: VOID },
|
|
555
|
-
"dgram.onMessage": { argTypes: [DGRAMSOCK_T, null, BOOL], result: VOID },
|
|
556
|
-
"dgram.onError": { argTypes: [DGRAMSOCK_T, null, BOOL], result: VOID },
|
|
557
|
-
"dgram.onListening": { argTypes: [DGRAMSOCK_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
558
|
-
"dgram.onClose": { argTypes: [DGRAMSOCK_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
559
|
-
"dgram.onConnect": { argTypes: [DGRAMSOCK_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
560
|
-
"dns.lookup": { argTypes: [STRING, F64, null], result: VOID },
|
|
561
|
-
// node:test (scr_test.c). Bodies are program-dependent closures (0 or
|
|
562
|
-
// 1 testCtx param, void or Promise<void> result — the spoke pinned the
|
|
563
|
-
// shape): null slots. sub's result is the settled Promise<void> the
|
|
564
|
-
// await consumes.
|
|
565
|
-
"test.register": { argTypes: [STRING, F64, STRING, null, F64, STRING], result: VOID },
|
|
566
|
-
"test.registerEmpty": { argTypes: [STRING, F64, STRING, F64, STRING], result: VOID },
|
|
567
|
-
"test.suite": { argTypes: [STRING, F64, STRING, { kind: "func", params: [], ret: VOID }, STRING], result: VOID },
|
|
568
|
-
"test.hook": { argTypes: [F64, null, F64], result: VOID },
|
|
569
|
-
"test.sub": { argTypes: [TESTCTX_T, STRING, F64, STRING, null, F64, STRING], result: { kind: "promise", inner: VOID } },
|
|
570
|
-
"test.subEmpty": { argTypes: [TESTCTX_T, STRING, F64, STRING, STRING], result: VOID },
|
|
571
|
-
"test.ctxSkip": { argTypes: [TESTCTX_T, STRING], result: VOID },
|
|
572
|
-
"test.ctxTodo": { argTypes: [TESTCTX_T, STRING], result: VOID },
|
|
573
|
-
"test.ctxDiagnostic": { argTypes: [TESTCTX_T, STRING], result: VOID },
|
|
574
|
-
"test.ctxName": { argTypes: [TESTCTX_T], result: STRING },
|
|
575
|
-
// node:http (scr_http.c over scr_net.c). The handler and the data
|
|
576
|
-
// listeners are program-dependent closures (null slots, checked in the
|
|
577
|
-
// libCall case); reqHeader's result is the interned string|undefined
|
|
578
|
-
// union, checked like process.envGet.
|
|
579
|
-
"http.createServer": { argTypes: [null], result: NETSERVER_T },
|
|
580
|
-
"http.createServerEmpty": { argTypes: [], result: NETSERVER_T },
|
|
581
|
-
"http.validateHeaderName": { argTypes: [STRING, STRING], result: VOID },
|
|
582
|
-
"http.validateHeaderValue": { argTypes: [STRING, DYN], result: VOID },
|
|
583
|
-
"http.serverJoinDupHeaders": { argTypes: [NETSERVER_T], result: VOID },
|
|
584
|
-
"http.serverAllowMissingHostHeader": { argTypes: [NETSERVER_T], result: VOID },
|
|
585
|
-
"http.serverTimeoutGet": { argTypes: [NETSERVER_T, F64], result: F64 },
|
|
586
|
-
"http.serverSetTimeout": { argTypes: [NETSERVER_T, F64], result: VOID },
|
|
587
|
-
"http.serverSetTimeoutCb": { argTypes: [NETSERVER_T, F64, null], result: VOID },
|
|
588
|
-
"http.serverOnTimeout": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
|
|
589
|
-
"http.serverCloseAllConnections": { argTypes: [NETSERVER_T], result: VOID },
|
|
590
|
-
"http.serverCloseIdleConnections": { argTypes: [NETSERVER_T], result: VOID },
|
|
591
|
-
"http.serverTimeoutSet": { argTypes: [NETSERVER_T, F64, F64], result: VOID },
|
|
592
|
-
"http.serverTimeoutOptionSet": { argTypes: [NETSERVER_T, F64, DYN], result: VOID },
|
|
593
|
-
"net.serverOnListening": { argTypes: [NETSERVER_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
594
|
-
"http.resStatusGet": { argTypes: [HTTPRES_T], result: F64 },
|
|
595
|
-
"http.resStatusSet": { argTypes: [HTTPRES_T, F64], result: VOID },
|
|
596
|
-
"http.resStatusMsgGet": { argTypes: [HTTPRES_T], result: VOID },
|
|
597
|
-
"http.resStatusMsgSet": { argTypes: [HTTPRES_T, STRING], result: VOID },
|
|
598
|
-
"http.resRequest": { argTypes: [HTTPRES_T], result: HTTPREQ_T },
|
|
599
|
-
"http.resSocket": { argTypes: [HTTPRES_T], result: VOID },
|
|
600
|
-
"http.resWritableFinished": { argTypes: [HTTPRES_T], result: BOOL },
|
|
601
|
-
"http.resSendDateGet": { argTypes: [HTTPRES_T], result: BOOL },
|
|
602
|
-
"http.resSendDateSet": { argTypes: [HTTPRES_T, BOOL], result: VOID },
|
|
603
|
-
"http.resStrictContentLengthGet": { argTypes: [HTTPRES_T], result: BOOL },
|
|
604
|
-
"http.resStrictContentLengthSet": { argTypes: [HTTPRES_T, BOOL], result: VOID },
|
|
605
|
-
"http.resSetTimeout": { argTypes: [HTTPRES_T, F64], result: VOID },
|
|
606
|
-
"http.resSetTimeoutCb": { argTypes: [HTTPRES_T, F64, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
607
|
-
// resGetHeader answers the interned `string | undefined` union — the
|
|
608
|
-
// reqHeader/envGet sentinel pattern (VOID here, checked specially).
|
|
609
|
-
"http.resGetHeader": { argTypes: [HTTPRES_T, STRING], result: VOID },
|
|
610
|
-
"http.resGetHeaderNames": { argTypes: [HTTPRES_T], result: arrayOf(STRING) },
|
|
611
|
-
"http.resGetRawHeaderNames": { argTypes: [HTTPRES_T], result: arrayOf(STRING) },
|
|
612
|
-
"http.resGetHeaders": { argTypes: [HTTPRES_T], result: DYN },
|
|
613
|
-
"http.resHasHeader": { argTypes: [HTTPRES_T, STRING], result: BOOL },
|
|
614
|
-
"http.resRemoveHeader": { argTypes: [HTTPRES_T, STRING], result: VOID },
|
|
615
|
-
"http.resOnFinish": { argTypes: [HTTPRES_T, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
616
|
-
"http.reqUrl": { argTypes: [HTTPREQ_T], result: STRING },
|
|
617
|
-
"http.reqMethod": { argTypes: [HTTPREQ_T], result: STRING },
|
|
618
|
-
"http.reqHeader": { argTypes: [HTTPREQ_T, STRING], result: VOID },
|
|
619
|
-
"http.reqTrailer": { argTypes: [HTTPREQ_T, STRING], result: VOID },
|
|
620
|
-
"http.reqHeaderValues": { argTypes: [HTTPREQ_T, STRING], result: VOID },
|
|
621
|
-
"http.reqTrailerValues": { argTypes: [HTTPREQ_T, STRING], result: VOID },
|
|
622
|
-
"http.reqOnData": { argTypes: [HTTPREQ_T, null, BOOL], result: VOID },
|
|
623
|
-
"http.reqOnEnd": { argTypes: [HTTPREQ_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
624
|
-
"http.resSetHeader": { argTypes: [HTTPRES_T, STRING, STRING], result: VOID },
|
|
625
|
-
"http.resWriteHead": { argTypes: [HTTPRES_T, F64], result: VOID },
|
|
626
|
-
"http.resWriteHeadN": { argTypes: [HTTPRES_T, F64, arrayOf(STRING), arrayOf(STRING)], result: VOID },
|
|
627
|
-
"http.resWriteContinue": { argTypes: [HTTPRES_T], result: VOID },
|
|
628
|
-
"http.resWriteProcessing": { argTypes: [HTTPRES_T], result: VOID },
|
|
629
|
-
"http.resWriteEarlyHints": { argTypes: [HTTPRES_T, arrayOf(STRING)], result: VOID },
|
|
630
|
-
"http.resWrite": { argTypes: [HTTPRES_T, STRING], result: VOID },
|
|
631
|
-
"http.resWriteBytes": { argTypes: [HTTPRES_T, BYTES_U8], result: VOID },
|
|
632
|
-
"http.resEnd": { argTypes: [HTTPRES_T], result: VOID },
|
|
633
|
-
"http.resEndStr": { argTypes: [HTTPRES_T, STRING], result: VOID },
|
|
634
|
-
"http.resEndBytes": { argTypes: [HTTPRES_T, BYTES_U8], result: VOID },
|
|
635
|
-
"http.resWriteDyn": { argTypes: [HTTPRES_T, DYN], result: VOID },
|
|
636
|
-
"http.resEndDyn": { argTypes: [HTTPRES_T, DYN], result: VOID },
|
|
637
|
-
"http.resHeadersSent": { argTypes: [HTTPRES_T], result: BOOL },
|
|
638
|
-
"http.resWritableEnded": { argTypes: [HTTPRES_T], result: BOOL },
|
|
639
|
-
"http.resFlushHeaders": { argTypes: [HTTPRES_T], result: VOID },
|
|
640
|
-
"http.resAddTrailers": { argTypes: [HTTPRES_T, arrayOf(STRING)], result: VOID },
|
|
641
|
-
"http.resCork": { argTypes: [HTTPRES_T], result: VOID },
|
|
642
|
-
"http.resUncork": { argTypes: [HTTPRES_T], result: VOID },
|
|
643
|
-
"http.resWritableCorked": { argTypes: [HTTPRES_T], result: F64 },
|
|
644
|
-
// The member follow-ups: reqStatusCode's `number | undefined` and
|
|
645
|
-
// sockRemoteAddress's `string | undefined` results are shape-checked in
|
|
646
|
-
// the special cases below (like reqHeader/columns).
|
|
647
|
-
"http.reqStatusCode": { argTypes: [HTTPREQ_T], result: VOID },
|
|
648
|
-
// reqStatusMessage's `string | undefined` is program-interned like
|
|
649
|
-
// reqHeader's (the VOID here is the envGet sentinel).
|
|
650
|
-
"http.reqStatusMessage": { argTypes: [HTTPREQ_T], result: VOID },
|
|
651
|
-
"http.reqRawHeaders": { argTypes: [HTTPREQ_T], result: arrayOf(STRING) },
|
|
652
|
-
"http.reqHeaderPairs": { argTypes: [HTTPREQ_T], result: arrayOf(STRING) },
|
|
653
|
-
"http.reqRawTrailers": { argTypes: [HTTPREQ_T], result: arrayOf(STRING) },
|
|
654
|
-
"http.reqTrailerPairs": { argTypes: [HTTPREQ_T], result: arrayOf(STRING) },
|
|
655
|
-
"net.sockDestroyed": { argTypes: [NETSOCKET_T], result: BOOL },
|
|
656
|
-
"net.sockWritable": { argTypes: [NETSOCKET_T], result: BOOL },
|
|
657
|
-
// The 'upgrade' registrations: the callback shapes are program-typed
|
|
658
|
-
// ((req, socket, head) and shorter prefixes — the libCall case checks).
|
|
659
|
-
"http.serverOnUpgrade": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
|
|
660
|
-
"http.serverOnConnect": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
|
|
661
|
-
"http.clientOnUpgrade": { argTypes: [HTTPCLIENTREQ_T, null, BOOL], result: VOID },
|
|
662
|
-
"http.reqSocket": { argTypes: [HTTPREQ_T], result: NETSOCKET_T },
|
|
663
|
-
// reqH2Stream's program-interned Http2Stream | undefined result is
|
|
664
|
-
// checked in the special libCall cases below.
|
|
665
|
-
"http.reqH2Stream": { argTypes: [HTTPREQ_T], result: VOID },
|
|
666
|
-
"http.reqH2StreamOrThrow": { argTypes: [HTTPREQ_T, STRING], result: HTTP2STREAM_T },
|
|
667
|
-
"http.reqPipeRes": { argTypes: [HTTPREQ_T, HTTPRES_T], result: VOID },
|
|
668
|
-
"http.reqPipeClient": { argTypes: [HTTPREQ_T, HTTPCLIENTREQ_T], result: VOID },
|
|
669
|
-
"http.reqPipeSock": { argTypes: [HTTPREQ_T, NETSOCKET_T], result: VOID },
|
|
670
|
-
"http.reqResume": { argTypes: [HTTPREQ_T], result: VOID },
|
|
671
|
-
"http.reqDestroy": { argTypes: [HTTPREQ_T], result: VOID },
|
|
672
|
-
"http.reqOnError": { argTypes: [HTTPREQ_T, null, BOOL], result: VOID },
|
|
673
|
-
"http.reqOnClose": { argTypes: [HTTPREQ_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
674
|
-
"http.reqOnAborted": { argTypes: [HTTPREQ_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
675
|
-
"http.reqHttpVersion": { argTypes: [HTTPREQ_T], result: STRING },
|
|
676
|
-
"http.reqHttpVersionMajor": { argTypes: [HTTPREQ_T], result: F64 },
|
|
677
|
-
"http.reqHttpVersionMinor": { argTypes: [HTTPREQ_T], result: F64 },
|
|
678
|
-
"http.reqAborted": { argTypes: [HTTPREQ_T], result: BOOL },
|
|
679
|
-
"http.reqComplete": { argTypes: [HTTPREQ_T], result: BOOL },
|
|
680
|
-
"http.resDestroy": { argTypes: [HTTPRES_T], result: VOID },
|
|
681
|
-
"http.resOnClose": { argTypes: [HTTPRES_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
682
|
-
"http.resWriteHeadPairs": { argTypes: [HTTPRES_T, F64, arrayOf(STRING)], result: VOID },
|
|
683
|
-
"http.resWriteHeadDyn": { argTypes: [HTTPRES_T, F64, DYN], result: VOID },
|
|
684
|
-
"net.sockSetTimeout": { argTypes: [NETSOCKET_T, F64], result: VOID },
|
|
685
|
-
"net.sockSetEncoding": { argTypes: [NETSOCKET_T, STRING], result: VOID },
|
|
686
|
-
"http.reqSetEncoding": { argTypes: [HTTPREQ_T, STRING], result: VOID },
|
|
687
|
-
"net.sockOnTimeout": { argTypes: [NETSOCKET_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
688
|
-
"net.sockRemoteAddress": { argTypes: [NETSOCKET_T], result: VOID },
|
|
689
|
-
"net.sockEncrypted": { argTypes: [NETSOCKET_T], result: VOID },
|
|
690
|
-
// node:http, the client slice. The response callback shapes are
|
|
691
|
-
// program-dependent (checked below); header pairs arrive flat.
|
|
692
|
-
"http.request": { argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL], result: HTTPCLIENTREQ_T },
|
|
693
|
-
"http.requestCb": { argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, null], result: HTTPCLIENTREQ_T },
|
|
694
|
-
"http.agentNew": { argTypes: [BOOL, BOOL, F64, F64, F64, F64, F64], result: DYN },
|
|
695
|
-
"http.requestAgent": { argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, DYN], result: HTTPCLIENTREQ_T },
|
|
696
|
-
"http.requestAgentCb": { argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, DYN, null], result: HTTPCLIENTREQ_T },
|
|
697
|
-
"http.requestUrl": { argTypes: [STRING, STRING, BOOL], result: HTTPCLIENTREQ_T },
|
|
698
|
-
"http.requestUrlCb": { argTypes: [STRING, STRING, BOOL, null], result: HTTPCLIENTREQ_T },
|
|
699
|
-
"net.sockOnReadable": { argTypes: [NETSOCKET_T, null, BOOL], result: VOID },
|
|
700
|
-
// sockRead's result is the interned `Buffer | null` union — checked
|
|
701
|
-
// specially below (the reqHeader/envGet pattern; VOID here is a
|
|
702
|
-
// placeholder the special case overrides).
|
|
703
|
-
"net.sockRead": { argTypes: [NETSOCKET_T, F64], result: VOID },
|
|
704
|
-
"net.sockUnshift": { argTypes: [NETSOCKET_T, BYTES_U8], result: VOID },
|
|
705
|
-
"net.sockPause": { argTypes: [NETSOCKET_T], result: NETSOCKET_T },
|
|
706
|
-
"net.sockResume": { argTypes: [NETSOCKET_T], result: NETSOCKET_T },
|
|
707
|
-
"net.sockSetNoDelay": { argTypes: [NETSOCKET_T, BOOL], result: NETSOCKET_T },
|
|
708
|
-
"net.sockDestroySoon": { argTypes: [NETSOCKET_T], result: VOID },
|
|
709
|
-
"net.sockBytesWritten": { argTypes: [NETSOCKET_T], result: F64 },
|
|
710
|
-
"net.sockReadable": { argTypes: [NETSOCKET_T], result: BOOL },
|
|
711
|
-
"net.sockOnFinish": { argTypes: [NETSOCKET_T, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
712
|
-
"net.serverEmitConnection": { argTypes: [NETSERVER_T, NETSOCKET_T], result: VOID },
|
|
713
|
-
// tls/https: cert/key/ca PEM arguments are strings OR Buffers (null =
|
|
714
|
-
// both accepted; the emitter passes data+len either way).
|
|
715
|
-
"tls.createServer": { argTypes: [null, null], result: NETSERVER_T },
|
|
716
|
-
"tls.createServerCb": { argTypes: [null, null, null], result: NETSERVER_T },
|
|
717
|
-
// The runtime options records (divergence 66's stance): a dyn options
|
|
718
|
-
// value whose members read at runtime; pemDyn extracts a runtime-valued
|
|
719
|
-
// cert/key member (arg 1 is the precomposed fence label).
|
|
720
|
-
"tls.pemDyn": { argTypes: [DYN, STRING], result: BYTES_U8 },
|
|
721
|
-
"tls.createServerDyn": { argTypes: [DYN], result: NETSERVER_T },
|
|
722
|
-
"tls.createServerDynCb": { argTypes: [DYN, null], result: NETSERVER_T },
|
|
723
|
-
"https.createServerDyn": { argTypes: [DYN], result: NETSERVER_T },
|
|
724
|
-
"https.createServerDynCb": { argTypes: [DYN, null], result: NETSERVER_T },
|
|
725
|
-
"http2.createSecureServerReq": { argTypes: [null, null, null, BOOL], result: NETSERVER_T },
|
|
726
|
-
"http2.createSecureServerH2Req": { argTypes: [null, null, null, BOOL], result: NETSERVER_T },
|
|
727
|
-
"http2.createSecureServerDyn": { argTypes: [DYN], result: NETSERVER_T },
|
|
728
|
-
"http2.createSecureServerDynCb": { argTypes: [DYN, null], result: NETSERVER_T },
|
|
729
|
-
// tls.connect(port, host, opts[, cb]) — port -1 / host "" read the
|
|
730
|
-
// options record; the callback fires post-handshake (secureConnect).
|
|
731
|
-
"tls.connect": { argTypes: [F64, STRING, DYN], result: NETSOCKET_T },
|
|
732
|
-
"tls.connectCb": { argTypes: [F64, STRING, DYN, null], result: NETSOCKET_T },
|
|
733
|
-
// The TLSSocket member surface (authError's `string | null` union is
|
|
734
|
-
// shape-checked in the special cases below — the reqHeader pattern).
|
|
735
|
-
"tls.sockAuthorized": { argTypes: [NETSOCKET_T], result: BOOL },
|
|
736
|
-
"tls.sockAuthError": { argTypes: [NETSOCKET_T], result: VOID },
|
|
737
|
-
"tls.sockOnSecureConnect": { argTypes: [NETSOCKET_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
738
|
-
"tls.sockOnSession": { argTypes: [NETSOCKET_T, null, BOOL], result: VOID },
|
|
739
|
-
// createSecureContext({ cert, key }) mints the opaque SNI-answer handle.
|
|
740
|
-
"tls.createSecureContext": { argTypes: [null, null], result: SECURECTX_T },
|
|
741
|
-
"tls.createSecureContextDyn": { argTypes: [DYN], result: SECURECTX_T },
|
|
742
|
-
"tls.caCertsChk": { argTypes: [DYN, STRING], result: VOID },
|
|
743
|
-
// The CA-store introspection unit (scr_tls_ca.c): per-type cached PEM
|
|
744
|
-
// string arrays and the default-set replacement.
|
|
745
|
-
"tlsca.get": { argTypes: [STRING], result: arrayOf(STRING) },
|
|
746
|
-
"tlsca.root": { argTypes: [], result: arrayOf(STRING) },
|
|
747
|
-
"tlsca.set": { argTypes: [arrayOf(STRING)], result: VOID },
|
|
748
|
-
"https.createServer": { argTypes: [null, null, null], result: NETSERVER_T },
|
|
749
|
-
// http2's allowHTTP1 compatibility server (divergence 57): cert/key
|
|
750
|
-
// like tls.createServer; the 'request' handler arrives separately via
|
|
751
|
-
// http.serverOnRequest (shape checked in the libCall case, like
|
|
752
|
-
// http.createServer's). sessionError callback shape is checked below.
|
|
753
|
-
"http2.createSecureServer": { argTypes: [null, null, BOOL], result: NETSERVER_T },
|
|
754
|
-
// The SNI-callback form: arg 2 is the JS SNICallback closure — a
|
|
755
|
-
// `(servername, cb) => void` func, or its `| undefined` union from the
|
|
756
|
-
// conditional-spread spelling (the libCall case checks the shape).
|
|
757
|
-
"http2.createSecureServerSni": { argTypes: [null, null, null, BOOL], result: NETSERVER_T },
|
|
758
|
-
// The ALPN=h2 server (createSecureServer without allowHTTP1): the real
|
|
759
|
-
// h2 session machinery behind the TLS handshake.
|
|
760
|
-
"http2.createSecureServerH2": { argTypes: [null, null, BOOL], result: NETSERVER_T },
|
|
761
|
-
"http.serverOnRequest": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
|
|
762
|
-
"http2.serverOnSessionError": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
|
|
763
|
-
"http2.streamNoop": { argTypes: [], result: VOID },
|
|
764
|
-
"http2.streamUndefCall": { argTypes: [STRING], result: VOID },
|
|
765
|
-
// The REAL h2c surface (scr_http2.c). Callback slots are null (the
|
|
766
|
-
// emitter picks the thunk); pairs slots are string arrays; the
|
|
767
|
-
// endStream tri-state and event flags ride as f64.
|
|
768
|
-
"http2.createServer": { argTypes: [], result: NETSERVER_T },
|
|
769
|
-
"http2.createServerReq": { argTypes: [null], result: NETSERVER_T },
|
|
770
|
-
"http2.serverOnStream": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
|
|
771
|
-
"http2.serverOnSession": { argTypes: [NETSERVER_T, null, BOOL], result: VOID },
|
|
772
|
-
// connect(authority, reject, ca[, cb]): the TLS client knobs an https
|
|
773
|
-
// authority reads (inert on http ones, exactly Node); ca is a PEM
|
|
774
|
-
// string/Buffer ("" = the system anchors).
|
|
775
|
-
"http2.connect": { argTypes: [STRING, BOOL, null], result: HTTP2SESSION_T },
|
|
776
|
-
"http2.connectCb": { argTypes: [STRING, BOOL, null, null], result: HTTP2SESSION_T },
|
|
777
|
-
"http2.sessionRequest": { argTypes: [HTTP2SESSION_T, arrayOf(STRING), F64], result: HTTP2STREAM_T },
|
|
778
|
-
"http2.sessionClose": { argTypes: [HTTP2SESSION_T], result: VOID },
|
|
779
|
-
"http2.sessionCloseCb": { argTypes: [HTTP2SESSION_T, null], result: VOID },
|
|
780
|
-
"http2.sessionDestroy": { argTypes: [HTTP2SESSION_T], result: VOID },
|
|
781
|
-
"http2.sessionOnClose": { argTypes: [HTTP2SESSION_T, null, BOOL], result: VOID },
|
|
782
|
-
"http2.sessionOnError": { argTypes: [HTTP2SESSION_T, null, BOOL], result: VOID },
|
|
783
|
-
"http2.sessionOnConnect": { argTypes: [HTTP2SESSION_T, null, BOOL], result: VOID },
|
|
784
|
-
"http2.sessionOnStream": { argTypes: [HTTP2SESSION_T, null, BOOL], result: VOID },
|
|
785
|
-
"http2.sessionOnGoaway": { argTypes: [HTTP2SESSION_T, null, BOOL], result: VOID },
|
|
786
|
-
"http2.sessionClosed": { argTypes: [HTTP2SESSION_T], result: BOOL },
|
|
787
|
-
"http2.sessionDestroyed": { argTypes: [HTTP2SESSION_T], result: BOOL },
|
|
788
|
-
"http2.sessionEncrypted": { argTypes: [HTTP2SESSION_T], result: BOOL },
|
|
789
|
-
"http2.sessionType": { argTypes: [HTTP2SESSION_T], result: F64 },
|
|
790
|
-
"http2.sessionAlpn": { argTypes: [HTTP2SESSION_T], result: STRING },
|
|
791
|
-
"http2.sessionSocket": { argTypes: [HTTP2SESSION_T], result: NETSOCKET_T },
|
|
792
|
-
"http2.streamRespond": { argTypes: [HTTP2STREAM_T, arrayOf(STRING), BOOL], result: VOID },
|
|
793
|
-
"http2.streamWrite": { argTypes: [HTTP2STREAM_T, STRING], result: VOID },
|
|
794
|
-
"http2.streamWriteBytes": { argTypes: [HTTP2STREAM_T, BYTES_U8], result: VOID },
|
|
795
|
-
"http2.streamEnd": { argTypes: [HTTP2STREAM_T], result: VOID },
|
|
796
|
-
"http2.streamEndStr": { argTypes: [HTTP2STREAM_T, STRING], result: VOID },
|
|
797
|
-
"http2.streamEndBytes": { argTypes: [HTTP2STREAM_T, BYTES_U8], result: VOID },
|
|
798
|
-
"http2.streamClose": { argTypes: [HTTP2STREAM_T, F64], result: VOID },
|
|
799
|
-
"http2.streamCloseCb": { argTypes: [HTTP2STREAM_T, F64, null], result: VOID },
|
|
800
|
-
"http2.streamDestroy": { argTypes: [HTTP2STREAM_T], result: VOID },
|
|
801
|
-
"http2.sessionSettings0": { argTypes: [HTTP2SESSION_T], result: VOID },
|
|
802
|
-
"http2.sessionSettings": { argTypes: [HTTP2SESSION_T, DYN], result: VOID },
|
|
803
|
-
"http2.sessionSettingsDynCb": { argTypes: [HTTP2SESSION_T, DYN, DYN], result: VOID },
|
|
804
|
-
"http2.sessionSettingsCb0": { argTypes: [HTTP2SESSION_T, DYN, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
805
|
-
"http2.sessionOnSettingsDyn": { argTypes: [HTTP2SESSION_T, DYN, BOOL, BOOL], result: VOID },
|
|
806
|
-
"http2.sessionOnSettings0": { argTypes: [HTTP2SESSION_T, { kind: "func", params: [], ret: VOID }, BOOL, BOOL], result: VOID },
|
|
807
|
-
"http2.sessionSettingsGet": { argTypes: [HTTP2SESSION_T, BOOL], result: DYN },
|
|
808
|
-
"http2.sessionPendingSettingsAck": { argTypes: [HTTP2SESSION_T], result: BOOL },
|
|
809
|
-
"http2.getDefaultSettings": { argTypes: [], result: DYN },
|
|
810
|
-
"http2.streamSetEncoding": { argTypes: [HTTP2STREAM_T, STRING], result: VOID },
|
|
811
|
-
"http2.streamSetEncodingRet": { argTypes: [HTTP2STREAM_T, STRING], result: HTTP2STREAM_T },
|
|
812
|
-
"http2.streamResume": { argTypes: [HTTP2STREAM_T], result: VOID },
|
|
813
|
-
"http2.streamPause": { argTypes: [HTTP2STREAM_T], result: VOID },
|
|
814
|
-
"http2.streamOnData": { argTypes: [HTTP2STREAM_T, null, BOOL], result: VOID },
|
|
815
|
-
"http2.streamOnEnd": { argTypes: [HTTP2STREAM_T, null, BOOL], result: VOID },
|
|
816
|
-
"http2.streamOnClose": { argTypes: [HTTP2STREAM_T, null, BOOL], result: VOID },
|
|
817
|
-
"http2.streamOnAborted": { argTypes: [HTTP2STREAM_T, null, BOOL], result: VOID },
|
|
818
|
-
"http2.streamOnError": { argTypes: [HTTP2STREAM_T, null, BOOL], result: VOID },
|
|
819
|
-
"http2.streamOnResponse": { argTypes: [HTTP2STREAM_T, null, BOOL], result: VOID },
|
|
820
|
-
"http2.streamId": { argTypes: [HTTP2STREAM_T], result: F64 },
|
|
821
|
-
"http2.streamRstCode": { argTypes: [HTTP2STREAM_T], result: F64 },
|
|
822
|
-
"http2.streamDestroyed": { argTypes: [HTTP2STREAM_T], result: BOOL },
|
|
823
|
-
"http2.streamClosed": { argTypes: [HTTP2STREAM_T], result: BOOL },
|
|
824
|
-
"http2.streamAborted": { argTypes: [HTTP2STREAM_T], result: BOOL },
|
|
825
|
-
"http2.streamPending": { argTypes: [HTTP2STREAM_T], result: BOOL },
|
|
826
|
-
"http2.streamSession": { argTypes: [HTTP2STREAM_T], result: HTTP2SESSION_T },
|
|
827
|
-
// The createConnection forms: arg 0 is the dialer closure (() =>
|
|
828
|
-
// Socket — the libCall case checks), then path/method/timeout/headers/
|
|
829
|
-
// autoEnd like http.request.
|
|
830
|
-
"http.requestConn": { argTypes: [null, STRING, STRING, F64, arrayOf(STRING), BOOL], result: HTTPCLIENTREQ_T },
|
|
831
|
-
"http.requestConnCb": { argTypes: [null, STRING, STRING, F64, arrayOf(STRING), BOOL, null], result: HTTPCLIENTREQ_T },
|
|
832
|
-
"https.request": { argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, BOOL, null], result: HTTPCLIENTREQ_T },
|
|
833
|
-
"https.requestCb": { argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, BOOL, null, null], result: HTTPCLIENTREQ_T },
|
|
834
|
-
"https.requestUrl": { argTypes: [STRING, STRING, BOOL], result: HTTPCLIENTREQ_T },
|
|
835
|
-
"https.requestUrlCb": { argTypes: [STRING, STRING, BOOL, null], result: HTTPCLIENTREQ_T },
|
|
836
|
-
"https.requestAgent": { argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, BOOL, null, DYN], result: HTTPCLIENTREQ_T },
|
|
837
|
-
"https.requestAgentCb": { argTypes: [STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, BOOL, null, DYN, null], result: HTTPCLIENTREQ_T },
|
|
838
|
-
// The requestFn binding's runtime-secure rows: https.request's shape
|
|
839
|
-
// with the leading `secure` bool.
|
|
840
|
-
"https.requestFn": { argTypes: [BOOL, STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, BOOL, null], result: HTTPCLIENTREQ_T },
|
|
841
|
-
"https.requestFnCb": { argTypes: [BOOL, STRING, F64, STRING, STRING, F64, arrayOf(STRING), BOOL, BOOL, null, null], result: HTTPCLIENTREQ_T },
|
|
842
|
-
"http.clientWrite": { argTypes: [HTTPCLIENTREQ_T, STRING], result: VOID },
|
|
843
|
-
"http.clientSetHeader": { argTypes: [HTTPCLIENTREQ_T, STRING, STRING], result: VOID },
|
|
844
|
-
"http.clientGetHeader": { argTypes: [HTTPCLIENTREQ_T, STRING], result: VOID },
|
|
845
|
-
"http.clientHasHeader": { argTypes: [HTTPCLIENTREQ_T, STRING], result: BOOL },
|
|
846
|
-
"http.clientRemoveHeader": { argTypes: [HTTPCLIENTREQ_T, STRING], result: VOID },
|
|
847
|
-
"http.clientGetHeaderNames": { argTypes: [HTTPCLIENTREQ_T], result: arrayOf(STRING) },
|
|
848
|
-
"http.clientGetRawHeaderNames": { argTypes: [HTTPCLIENTREQ_T], result: arrayOf(STRING) },
|
|
849
|
-
"http.clientGetHeaders": { argTypes: [HTTPCLIENTREQ_T], result: DYN },
|
|
850
|
-
"http.clientWriteBytes": { argTypes: [HTTPCLIENTREQ_T, BYTES_U8], result: VOID },
|
|
851
|
-
"http.clientEnd": { argTypes: [HTTPCLIENTREQ_T], result: VOID },
|
|
852
|
-
"http.clientEndStr": { argTypes: [HTTPCLIENTREQ_T, STRING], result: VOID },
|
|
853
|
-
"http.clientEndBytes": { argTypes: [HTTPCLIENTREQ_T, BYTES_U8], result: VOID },
|
|
854
|
-
"http.clientWriteDyn": { argTypes: [HTTPCLIENTREQ_T, DYN], result: VOID },
|
|
855
|
-
"http.clientEndDyn": { argTypes: [HTTPCLIENTREQ_T, DYN], result: VOID },
|
|
856
|
-
"http.clientFlushHeaders": { argTypes: [HTTPCLIENTREQ_T], result: VOID },
|
|
857
|
-
"http.clientAddTrailers": { argTypes: [HTTPCLIENTREQ_T, arrayOf(STRING)], result: VOID },
|
|
858
|
-
"http.clientCork": { argTypes: [HTTPCLIENTREQ_T], result: VOID },
|
|
859
|
-
"http.clientUncork": { argTypes: [HTTPCLIENTREQ_T], result: VOID },
|
|
860
|
-
"http.clientWritableCorked": { argTypes: [HTTPCLIENTREQ_T], result: F64 },
|
|
861
|
-
"http.clientMethod": { argTypes: [HTTPCLIENTREQ_T], result: STRING },
|
|
862
|
-
"http.clientPath": { argTypes: [HTTPCLIENTREQ_T], result: STRING },
|
|
863
|
-
"http.clientHost": { argTypes: [HTTPCLIENTREQ_T], result: STRING },
|
|
864
|
-
"http.clientProtocol": { argTypes: [HTTPCLIENTREQ_T], result: STRING },
|
|
865
|
-
"http.clientHeadersSent": { argTypes: [HTTPCLIENTREQ_T], result: BOOL },
|
|
866
|
-
"http.clientWritableEnded": { argTypes: [HTTPCLIENTREQ_T], result: BOOL },
|
|
867
|
-
"http.clientWritableFinished": { argTypes: [HTTPCLIENTREQ_T], result: BOOL },
|
|
868
|
-
"http.clientSocket": { argTypes: [HTTPCLIENTREQ_T], result: NETSOCKET_T },
|
|
869
|
-
"http.clientReusedSocket": { argTypes: [HTTPCLIENTREQ_T], result: BOOL },
|
|
870
|
-
"http.clientSetNoDelay": { argTypes: [HTTPCLIENTREQ_T, BOOL], result: VOID },
|
|
871
|
-
"http.clientSetSocketKeepAlive": { argTypes: [HTTPCLIENTREQ_T, BOOL, F64], result: VOID },
|
|
872
|
-
"http.clientSetTimeout": { argTypes: [HTTPCLIENTREQ_T, F64], result: VOID },
|
|
873
|
-
"http.clientSetTimeoutCb": { argTypes: [HTTPCLIENTREQ_T, F64, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
874
|
-
"http.statusCodes": { argTypes: [], result: DYN },
|
|
875
|
-
"http.methods": { argTypes: [], result: arrayOf(STRING) },
|
|
876
|
-
"http.reqSetTimeout": { argTypes: [HTTPREQ_T, F64], result: VOID },
|
|
877
|
-
"http.reqSetTimeoutCb": { argTypes: [HTTPREQ_T, F64, { kind: "func", params: [], ret: VOID }], result: VOID },
|
|
878
|
-
"http.clientDestroy": { argTypes: [HTTPCLIENTREQ_T], result: VOID },
|
|
879
|
-
"http.clientAbort": { argTypes: [HTTPCLIENTREQ_T], result: VOID },
|
|
880
|
-
"http.clientAborted": { argTypes: [HTTPCLIENTREQ_T], result: BOOL },
|
|
881
|
-
"http.clientDestroyed": { argTypes: [HTTPCLIENTREQ_T], result: BOOL },
|
|
882
|
-
"http.clientOnResponse": { argTypes: [HTTPCLIENTREQ_T, null, BOOL], result: VOID },
|
|
883
|
-
"http.clientOnSocket": { argTypes: [HTTPCLIENTREQ_T, null, BOOL], result: VOID },
|
|
884
|
-
"http.clientOnFinish": { argTypes: [HTTPCLIENTREQ_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
885
|
-
"http.clientOnError": { argTypes: [HTTPCLIENTREQ_T, null, BOOL], result: VOID },
|
|
886
|
-
"http.clientOnTimeout": { argTypes: [HTTPCLIENTREQ_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
887
|
-
"http.clientOnClose": { argTypes: [HTTPCLIENTREQ_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
888
|
-
"http.clientOnAbort": { argTypes: [HTTPCLIENTREQ_T, { kind: "func", params: [], ret: VOID }, BOOL], result: VOID },
|
|
889
|
-
"cp.execSync": {
|
|
890
|
-
argTypes: [STRING, arrayOf(STRING), BOOL, STRING, BOOL, STRING, BOOL, arrayOf(STRING), F64, F64, F64],
|
|
891
|
-
result: STRING,
|
|
892
|
-
},
|
|
893
|
-
"cp.execCapture": {
|
|
894
|
-
argTypes: [STRING, arrayOf(STRING), STRING, BOOL, arrayOf(STRING), F64],
|
|
895
|
-
result: SPAWNRES_T,
|
|
896
|
-
},
|
|
897
|
-
"cp.spawn": { argTypes: [STRING, arrayOf(STRING)], result: CHILD_T },
|
|
898
|
-
"process.forkTarget": { argTypes: [F64], result: F64 },
|
|
899
|
-
"cp.fork": {
|
|
900
|
-
argTypes: [F64, arrayOf(STRING), F64, F64, F64, BOOL, arrayOf(STRING), STRING],
|
|
901
|
-
result: CHILD_T,
|
|
902
|
-
},
|
|
903
|
-
"child.connected": { argTypes: [CHILD_T], result: BOOL },
|
|
904
|
-
"child.send": { argTypes: [CHILD_T, STRING], result: BOOL },
|
|
905
|
-
"child.sendCb": { argTypes: [CHILD_T, STRING, null], result: BOOL },
|
|
906
|
-
"child.disconnect": { argTypes: [CHILD_T], result: VOID },
|
|
907
|
-
"child.onMessage": { argTypes: [CHILD_T, null, BOOL], result: VOID },
|
|
908
|
-
"child.onDisconnect": { argTypes: [CHILD_T, null, BOOL], result: VOID },
|
|
909
|
-
"child.onSpawn": { argTypes: [CHILD_T, null], result: VOID },
|
|
910
|
-
"child.onDyn": { argTypes: [CHILD_T, STRING, DYN], result: VOID },
|
|
911
|
-
"process.connected": { argTypes: [], result: BOOL },
|
|
912
|
-
"process.send": { argTypes: [STRING], result: BOOL },
|
|
913
|
-
"process.sendCb": { argTypes: [STRING, null], result: BOOL },
|
|
914
|
-
"process.disconnect": { argTypes: [], result: VOID },
|
|
915
|
-
"process.onMessage": { argTypes: [null, BOOL], result: VOID },
|
|
916
|
-
"process.onDisconnect": { argTypes: [null, BOOL], result: VOID },
|
|
917
|
-
"cp.execFile": { argTypes: [STRING, arrayOf(STRING), null], result: CHILD_T },
|
|
918
|
-
// spawn's options form: per-slot stdio modes (0 ignore / 1 inherit /
|
|
919
|
-
// 2 fd) with the out/err fds for mode 2, detached, env replacement
|
|
920
|
-
// pairs, cwd ("" = inherit).
|
|
921
|
-
"cp.spawnOpts": {
|
|
922
|
-
argTypes: [STRING, arrayOf(STRING), F64, F64, F64, F64, F64, BOOL, BOOL, BOOL, arrayOf(STRING), STRING],
|
|
923
|
-
result: CHILD_T,
|
|
924
|
-
},
|
|
925
|
-
"cp.spawnDynamic": { argTypes: [STRING, arrayOf(STRING), DYN], result: CHILD_T },
|
|
926
|
-
// The callback's func type is program-dependent (zero params, or the
|
|
927
|
-
// `number | null` union / the %Error class) — the libCall case checks
|
|
928
|
-
// the shape; the slot here only pins arity and the child receiver.
|
|
929
|
-
"child.onExit": { argTypes: [CHILD_T, null], result: VOID },
|
|
930
|
-
"child.onClose": { argTypes: [CHILD_T, null], result: VOID },
|
|
931
|
-
"child.onError": { argTypes: [CHILD_T, null], result: VOID },
|
|
932
|
-
// Like process.envGet, spawnRes.status's result type is program-dependent
|
|
933
|
-
// (the interned `number | null` union) — the libCall case checks the arms.
|
|
934
|
-
"spawnRes.status": { argTypes: [SPAWNRES_T], result: VOID },
|
|
935
|
-
// spawnRes.error's result is the interned `Error | undefined` union —
|
|
936
|
-
// the libCall case checks the arms, the spawnRes.status pattern.
|
|
937
|
-
"spawnRes.error": { argTypes: [SPAWNRES_T], result: VOID },
|
|
938
|
-
// spawnRes.signal's result is the interned `string | null` union —
|
|
939
|
-
// same pattern.
|
|
940
|
-
"spawnRes.signal": { argTypes: [SPAWNRES_T], result: VOID },
|
|
941
|
-
// The ChildProcess lifecycle members: pid/exitCode are program-dependent
|
|
942
|
-
// unions (`number | undefined` / `number | null` — the libCall case
|
|
943
|
-
// checks the arms, the spawnRes.status pattern).
|
|
944
|
-
"child.pid": { argTypes: [CHILD_T], result: VOID },
|
|
945
|
-
"child.exitCode": { argTypes: [CHILD_T], result: VOID },
|
|
946
|
-
// The close-override pair: the bound close's result func type and the
|
|
947
|
-
// override's func argument are program-dependent (the callback union's
|
|
948
|
-
// tags) — the slots pin the server receiver; the libCall case checks
|
|
949
|
-
// the bound value's shape.
|
|
950
|
-
"net.serverCloseBind": { argTypes: [NETSERVER_T], result: VOID },
|
|
951
|
-
"net.serverSetCloseOverride": { argTypes: [NETSERVER_T, null], result: VOID },
|
|
952
|
-
// The piped-output stream reads: `Readable | null` unions (the libCall
|
|
953
|
-
// case checks the arms — the child.pid pattern with a ref arm).
|
|
954
|
-
"child.stdout": { argTypes: [CHILD_T], result: VOID },
|
|
955
|
-
"child.stderr": { argTypes: [CHILD_T], result: VOID },
|
|
956
|
-
"child.stdin": { argTypes: [CHILD_T], result: VOID },
|
|
957
|
-
// Listener registrations: callback func shapes are program-dependent
|
|
958
|
-
// (zero-param / Buffer / Buffer-armed union) — the slots pin arity,
|
|
959
|
-
// the stream receiver, and the once-flag.
|
|
960
|
-
"stream.onData": { argTypes: [CHILDSTREAM_T, null, BOOL], result: VOID },
|
|
961
|
-
"stream.onDataStr": { argTypes: [CHILDSTREAM_T, null, BOOL], result: VOID },
|
|
962
|
-
"stream.onEnd": { argTypes: [CHILDSTREAM_T, null, BOOL], result: VOID },
|
|
963
|
-
"stream.childSetEncoding": { argTypes: [CHILDSTREAM_T, STRING], result: CHILDSTREAM_T },
|
|
964
|
-
"writer.writeString": { argTypes: [CHILDWRITER_T, STRING], result: BOOL },
|
|
965
|
-
"writer.writeBytes": { argTypes: [CHILDWRITER_T, BYTES_U8], result: BOOL },
|
|
966
|
-
"writer.end": { argTypes: [CHILDWRITER_T], result: VOID },
|
|
967
|
-
"writer.destroy": { argTypes: [CHILDWRITER_T], result: VOID },
|
|
968
|
-
"writer.writable": { argTypes: [CHILDWRITER_T], result: BOOL },
|
|
969
|
-
"writer.onDrain": { argTypes: [CHILDWRITER_T, null, BOOL], result: VOID },
|
|
970
|
-
"writer.onFinish": { argTypes: [CHILDWRITER_T, null, BOOL], result: VOID },
|
|
971
|
-
"writer.onError": { argTypes: [CHILDWRITER_T, null, BOOL], result: VOID },
|
|
972
|
-
"procStream.write": { argTypes: [PROCSTREAM_T, STRING], result: BOOL },
|
|
973
|
-
"child.killed": { argTypes: [CHILD_T], result: BOOL },
|
|
974
|
-
"child.kill": { argTypes: [CHILD_T, STRING], result: BOOL },
|
|
975
|
-
"child.killNum": { argTypes: [CHILD_T, F64], result: BOOL },
|
|
976
|
-
"child.unref": { argTypes: [CHILD_T], result: VOID },
|
|
977
|
-
"child.ref": { argTypes: [CHILD_T], result: VOID },
|
|
978
|
-
"spawnRes.stdout": { argTypes: [SPAWNRES_T], result: STRING },
|
|
979
|
-
"spawnRes.stderr": { argTypes: [SPAWNRES_T], result: STRING },
|
|
980
|
-
"crypto.randomUUID": { argTypes: [], result: STRING },
|
|
981
|
-
"crypto.randomBytesToString": { argTypes: [F64, STRING], result: STRING },
|
|
982
|
-
"crypto.randomBytes": { argTypes: [F64], result: BYTES_U8 },
|
|
983
|
-
"crypto.hashDigestStr": { argTypes: [STRING, STRING, STRING], result: STRING },
|
|
984
|
-
"crypto.hashDigestBytes": { argTypes: [STRING, BYTES_U8, STRING], result: STRING },
|
|
985
|
-
"crypto.native": { argTypes: [], result: DYN },
|
|
986
|
-
"crypto.hashNew": { argTypes: [STRING], result: CRYPTOHASH_T },
|
|
987
|
-
"crypto.hmacNewStr": { argTypes: [STRING, STRING], result: CRYPTOHMAC_T },
|
|
988
|
-
"crypto.hmacNewBytes": { argTypes: [STRING, BYTES_U8], result: CRYPTOHMAC_T },
|
|
989
|
-
"crypto.hashUpdateStr": { argTypes: [CRYPTOHASH_T, STRING], result: CRYPTOHASH_T },
|
|
990
|
-
"crypto.hashUpdateBytes": { argTypes: [CRYPTOHASH_T, BYTES_U8], result: CRYPTOHASH_T },
|
|
991
|
-
"crypto.hmacUpdateStr": { argTypes: [CRYPTOHMAC_T, STRING], result: CRYPTOHMAC_T },
|
|
992
|
-
"crypto.hmacUpdateBytes": { argTypes: [CRYPTOHMAC_T, BYTES_U8], result: CRYPTOHMAC_T },
|
|
993
|
-
"crypto.hashCopy": { argTypes: [CRYPTOHASH_T], result: CRYPTOHASH_T },
|
|
994
|
-
"crypto.hashDigestString": { argTypes: [CRYPTOHASH_T, STRING], result: STRING },
|
|
995
|
-
"crypto.hashDigestBuffer": { argTypes: [CRYPTOHASH_T], result: BYTES_U8 },
|
|
996
|
-
"crypto.hmacDigestString": { argTypes: [CRYPTOHMAC_T, STRING], result: STRING },
|
|
997
|
-
"crypto.hmacDigestBuffer": { argTypes: [CRYPTOHMAC_T], result: BYTES_U8 },
|
|
998
|
-
"crypto.timingSafeEqual": { argTypes: [BYTES_U8, BYTES_U8], result: BOOL },
|
|
999
|
-
"crypto.randomFill": { argTypes: [BYTES_U8, F64, F64], result: BYTES_U8 },
|
|
1000
|
-
"crypto.randomFillRest": { argTypes: [BYTES_U8, F64], result: BYTES_U8 },
|
|
1001
|
-
"crypto.randomInt": { argTypes: [F64, F64], result: F64 },
|
|
1002
|
-
"crypto.pbkdf2": { argTypes: [BYTES_U8, BYTES_U8, F64, F64, STRING], result: BYTES_U8 },
|
|
1003
|
-
"crypto.randomBytesCb": { argTypes: [F64, null], result: VOID },
|
|
1004
|
-
"crypto.pbkdf2Cb": { argTypes: [BYTES_U8, BYTES_U8, F64, F64, STRING, null], result: VOID },
|
|
1005
|
-
"crypto.hkdf": { argTypes: [STRING, BYTES_U8, BYTES_U8, BYTES_U8, F64], result: DYN },
|
|
1006
|
-
"crypto.hkdfCb": { argTypes: [STRING, BYTES_U8, BYTES_U8, BYTES_U8, F64, null], result: VOID },
|
|
1007
|
-
"crypto.scrypt": { argTypes: [BYTES_U8, BYTES_U8, F64, DYN], result: BYTES_U8 },
|
|
1008
|
-
"crypto.scryptCb": { argTypes: [BYTES_U8, BYTES_U8, F64, DYN, null], result: VOID },
|
|
1009
|
-
// The Buffer statics and the fs/zlib Buffer forms: fixed always-u8
|
|
1010
|
-
// signatures (Buffer IS a Uint8Array — one bytes kind).
|
|
1011
|
-
"buffer.fromStr": { argTypes: [STRING, STRING], result: BYTES_U8 },
|
|
1012
|
-
"buffer.brand": { argTypes: [BYTES_U8], result: BYTES_U8 },
|
|
1013
|
-
"buffer.fromDyn": { argTypes: [DYN, STRING], result: BYTES_U8 },
|
|
1014
|
-
"buffer.concat": { argTypes: [arrayOf(BYTES_U8)], result: BYTES_U8 },
|
|
1015
|
-
"buffer.byteLenDyn": { argTypes: [DYN, STRING], result: F64 },
|
|
1016
|
-
"buffer.byteLenStr": { argTypes: [STRING, STRING], result: F64 },
|
|
1017
|
-
"buffer.isEncoding": { argTypes: [STRING], result: BOOL },
|
|
1018
|
-
"buffer.concatLen": { argTypes: [arrayOf(BYTES_U8), F64], result: BYTES_U8 },
|
|
1019
|
-
// The checked-dynamic compare/equals validators (Node's argument
|
|
1020
|
-
// ladders over dyn-boxed invalid-input probes).
|
|
1021
|
-
"buffer.compareChk": { argTypes: [DYN, DYN], result: F64 },
|
|
1022
|
-
"bytes.equalsChk": { argTypes: [BYTES_U8, DYN], result: BOOL },
|
|
1023
|
-
"bytes.compareChk": { argTypes: [BYTES_U8, DYN, DYN, DYN, DYN, DYN], result: F64 },
|
|
1024
|
-
"buffer.newStringFail": { argTypes: [DYN], result: BYTES_U8 },
|
|
1025
|
-
"fs.toUnixTimestamp": { argTypes: [DYN], result: F64 },
|
|
1026
|
-
"fs.existsChk": { argTypes: [DYN, DYN], result: DYN },
|
|
1027
|
-
"fs.mkdtempChk": { argTypes: [DYN, DYN, STRING], result: VOID },
|
|
1028
|
-
"fs.mkdtempSyncChk": { argTypes: [DYN, DYN, STRING], result: STRING },
|
|
1029
|
-
"fs.readFileChk": { argTypes: [DYN, DYN, DYN, STRING], result: VOID },
|
|
1030
|
-
"fs.opendirChk": { argTypes: [DYN, DYN, STRING], result: VOID },
|
|
1031
|
-
"fs.watchFileChk": { argTypes: [DYN, DYN, STRING], result: VOID },
|
|
1032
|
-
"fs.lchmodChk": { argTypes: [DYN, DYN, DYN, STRING], result: VOID },
|
|
1033
|
-
"fs.lchmodSyncChk": { argTypes: [DYN, DYN], result: DYN },
|
|
1034
|
-
"fsp.lchmodChk": { argTypes: [DYN, DYN], result: { kind: "promise", inner: VOID } },
|
|
1035
|
-
"fs.readChk": { argTypes: [DYN, DYN, DYN, DYN, DYN, STRING], result: VOID },
|
|
1036
|
-
"fs.streamOptsChk": { argTypes: [DYN, DYN, STRING], result: VOID },
|
|
1037
|
-
"error.argTypeThrow": { argTypes: [STRING, STRING, DYN], result: VOID },
|
|
1038
|
-
"error.propTypeThrow": { argTypes: [STRING, STRING, DYN], result: VOID },
|
|
1039
|
-
"emitter.setMaxChk": { argTypes: [null, DYN], result: VOID },
|
|
1040
|
-
"emitter.setDefaultMaxChk": { argTypes: [DYN, STRING], result: VOID },
|
|
1041
|
-
"fs.readFileSyncBytes": { argTypes: [STRING], result: BYTES_U8 },
|
|
1042
|
-
"fs.writeFileSyncBytes": { argTypes: [STRING, BYTES_U8], result: VOID },
|
|
1043
|
-
"fs.appendFileSyncBytes": { argTypes: [STRING, BYTES_U8], result: VOID },
|
|
1044
|
-
"fsp.readFileBytes": { argTypes: [STRING], result: { kind: "promise", inner: BYTES_U8 } },
|
|
1045
|
-
"zlib.deflateSync": { argTypes: [BYTES_U8], result: BYTES_U8 },
|
|
1046
|
-
"zlib.inflateSync": { argTypes: [BYTES_U8], result: BYTES_U8 },
|
|
1047
|
-
"zlib.deflateRawSync": { argTypes: [BYTES_U8], result: BYTES_U8 },
|
|
1048
|
-
"zlib.deflateLevelSync": { argTypes: [BYTES_U8, F64, F64], result: BYTES_U8 },
|
|
1049
|
-
"zlib.inflateRawSync": { argTypes: [BYTES_U8], result: BYTES_U8 },
|
|
1050
|
-
"zlib.gzipSync": { argTypes: [BYTES_U8], result: BYTES_U8 },
|
|
1051
|
-
"zlib.gunzipSync": { argTypes: [BYTES_U8], result: BYTES_U8 },
|
|
1052
|
-
"zlib.unzipSync": { argTypes: [BYTES_U8], result: BYTES_U8 },
|
|
1053
|
-
"zlib.deflateCb": { argTypes: [BYTES_U8, null], result: VOID },
|
|
1054
|
-
"zlib.inflateCb": { argTypes: [BYTES_U8, null], result: VOID },
|
|
1055
|
-
"zlib.deflateRawCb": { argTypes: [BYTES_U8, null], result: VOID },
|
|
1056
|
-
"zlib.inflateRawCb": { argTypes: [BYTES_U8, null], result: VOID },
|
|
1057
|
-
"zlib.gzipCb": { argTypes: [BYTES_U8, null], result: VOID },
|
|
1058
|
-
"zlib.gunzipCb": { argTypes: [BYTES_U8, null], result: VOID },
|
|
1059
|
-
"zlib.unzipCb": { argTypes: [BYTES_U8, null], result: VOID },
|
|
1060
|
-
"zlib.crc32": { argTypes: [BYTES_U8, F64], result: F64 },
|
|
1061
|
-
"process.stdoutWriteBytes": { argTypes: [BYTES_U8, STRING], result: BOOL },
|
|
1062
|
-
"process.stderrWriteBytes": { argTypes: [BYTES_U8, STRING], result: BOOL },
|
|
1063
|
-
// Completion callback is program-dependent: zero params, checked-dynamic,
|
|
1064
|
-
// or an optional Error | null slot (same success shape as fs.rename).
|
|
1065
|
-
"process.stdoutWriteBytesCb": { argTypes: [BYTES_U8, STRING, null], result: BOOL },
|
|
1066
|
-
"process.stderrWriteBytesCb": { argTypes: [BYTES_U8, STRING, null], result: BOOL },
|
|
1067
|
-
"fsp.readFile": { argTypes: [STRING, STRING], result: { kind: "promise", inner: STRING } },
|
|
1068
|
-
"fsp.writeFile": { argTypes: [STRING, STRING], result: { kind: "promise", inner: VOID } },
|
|
1069
|
-
"fsp.writeFileMode": { argTypes: [STRING, STRING, F64], result: { kind: "promise", inner: VOID } },
|
|
1070
|
-
"fsp.mkdir": { argTypes: [STRING], result: { kind: "promise", inner: VOID } },
|
|
1071
|
-
"fsp.mkdirMode": { argTypes: [STRING, F64], result: { kind: "promise", inner: VOID } },
|
|
1072
|
-
"fsp.mkdirRecursive": { argTypes: [STRING], result: { kind: "promise", inner: VOID } },
|
|
1073
|
-
"fsp.mkdirRecursiveMode": { argTypes: [STRING, F64], result: { kind: "promise", inner: VOID } },
|
|
1074
|
-
"fsp.unlink": { argTypes: [STRING], result: { kind: "promise", inner: VOID } },
|
|
1075
|
-
"fsp.chmod": { argTypes: [STRING, F64], result: { kind: "promise", inner: VOID } },
|
|
1076
|
-
"fsp.link": { argTypes: [DYN, DYN], result: { kind: "promise", inner: VOID } },
|
|
1077
|
-
"fsp.symlink": { argTypes: [DYN, DYN, DYN], result: { kind: "promise", inner: VOID } },
|
|
1078
|
-
"fsp.readlink": { argTypes: [DYN, DYN], result: { kind: "promise", inner: DYN } },
|
|
1079
|
-
"fsp.statfs": { argTypes: [DYN, DYN], result: { kind: "promise", inner: DYN } },
|
|
1080
|
-
"fsp.readlinkStr": { argTypes: [DYN, DYN], result: { kind: "promise", inner: STRING } },
|
|
1081
|
-
"fsp.readlinkBuffer": { argTypes: [DYN, DYN], result: { kind: "promise", inner: BYTES_U8 } },
|
|
1082
|
-
"fsp.utimes": { argTypes: [DYN, DYN, DYN], result: { kind: "promise", inner: VOID } },
|
|
1083
|
-
"fsp.lutimes": { argTypes: [DYN, DYN, DYN], result: { kind: "promise", inner: VOID } },
|
|
1084
|
-
"fsp.rename": { argTypes: [STRING, STRING], result: { kind: "promise", inner: VOID } },
|
|
1085
|
-
"fsp.readdir": { argTypes: [STRING], result: { kind: "promise", inner: arrayOf(STRING) } },
|
|
1086
|
-
// Result is promise<call-site Dirent record array>; the libCall case
|
|
1087
|
-
// validates the program-dependent record shape below.
|
|
1088
|
-
"fsp.readdirTypes": { argTypes: [STRING], result: { kind: "promise", inner: VOID } },
|
|
1089
|
-
"fsp.rm": { argTypes: [STRING], result: { kind: "promise", inner: VOID } },
|
|
1090
|
-
"fsp.stat": { argTypes: [STRING], result: { kind: "promise", inner: STATS_T } },
|
|
1091
|
-
"fsp.realpath": { argTypes: [STRING], result: { kind: "promise", inner: STRING } },
|
|
1092
|
-
"fsp.lstat": { argTypes: [STRING], result: { kind: "promise", inner: STATS_T } },
|
|
1093
|
-
"fsp.open": { argTypes: [STRING, STRING, F64], result: { kind: "promise", inner: FILEHANDLE_T } },
|
|
1094
|
-
"fileHandle.fd": { argTypes: [FILEHANDLE_T], result: F64 },
|
|
1095
|
-
"fileHandle.close": { argTypes: [FILEHANDLE_T], result: { kind: "promise", inner: VOID } },
|
|
1096
|
-
"fileHandle.sync": { argTypes: [FILEHANDLE_T], result: { kind: "promise", inner: VOID } },
|
|
1097
|
-
"fileHandle.datasync": { argTypes: [FILEHANDLE_T], result: { kind: "promise", inner: VOID } },
|
|
1098
|
-
"fileHandle.truncate": { argTypes: [FILEHANDLE_T, F64], result: { kind: "promise", inner: VOID } },
|
|
1099
|
-
"fileHandle.chmod": { argTypes: [FILEHANDLE_T, F64], result: { kind: "promise", inner: VOID } },
|
|
1100
|
-
"fileHandle.utimes": { argTypes: [FILEHANDLE_T, DYN, DYN], result: { kind: "promise", inner: VOID } },
|
|
1101
|
-
"fileHandle.readv": { argTypes: [FILEHANDLE_T, arrayOf(BYTES_U8), F64], result: { kind: "promise", inner: VOID } },
|
|
1102
|
-
"fileHandle.writev": { argTypes: [FILEHANDLE_T, arrayOf(BYTES_U8), F64], result: { kind: "promise", inner: VOID } },
|
|
1103
|
-
// read/write carry call-site result record shapes; the validator checks
|
|
1104
|
-
// those below, so promise<void> is only a table sentinel.
|
|
1105
|
-
"fileHandle.read": { argTypes: [FILEHANDLE_T, BYTES_U8, F64, F64, F64, BOOL], result: { kind: "promise", inner: VOID } },
|
|
1106
|
-
"fileHandle.writeBytes": { argTypes: [FILEHANDLE_T, BYTES_U8, F64, F64, F64, BOOL], result: { kind: "promise", inner: VOID } },
|
|
1107
|
-
"fileHandle.writeStr": { argTypes: [FILEHANDLE_T, STRING, F64, STRING], result: { kind: "promise", inner: VOID } },
|
|
1108
|
-
"fileHandle.readFile": { argTypes: [FILEHANDLE_T, STRING], result: { kind: "promise", inner: STRING } },
|
|
1109
|
-
"fileHandle.readFileBytes": { argTypes: [FILEHANDLE_T, STRING], result: { kind: "promise", inner: BYTES_U8 } },
|
|
1110
|
-
"fileHandle.writeFile": { argTypes: [FILEHANDLE_T, STRING, STRING], result: { kind: "promise", inner: VOID } },
|
|
1111
|
-
"fileHandle.writeFileBytes": { argTypes: [FILEHANDLE_T, BYTES_U8, STRING], result: { kind: "promise", inner: VOID } },
|
|
1112
|
-
"fileHandle.stat": { argTypes: [FILEHANDLE_T], result: { kind: "promise", inner: STATS_T } },
|
|
1113
|
-
"process.argv": { argTypes: [], result: arrayOf(STRING) },
|
|
1114
|
-
"process.platform": { argTypes: [], result: STRING },
|
|
1115
|
-
// The one libCall whose result type is program-dependent (union ids are
|
|
1116
|
-
// per-module): the `result` here is a placeholder — the libCall case
|
|
1117
|
-
// checks the union's ARMS ([string, undefinedT] in canonical order)
|
|
1118
|
-
// against the module's registry instead.
|
|
1119
|
-
"process.envGet": { argTypes: [STRING], result: VOID },
|
|
1120
|
-
"process.envSet": { argTypes: [STRING, STRING], result: VOID },
|
|
1121
|
-
"process.envUnset": { argTypes: [STRING], result: VOID },
|
|
1122
|
-
"process.envPairs": { argTypes: [], result: arrayOf(STRING) },
|
|
1123
|
-
"process.exit": { argTypes: [F64], result: VOID },
|
|
1124
|
-
"process.setExitCode": { argTypes: [F64], result: VOID },
|
|
1125
|
-
"process.currentExitCode": { argTypes: [], result: F64 },
|
|
1126
|
-
"process.cwd": { argTypes: [], result: STRING },
|
|
1127
|
-
"process.pid": { argTypes: [], result: F64 },
|
|
1128
|
-
"dyn.this": { argTypes: [], result: DYN },
|
|
1129
|
-
"dyn.generatorThis": { argTypes: [], result: DYN },
|
|
1130
|
-
"process.getuid": { argTypes: [], result: F64 },
|
|
1131
|
-
"process.getgid": { argTypes: [], result: F64 },
|
|
1132
|
-
"process.execPath": { argTypes: [], result: STRING },
|
|
1133
|
-
"process.arch": { argTypes: [], result: STRING },
|
|
1134
|
-
"process.versions": { argTypes: [], result: DYN },
|
|
1135
|
-
"process.builtinId": { argTypes: [DYN, arrayOf(STRING)], result: STRING },
|
|
1136
|
-
"process.builtinModule": { argTypes: [STRING, DYN], result: DYN },
|
|
1137
|
-
"process.builtinUnsupported": { argTypes: [STRING, STRING], result: DYN },
|
|
1138
|
-
"fs.callbackValue": { argTypes: [STRING], result: DYN },
|
|
1139
|
-
"fs.callbackCall": { argTypes: [STRING, DYN], result: DYN },
|
|
1140
|
-
"process.hrtimeValue": { argTypes: [], result: DYN },
|
|
1141
|
-
"process.versionsNode": { argTypes: [], result: STRING },
|
|
1142
|
-
"process.versionsOpenssl": { argTypes: [], result: STRING },
|
|
1143
|
-
"process.kill": { argTypes: [F64, STRING], result: BOOL },
|
|
1144
|
-
"process.killNum": { argTypes: [F64, F64], result: BOOL },
|
|
1145
|
-
"process.stdoutWrite": { argTypes: [STRING], result: BOOL },
|
|
1146
|
-
"process.stdio": { argTypes: [F64], result: DYN },
|
|
1147
|
-
"process.stderrWrite": { argTypes: [STRING], result: BOOL },
|
|
1148
|
-
// error.new's result and the receiver slots are builtin-error classes —
|
|
1149
|
-
// program-dependent object types, checked in the libCall case.
|
|
1150
|
-
"error.new": { argTypes: [STRING], result: VOID },
|
|
1151
|
-
"error.newOptions": { argTypes: [DYN, DYN], result: VOID },
|
|
1152
|
-
"error.ctorOptions": { argTypes: [null, DYN, DYN], result: VOID },
|
|
1153
|
-
"error.cause": { argTypes: [null], result: DYN },
|
|
1154
|
-
"error.hasCause": { argTypes: [null], result: BOOL },
|
|
1155
|
-
"error.setCause": { argTypes: [null, DYN], result: VOID },
|
|
1156
|
-
"error.defineCause": { argTypes: [null, DYN], result: VOID },
|
|
1157
|
-
"error.deleteCause": { argTypes: [null], result: VOID },
|
|
1158
|
-
"error.nodeThrow": { argTypes: [F64, STRING, STRING], result: VOID },
|
|
1159
|
-
"dyn.toStringCoerce": { argTypes: [DYN], result: STRING },
|
|
1160
|
-
"dyn.stringConstructor": { argTypes: [DYN], result: STRING },
|
|
1161
|
-
"dyn.propertyKey": { argTypes: [DYN], result: DYN },
|
|
1162
|
-
"dyn.toNumeric": { argTypes: [DYN], result: DYN },
|
|
1163
|
-
"dyn.increment": { argTypes: [DYN, BOOL], result: DYN },
|
|
1164
|
-
"dyn.numberConstructor": { argTypes: [DYN], result: F64 },
|
|
1165
|
-
"dyn.bigintConstructor": { argTypes: [DYN], result: BIGINT_T },
|
|
1166
|
-
"dyn.toNumberCoerce": { argTypes: [DYN], result: F64 },
|
|
1167
|
-
"dyn.add": { argTypes: [DYN, DYN], result: DYN },
|
|
1168
|
-
"dyn.arithmetic": { argTypes: [DYN, DYN, STRING], result: DYN },
|
|
1169
|
-
"dyn.compare": { argTypes: [DYN, DYN, STRING], result: BOOL },
|
|
1170
|
-
"dyn.bitwise": { argTypes: [DYN, DYN, STRING], result: DYN },
|
|
1171
|
-
"dyn.proxyNew": { argTypes: [DYN, DYN], result: DYN },
|
|
1172
|
-
// Always throws; the result is the READ's declared type (a typed dummy
|
|
1173
|
-
// the unwind abandons) — the libCall case skips the result check.
|
|
1174
|
-
"global.undefRead": { argTypes: [STRING], result: VOID },
|
|
1175
|
-
"console.native": { argTypes: [], result: DYN },
|
|
1176
|
-
"global.native": { argTypes: [arrayOf(STRING)], result: DYN },
|
|
1177
|
-
// `X.name` through a class value: the arg is a program-dependent
|
|
1178
|
-
// classval (a null slot; the libCall case checks the kind).
|
|
1179
|
-
"class.name": { argTypes: [null], result: STRING },
|
|
1180
|
-
"error.ctor": { argTypes: [null, STRING], result: VOID },
|
|
1181
|
-
"error.toString": { argTypes: [null], result: STRING },
|
|
1182
|
-
"dyn.sameValue": { argTypes: [DYN, DYN], result: BOOL },
|
|
1183
|
-
"error.stack": { argTypes: [null], result: STRING },
|
|
1184
|
-
"error.stackLimitGet": { argTypes: [], result: F64 },
|
|
1185
|
-
"error.stackLimitSet": { argTypes: [F64], result: VOID },
|
|
1186
|
-
// Receiver (any error-hierarchy object) and the program-dependent
|
|
1187
|
-
// `string | undefined` result are checked in the libCall case.
|
|
1188
|
-
"error.code": { argTypes: [null], result: VOID },
|
|
1189
|
-
// DOMException: construction takes the two dyn args (WebIDL's
|
|
1190
|
-
// resolution runs in the runtime); the %DOMException result is a
|
|
1191
|
-
// program-dependent object type, checked in the libCall case. The
|
|
1192
|
-
// read surface takes the %DOMException receiver (a null slot — the
|
|
1193
|
-
// libCall case checks the class name).
|
|
1194
|
-
"error.newDom": { argTypes: [DYN, DYN], result: VOID },
|
|
1195
|
-
"error.domCode": { argTypes: [null], result: F64 },
|
|
1196
|
-
"error.domHasCause": { argTypes: [null], result: BOOL },
|
|
1197
|
-
"error.domCause": { argTypes: [null], result: DYN },
|
|
1198
|
-
"error.domClone": { argTypes: [null, DYN], result: VOID },
|
|
1199
|
-
"dyn.errInstanceof": { argTypes: [DYN, F64], result: BOOL },
|
|
1200
|
-
"weakMap.is": { argTypes: [DYN], result: BOOL },
|
|
1201
|
-
"weakSet.is": { argTypes: [DYN], result: BOOL },
|
|
1202
|
-
"weakMap.new": { argTypes: [DYN], result: DYN },
|
|
1203
|
-
"weakSet.new": { argTypes: [DYN], result: DYN },
|
|
1204
|
-
"dyn.fromEntries": { argTypes: [DYN], result: DYN },
|
|
1205
|
-
"bytes.constructor": { argTypes: [STRING], result: DYN },
|
|
1206
|
-
"bytes.instanceOf": { argTypes: [DYN, DYN], result: BOOL },
|
|
1207
|
-
"bytes.construct": { argTypes: [DYN, DYN, STRING], result: DYN },
|
|
1208
|
-
"dyn.dataViewIs": { argTypes: [DYN], result: BOOL },
|
|
1209
|
-
"dyn.construct": { argTypes: [DYN, DYN, STRING], result: DYN },
|
|
1210
|
-
"arrayBuffer.constructor": { argTypes: [], result: DYN },
|
|
1211
|
-
"arrayBuffer.new": { argTypes: [DYN], result: DYN },
|
|
1212
|
-
"ffi.argument": { argTypes: [DYN, STRING], result: DYN },
|
|
1213
|
-
"ffi.memoryModule": { argTypes: [DYN], result: DYN },
|
|
1214
|
-
"intl.segmenterNew": { argTypes: [], result: DYN },
|
|
1215
|
-
"arrayBuffer.is": { argTypes: [DYN], result: BOOL },
|
|
1216
|
-
"arrayBuffer.isView": { argTypes: [DYN], result: BOOL },
|
|
1217
|
-
"arrayBuffer.byteLengthGetter": { argTypes: [], result: F64 },
|
|
1218
|
-
"arrayBuffer.byteLengthDescriptor": { argTypes: [DYN], result: DYN },
|
|
1219
|
-
"arrayBuffer.viewU8C": { argTypes: [DYN, DYN, DYN], result: bytesOf("u8c") },
|
|
1220
|
-
"arrayBuffer.viewI8": { argTypes: [DYN, DYN, DYN], result: bytesOf("i8") },
|
|
1221
|
-
"arrayBuffer.viewU16": { argTypes: [DYN, DYN, DYN], result: bytesOf("u16") },
|
|
1222
|
-
"arrayBuffer.viewI16": { argTypes: [DYN, DYN, DYN], result: bytesOf("i16") },
|
|
1223
|
-
"arrayBuffer.viewU8": { argTypes: [DYN, DYN, DYN], result: BYTES_U8 },
|
|
1224
|
-
"arrayBuffer.viewU32": { argTypes: [DYN, DYN, DYN], result: bytesOf("u32") },
|
|
1225
|
-
"arrayBuffer.viewI32": { argTypes: [DYN, DYN, DYN], result: bytesOf("i32") },
|
|
1226
|
-
"arrayBuffer.viewF32": { argTypes: [DYN, DYN, DYN], result: bytesOf("f32") },
|
|
1227
|
-
"arrayBuffer.viewF64": { argTypes: [DYN, DYN, DYN], result: bytesOf("f64") },
|
|
1228
|
-
"arrayBuffer.viewDV": { argTypes: [DYN, DYN, DYN], result: BYTES_U8 },
|
|
1229
|
-
"dyn.objKeys": { argTypes: [DYN], result: DYN },
|
|
1230
|
-
"dyn.forInKeys": { argTypes: [DYN], result: DYN },
|
|
1231
|
-
"dyn.hasOwn": { argTypes: [DYN, STRING], result: BOOL },
|
|
1232
|
-
"dyn.propertyIsEnumerable": { argTypes: [DYN, STRING], result: BOOL },
|
|
1233
|
-
"dyn.assign": { argTypes: [DYN, DYN], result: DYN },
|
|
1234
|
-
"dyn.copyDataProperties": { argTypes: [DYN, DYN], result: DYN },
|
|
1235
|
-
"dyn.objectRest": { argTypes: [DYN, DYN], result: DYN },
|
|
1236
|
-
"dyn.packPush": { argTypes: [DYN, DYN], result: VOID },
|
|
1237
|
-
"dyn.packPushSpread": { argTypes: [DYN, DYN, STRING], result: VOID },
|
|
1238
|
-
"dyn.packPushSpreadIter": { argTypes: [DYN, DYN], result: VOID },
|
|
1239
|
-
"dyn.reflectApply": { argTypes: [DYN, DYN, DYN], result: DYN },
|
|
1240
|
-
"dyn.reflectGet": { argTypes: [DYN, DYN, DYN], result: DYN },
|
|
1241
|
-
"dyn.reflectSet": { argTypes: [DYN, DYN, DYN, DYN], result: BOOL },
|
|
1242
|
-
"dyn.reflectDefine": { argTypes: [DYN, DYN, DYN], result: BOOL },
|
|
1243
|
-
"dyn.abstractEq": { argTypes: [DYN, DYN], result: BOOL },
|
|
1244
|
-
"dyn.assignAll": { argTypes: [DYN, DYN], result: DYN },
|
|
1245
|
-
"dyn.objCreateNullProto": { argTypes: [], result: DYN },
|
|
1246
|
-
"dyn.arrayPrototype": { argTypes: [], result: DYN },
|
|
1247
|
-
"dyn.arrayConstructor": { argTypes: [], result: DYN },
|
|
1248
|
-
"dyn.objectPrototype": { argTypes: [], result: DYN },
|
|
1249
|
-
"dyn.functionApply": { argTypes: [], result: DYN },
|
|
1250
|
-
"dyn.builtinMethod": { argTypes: [STRING, STRING], result: DYN },
|
|
1251
|
-
"dyn.classPrototype": { argTypes: [DYN, DYN], result: DYN },
|
|
1252
|
-
"dyn.classBasePrototype": { argTypes: [DYN], result: DYN },
|
|
1253
|
-
"dyn.classInherit": { argTypes: [DYN, DYN], result: DYN },
|
|
1254
|
-
"dyn.classSuper": { argTypes: [DYN, DYN, DYN], result: VOID },
|
|
1255
|
-
"dyn.assignPrototype": { argTypes: [DYN, DYN, DYN], result: DYN },
|
|
1256
|
-
"dyn.definePrototypeProps": { argTypes: [DYN, DYN, DYN], result: DYN },
|
|
1257
|
-
"dyn.bagGet": { argTypes: [DYN, STRING, DYN], result: DYN },
|
|
1258
|
-
"dyn.bagSet": { argTypes: [DYN, STRING, DYN, DYN], result: VOID },
|
|
1259
|
-
"dyn.objCreate": { argTypes: [DYN], result: DYN },
|
|
1260
|
-
"dyn.objCreateWithProperties": { argTypes: [DYN, DYN], result: DYN },
|
|
1261
|
-
"dyn.getPrototype": { argTypes: [DYN], result: DYN },
|
|
1262
|
-
"dyn.setPrototype": { argTypes: [DYN, DYN], result: DYN },
|
|
1263
|
-
"dyn.getOwnPropertyNames": { argTypes: [DYN], result: DYN },
|
|
1264
|
-
"dyn.ownKeys": { argTypes: [DYN], result: DYN },
|
|
1265
|
-
"dyn.getOwnPropertySymbols": { argTypes: [DYN], result: DYN },
|
|
1266
|
-
"dyn.getOwnPropertyDescriptors": { argTypes: [DYN], result: DYN },
|
|
1267
|
-
"dyn.preventExtensions": { argTypes: [DYN], result: DYN },
|
|
1268
|
-
"dyn.isExtensible": { argTypes: [DYN], result: BOOL },
|
|
1269
|
-
"dyn.seal": { argTypes: [DYN], result: DYN },
|
|
1270
|
-
"dyn.isSealed": { argTypes: [DYN], result: BOOL },
|
|
1271
|
-
"dyn.objValues": { argTypes: [DYN], result: DYN },
|
|
1272
|
-
"dyn.objEntries": { argTypes: [DYN], result: DYN },
|
|
1273
|
-
"dyn.structuredClone": { argTypes: [DYN, DYN], result: DYN },
|
|
1274
|
-
"dyn.cloneMissing": { argTypes: [], result: DYN },
|
|
1275
|
-
"dyn.cloneTransferFail": { argTypes: [], result: DYN },
|
|
1276
|
-
"regex.new": { argTypes: [STRING, STRING], result: REGEX },
|
|
1277
|
-
"regex.resetLastIndex": { argTypes: [REGEX, F64], result: VOID },
|
|
1278
|
-
"regex.newChecked": { argTypes: [DYN, DYN], result: REGEX },
|
|
1279
|
-
// node:events EventEmitter: receivers are emitter-hierarchy objects and
|
|
1280
|
-
// the chaining forms (on/off/removeAll/setMax) return the receiver's
|
|
1281
|
-
// own class — program-dependent object types, checked in the libCall
|
|
1282
|
-
// case. emitter.emit is the one VARIADIC libCall: args beyond
|
|
1283
|
-
// (recv, name) are the event's frontend-unified tuple, any borrowable
|
|
1284
|
-
// kind — the count check admits a longer list for it alone.
|
|
1285
|
-
"emitter.new": { argTypes: [], result: VOID },
|
|
1286
|
-
"emitter.ctor": { argTypes: [null], result: VOID },
|
|
1287
|
-
"emitter.on": { argTypes: [null, STRING, null, BOOL, BOOL], result: VOID },
|
|
1288
|
-
"emitter.off": { argTypes: [null, STRING, null], result: VOID },
|
|
1289
|
-
// The dyn-adapted registration family (JS-lane checked-dynamic
|
|
1290
|
-
// listeners): checkListener has NO receiver (it validates the listener
|
|
1291
|
-
// argument alone); onDyn carries (recv, name, cb dyn, adapter func,
|
|
1292
|
-
// once, prepend), offDyn (recv, name, cb dyn).
|
|
1293
|
-
"emitter.checkListener": { argTypes: [DYN], result: VOID },
|
|
1294
|
-
"emitter.onDyn": { argTypes: [null, STRING, DYN, null, BOOL, BOOL], result: VOID },
|
|
1295
|
-
"emitter.onFlex": { argTypes: [null, STRING, DYN, BOOL, BOOL], result: VOID },
|
|
1296
|
-
"emitter.offDyn": { argTypes: [null, STRING, DYN], result: VOID },
|
|
1297
|
-
"emitter.removeAll": { argTypes: [null, STRING, BOOL], result: VOID },
|
|
1298
|
-
"emitter.emit": { argTypes: [null, STRING], result: BOOL },
|
|
1299
|
-
"emitter.emitFlex": { argTypes: [null, STRING], result: BOOL },
|
|
1300
|
-
"emitter.emitError": { argTypes: [null, STRING, null], result: BOOL },
|
|
1301
|
-
"emitter.count": { argTypes: [null, STRING], result: F64 },
|
|
1302
|
-
"emitter.countFn": { argTypes: [null, STRING, null], result: F64 },
|
|
1303
|
-
"emitter.countDyn": { argTypes: [null, STRING, DYN], result: F64 },
|
|
1304
|
-
"emitter.names": { argTypes: [null], result: VOID },
|
|
1305
|
-
"emitter.listeners": { argTypes: [null, STRING], result: VOID },
|
|
1306
|
-
"emitter.onData": { argTypes: [null, STRING, null, BOOL, BOOL], result: VOID },
|
|
1307
|
-
"emitter.onDataDyn": { argTypes: [null, STRING, DYN, null, BOOL, BOOL], result: VOID },
|
|
1308
|
-
"emitter.emitData": { argTypes: [null, STRING, null], result: BOOL },
|
|
1309
|
-
"emitter.setMax": { argTypes: [null, F64], result: VOID },
|
|
1310
|
-
"emitter.getMax": { argTypes: [null], result: F64 },
|
|
1311
|
-
"emitter.setDefaultMax": { argTypes: [F64], result: VOID },
|
|
1312
|
-
"emitter.getDefaultMax": { argTypes: [], result: F64 },
|
|
1313
|
-
// node:stream: receivers are stream-hierarchy objects and several
|
|
1314
|
-
// results are program-dependent (the receiver's class, unions) — the
|
|
1315
|
-
// libCall case owns those checks. The constructors and a few methods
|
|
1316
|
-
// are VARIADIC (trailing option callbacks / the optional chunk+cb tail):
|
|
1317
|
-
// argTypes here is the fixed prefix, VARIADIC_LIB_FNS admits the rest.
|
|
1318
|
-
"readable.new": { argTypes: [F64, BOOL, BOOL, F64], result: VOID },
|
|
1319
|
-
"writable.new": { argTypes: [F64, BOOL, BOOL, F64], result: VOID },
|
|
1320
|
-
"duplex.new": { argTypes: [F64, F64, BOOL, BOOL, BOOL, BOOL, BOOL, F64], result: VOID },
|
|
1321
|
-
"transform.new": { argTypes: [F64, F64, BOOL, BOOL, BOOL, BOOL, BOOL, F64], result: VOID },
|
|
1322
|
-
"passthrough.new": { argTypes: [F64, F64, BOOL, BOOL, BOOL, BOOL, BOOL, F64], result: VOID },
|
|
1323
|
-
// The subclass-initialization twins: the borrowed receiver leads, then
|
|
1324
|
-
// the .new tail (variadic callbacks likewise).
|
|
1325
|
-
// The dyn-options twins: newDyn takes the record, initDyn the borrowed
|
|
1326
|
-
// receiver + record + fallback flags (trailing wrapper closures ride
|
|
1327
|
-
// the variadic tail like the static forms).
|
|
1328
|
-
"stream.setRead": { argTypes: [null, null], result: VOID },
|
|
1329
|
-
"stream.setWrite": { argTypes: [null, null], result: VOID },
|
|
1330
|
-
"stream.setFinal": { argTypes: [null, null], result: VOID },
|
|
1331
|
-
"stream.setDestroy": { argTypes: [null, null], result: VOID },
|
|
1332
|
-
"stream.setTransform": { argTypes: [null, null], result: VOID },
|
|
1333
|
-
"stream.setFlush": { argTypes: [null, null], result: VOID },
|
|
1334
|
-
"stream.finished": { argTypes: [null, null], result: VOID },
|
|
1335
|
-
"stream.finishedDyn": { argTypes: [null, DYN], result: VOID },
|
|
1336
|
-
"stream.pipeline": { argTypes: [F64], result: VOID },
|
|
1337
|
-
"stream.pipelineDyn": { argTypes: [F64], result: VOID },
|
|
1338
|
-
"sp.finished": { argTypes: [null], result: { kind: "promise", inner: VOID } },
|
|
1339
|
-
"sp.pipeline": { argTypes: [F64], result: { kind: "promise", inner: VOID } },
|
|
1340
|
-
"sc.text": { argTypes: [null], result: { kind: "promise", inner: STRING } },
|
|
1341
|
-
"sc.json": { argTypes: [null], result: { kind: "promise", inner: DYN } },
|
|
1342
|
-
"sc.buffer": { argTypes: [null], result: { kind: "promise", inner: BYTES_U8 } },
|
|
1343
|
-
"readable.newDyn": { argTypes: [DYN], result: VOID },
|
|
1344
|
-
"writable.newDyn": { argTypes: [DYN], result: VOID },
|
|
1345
|
-
"duplex.newDyn": { argTypes: [DYN], result: VOID },
|
|
1346
|
-
"transform.newDyn": { argTypes: [DYN], result: VOID },
|
|
1347
|
-
"passthrough.newDyn": { argTypes: [DYN], result: VOID },
|
|
1348
|
-
"readable.initDyn": { argTypes: [null, DYN, F64], result: VOID },
|
|
1349
|
-
"writable.initDyn": { argTypes: [null, DYN, F64], result: VOID },
|
|
1350
|
-
"duplex.initDyn": { argTypes: [null, DYN, F64], result: VOID },
|
|
1351
|
-
"transform.initDyn": { argTypes: [null, DYN, F64], result: VOID },
|
|
1352
|
-
"passthrough.initDyn": { argTypes: [null, DYN, F64], result: VOID },
|
|
1353
|
-
"readable.init": { argTypes: [null, F64, BOOL, BOOL, F64], result: VOID },
|
|
1354
|
-
"writable.init": { argTypes: [null, F64, BOOL, BOOL, F64], result: VOID },
|
|
1355
|
-
"duplex.init": { argTypes: [null, F64, F64, BOOL, BOOL, BOOL, BOOL, BOOL, F64], result: VOID },
|
|
1356
|
-
"transform.init": { argTypes: [null, F64, F64, BOOL, BOOL, BOOL, BOOL, BOOL, F64], result: VOID },
|
|
1357
|
-
"passthrough.init": { argTypes: [null, F64, F64, BOOL, BOOL, BOOL, BOOL, BOOL, F64], result: VOID },
|
|
1358
|
-
"readable.push": { argTypes: [null, BYTES_U8], result: BOOL },
|
|
1359
|
-
"readable.pushStr": { argTypes: [null, STRING], result: BOOL },
|
|
1360
|
-
"readable.pushNull": { argTypes: [null], result: BOOL },
|
|
1361
|
-
"readable.pushU": { argTypes: [null, null], result: BOOL },
|
|
1362
|
-
"readable.pushDyn": { argTypes: [null, DYN], result: BOOL },
|
|
1363
|
-
"readable.unshift": { argTypes: [null, BYTES_U8], result: VOID },
|
|
1364
|
-
"readable.unshiftStr": { argTypes: [null, STRING], result: VOID },
|
|
1365
|
-
"stream.onDyn": { argTypes: [null, STRING, DYN, BOOL, BOOL], result: VOID },
|
|
1366
|
-
"readable.readDyn": { argTypes: [null, DYN], result: DYN },
|
|
1367
|
-
"readable.read": { argTypes: [null, F64], result: VOID },
|
|
1368
|
-
"readable.pause": { argTypes: [null], result: VOID },
|
|
1369
|
-
"readable.setEncoding": { argTypes: [null, STRING], result: VOID },
|
|
1370
|
-
"readable.pushStrEnc": { argTypes: [null, STRING, STRING], result: BOOL },
|
|
1371
|
-
"readable.pushEncoding": { argTypes: [null, STRING], result: VOID },
|
|
1372
|
-
"readable.nextChunk": { argTypes: [null], result: VOID },
|
|
1373
|
-
"readable.nextChunkDyn": { argTypes: [null], result: VOID },
|
|
1374
|
-
"readable.fromArr": { argTypes: [null, BOOL], result: VOID },
|
|
1375
|
-
"readable.resume": { argTypes: [null], result: VOID },
|
|
1376
|
-
"readable.isPaused": { argTypes: [null], result: BOOL },
|
|
1377
|
-
"readable.pipe": { argTypes: [null, null, BOOL], result: VOID },
|
|
1378
|
-
"readable.unpipe": { argTypes: [null], result: VOID },
|
|
1379
|
-
"readable.flowing": { argTypes: [null], result: VOID },
|
|
1380
|
-
"writable.write": { argTypes: [null, BYTES_U8], result: BOOL },
|
|
1381
|
-
"writable.writeStr": { argTypes: [null, STRING], result: BOOL },
|
|
1382
|
-
"writable.writeU": { argTypes: [null, null], result: BOOL },
|
|
1383
|
-
"writable.writeDyn": { argTypes: [null, DYN], result: BOOL },
|
|
1384
|
-
"writable.end": { argTypes: [null, F64], result: VOID },
|
|
1385
|
-
"writable.cork": { argTypes: [null], result: VOID },
|
|
1386
|
-
"writable.uncork": { argTypes: [null], result: VOID },
|
|
1387
|
-
"stream.destroy": { argTypes: [null], result: VOID },
|
|
1388
|
-
"stream.destroyErr": { argTypes: [null, null], result: VOID },
|
|
1389
|
-
"stream.iteratorClose": { argTypes: [null], result: VOID },
|
|
1390
|
-
"stream.prop": { argTypes: [null, STRING], result: VOID },
|
|
1391
|
-
"stream.errored": { argTypes: [null], result: VOID },
|
|
1392
|
-
// node:assert: pass/negated/deep/hasMsg are frontend-computed bools; the
|
|
1393
|
-
// message slot always carries a string ("" when hasMsg is false).
|
|
1394
|
-
"assert.ok": { argTypes: [BOOL, STRING], result: VOID },
|
|
1395
|
-
"assert.eqF64": { argTypes: [F64, F64, BOOL, BOOL, STRING, BOOL], result: VOID },
|
|
1396
|
-
"assert.eqBigInt": { argTypes: [BIGINT_T, BIGINT_T, BOOL, BOOL, STRING, BOOL], result: VOID },
|
|
1397
|
-
"assert.eqStr": { argTypes: [STRING, STRING, BOOL, BOOL, STRING, BOOL], result: VOID },
|
|
1398
|
-
"assert.eqBool": { argTypes: [BOOL, BOOL, BOOL, BOOL, STRING, BOOL], result: VOID },
|
|
1399
|
-
"assert.deepResult": { argTypes: [BOOL, BOOL, STRING, BOOL], result: VOID },
|
|
1400
|
-
"assert.sameValue": { argTypes: [F64, F64], result: BOOL },
|
|
1401
|
-
// The deep-equality pair memo: both slots are program-dependent
|
|
1402
|
-
// (any cycle-capable record/array/map type).
|
|
1403
|
-
"assert.deqEnter": { argTypes: [null, null], result: BOOL },
|
|
1404
|
-
"assert.deqLeave": { argTypes: [], result: VOID },
|
|
1405
|
-
"assert.match": { argTypes: [STRING, REGEX, BOOL, STRING, BOOL], result: VOID },
|
|
1406
|
-
"assert.throwsNone": { argTypes: [BOOL, STRING, BOOL, STRING, BOOL], result: VOID },
|
|
1407
|
-
"assert.throwsMismatch": { argTypes: [STRING, { kind: "object", className: "%Error" }, STRING, BOOL], result: VOID },
|
|
1408
|
-
"assert.throwsRegex": { argTypes: [REGEX, { kind: "object", className: "%Error" }, STRING, BOOL], result: VOID },
|
|
1409
|
-
// Symbol strict equality (pointer identity; scr_symbol.c).
|
|
1410
|
-
"assert.eqSym": { argTypes: [{ kind: "symbol" }, { kind: "symbol" }, BOOL, BOOL, STRING, BOOL], result: VOID },
|
|
1411
|
-
// The equality quartet over checked-dynamic operands (the frontend
|
|
1412
|
-
// boxes a static side into the checked-dynamic tree first).
|
|
1413
|
-
"assert.eqDyn": { argTypes: [DYN, DYN, BOOL, BOOL, STRING, BOOL], result: VOID },
|
|
1414
|
-
"assert.looseResult": { argTypes: [BOOL, BOOL, STRING, STRING, STRING, BOOL], result: VOID },
|
|
1415
|
-
// The throws(fn, {shape}) accumulator: begin/slot calls never throw;
|
|
1416
|
-
// shapeEnd throws the Comparison diff. The error slot is the
|
|
1417
|
-
// %Error-narrowed caught value.
|
|
1418
|
-
"assert.shapeBegin": { argTypes: [{ kind: "object", className: "%Error" }], result: VOID },
|
|
1419
|
-
"assert.shapeStr": { argTypes: [F64, STRING], result: VOID },
|
|
1420
|
-
"assert.shapeRe": { argTypes: [F64, REGEX], result: VOID },
|
|
1421
|
-
"assert.shapeEnd": { argTypes: [STRING, BOOL], result: VOID },
|
|
1422
|
-
"assert.regexErrTest": { argTypes: [REGEX, { kind: "object", className: "%Error" }], result: BOOL },
|
|
1423
|
-
"assert.unwantedRejection": { argTypes: [{ kind: "object", className: "%Error" }, STRING, BOOL], result: VOID },
|
|
1424
|
-
"assert.unwantedError": { argTypes: [STRING, BOOL, STRING, BOOL], result: VOID },
|
|
1425
|
-
"assert.noErrorPredicate": { argTypes: [DYN, DYN], result: BOOL },
|
|
1426
|
-
"assert.regexDynTest": { argTypes: [REGEX, DYN], result: BOOL },
|
|
1427
|
-
"assert.expectsErrDyn": { argTypes: [DYN, DYN, STRING, BOOL], result: VOID },
|
|
1428
|
-
// assert.ifError's typed entries (always throw; unit args never
|
|
1429
|
-
// lower). The error slot is program-dependent — any %Error-hierarchy
|
|
1430
|
-
// class, root or subclass (the insp.error precedent, null slot).
|
|
1431
|
-
"assert.ifErrorErr": { argTypes: [null], result: VOID },
|
|
1432
|
-
"assert.ifErrorF64": { argTypes: [F64], result: VOID },
|
|
1433
|
-
"assert.ifErrorStr": { argTypes: [STRING], result: VOID },
|
|
1434
|
-
"assert.ifErrorBool": { argTypes: [BOOL], result: VOID },
|
|
1435
|
-
"assert.ifErrorDyn": { argTypes: [DYN], result: VOID },
|
|
1436
|
-
// Bytes equality: the two value slots are any bytes kind (the frontend
|
|
1437
|
-
// gates both sides to ONE static bytes type; the libCall case checks
|
|
1438
|
-
// the kind and the pair below).
|
|
1439
|
-
"assert.refEqBytes": { argTypes: [null, null, BOOL, BOOL, STRING, BOOL], result: VOID },
|
|
1440
|
-
"assert.refEqFn": { argTypes: [null, null, BOOL, STRING, BOOL], result: VOID },
|
|
1441
|
-
"assert.bytesDeepEq": { argTypes: [null, null, BOOL], result: BOOL },
|
|
1442
|
-
// util.inspect: the error receiver is program-dependent (a builtin or
|
|
1443
|
-
// user error class — the error.toString precedent, null slot).
|
|
1444
|
-
"insp.f64": { argTypes: [F64], result: STRING },
|
|
1445
|
-
"insp.jsonDyn": { argTypes: [DYN], result: STRING },
|
|
1446
|
-
"insp.str": { argTypes: [STRING], result: STRING },
|
|
1447
|
-
"insp.regex": { argTypes: [REGEX], result: STRING },
|
|
1448
|
-
"insp.buffer": { argTypes: [BYTES_U8], result: STRING },
|
|
1449
|
-
"insp.error": { argTypes: [null, F64, F64], result: STRING },
|
|
1450
|
-
"insp.dyn": { argTypes: [DYN, F64, F64], result: STRING },
|
|
1451
|
-
"insp.dynS": { argTypes: [DYN, F64], result: STRING },
|
|
1452
|
-
"insp.jsval": { argTypes: [JSVAL, F64, F64], result: STRING },
|
|
1453
|
-
"insp.begin": { argTypes: [F64], result: VOID },
|
|
1454
|
-
"insp.entry": { argTypes: [STRING, BOOL], result: VOID },
|
|
1455
|
-
// Circular references: the receiver slot is program-dependent (any
|
|
1456
|
-
// cycle-capable record/array/map/class type — the insp.error precedent).
|
|
1457
|
-
"insp.circCheck": { argTypes: [null], result: F64 },
|
|
1458
|
-
"insp.seenPush": { argTypes: [null], result: VOID },
|
|
1459
|
-
"insp.refWrap": { argTypes: [null, STRING], result: STRING },
|
|
1460
|
-
"insp.circular": { argTypes: [F64], result: STRING },
|
|
1461
|
-
"insp.key": { argTypes: [STRING], result: STRING },
|
|
1462
|
-
"insp.moreItems": { argTypes: [F64], result: STRING },
|
|
1463
|
-
"insp.end": { argTypes: [STRING, STRING, STRING, F64, BOOL, BOOL], result: STRING },
|
|
1464
|
-
"strdec.write": { argTypes: [STRING, F64, BYTES_U8], result: STRING },
|
|
1465
|
-
"strdec.next": { argTypes: [STRING, F64, BYTES_U8], result: F64 },
|
|
1466
|
-
"strdec.end": { argTypes: [STRING, F64], result: STRING },
|
|
1467
|
-
// node:readline: the interface handle is f64; the callbacks' func types
|
|
1468
|
-
// are program-dependent (zero-param or (answer: string) — the emitter
|
|
1469
|
-
// picks the adapter), so those slots are null like child.onExit's.
|
|
1470
|
-
"rl.create": { argTypes: [], result: F64 },
|
|
1471
|
-
"rl.question": { argTypes: [F64, STRING, null], result: VOID },
|
|
1472
|
-
"rl.close": { argTypes: [F64], result: VOID },
|
|
1473
|
-
"rl.onClose": { argTypes: [F64, null], result: VOID },
|
|
1474
|
-
"tp.setTimeout": { argTypes: [F64], result: { kind: "promise", inner: VOID } },
|
|
1475
|
-
"tp.setImmediate": { argTypes: [], result: { kind: "promise", inner: VOID } },
|
|
1476
|
-
"dc.channel": { argTypes: [STRING], result: F64 },
|
|
1477
|
-
"dc.subscribe": { argTypes: [STRING, DYN], result: VOID },
|
|
1478
|
-
"dc.unsubscribe": { argTypes: [STRING, DYN], result: BOOL },
|
|
1479
|
-
"dc.hasSubscribers": { argTypes: [STRING], result: BOOL },
|
|
1480
|
-
"dc.publish": { argTypes: [F64, DYN], result: VOID },
|
|
1481
|
-
"dc.chanSubscribe": { argTypes: [F64, DYN], result: VOID },
|
|
1482
|
-
"dc.chanUnsubscribe": { argTypes: [F64, DYN], result: BOOL },
|
|
1483
|
-
"dc.chanHasSubscribers": { argTypes: [F64], result: BOOL },
|
|
1484
|
-
"dc.chanName": { argTypes: [F64], result: STRING },
|
|
1485
|
-
"timers.setImmediateFnValue": { argTypes: [], result: DYN },
|
|
1486
|
-
"timers.immediatePromise": { argTypes: [], result: { kind: "promise", inner: DYN } },
|
|
1487
|
-
"dc.tracingChannel": { argTypes: [STRING], result: F64 },
|
|
1488
|
-
"dc.tracingChannelOf": { argTypes: [F64, F64, F64, F64, F64], result: F64 },
|
|
1489
|
-
"dc.tcChannel": { argTypes: [F64, F64], result: F64 },
|
|
1490
|
-
"dc.tcHasSubscribers": { argTypes: [F64], result: BOOL },
|
|
1491
|
-
"dc.tcSubscribe": { argTypes: [F64, DYN], result: VOID },
|
|
1492
|
-
"dc.tcUnsubscribe": { argTypes: [F64, DYN], result: BOOL },
|
|
1493
|
-
"dc.tcTraceSync": { argTypes: [F64, DYN, DYN, DYN, DYN], result: DYN },
|
|
1494
|
-
"dc.tcTraceCallback": { argTypes: [F64, DYN, F64, DYN, DYN, DYN], result: DYN },
|
|
1495
|
-
"dc.tcTracePromise": { argTypes: [F64, DYN, DYN, DYN, DYN], result: { kind: "promise", inner: DYN } },
|
|
1496
|
-
"process.onUncaughtException": { argTypes: [DYN, BOOL, BOOL], result: VOID },
|
|
1497
|
-
"process.offUncaughtException": { argTypes: [DYN, BOOL], result: VOID },
|
|
1498
|
-
"process.onUnhandledRejection": { argTypes: [DYN, BOOL], result: VOID },
|
|
1499
|
-
"process.offUnhandledRejection": { argTypes: [DYN], result: VOID },
|
|
1500
|
-
"process.onRejectionHandled": { argTypes: [DYN, BOOL], result: VOID },
|
|
1501
|
-
"process.offRejectionHandled": { argTypes: [DYN], result: VOID },
|
|
1502
|
-
"process.onWarning": { argTypes: [DYN], result: VOID },
|
|
1503
|
-
"process.offWarning": { argTypes: [DYN], result: VOID },
|
|
1504
|
-
"process.emitWarning": { argTypes: [DYN], result: VOID },
|
|
1505
|
-
"async.awaitDyn": { argTypes: [DYN], result: DYN },
|
|
1506
|
-
"async.hop": { argTypes: [], result: VOID },
|
|
1507
|
-
"als.new": { argTypes: [], result: F64 },
|
|
1508
|
-
"als.get": { argTypes: [F64], result: DYN },
|
|
1509
|
-
"als.run": { argTypes: [F64, DYN, DYN, DYN], result: DYN },
|
|
1510
|
-
"als.exitRun": { argTypes: [F64, DYN, DYN], result: DYN },
|
|
1511
|
-
"als.enterWith": { argTypes: [F64, DYN], result: VOID },
|
|
1512
|
-
"als.disable": { argTypes: [F64], result: VOID },
|
|
1513
|
-
"dc.chanBindStore": { argTypes: [F64, F64, DYN], result: VOID },
|
|
1514
|
-
"dc.chanUnbindStore": { argTypes: [F64, F64], result: BOOL },
|
|
1515
|
-
"dc.chanRunStores": { argTypes: [F64, DYN, DYN, DYN, DYN], result: DYN },
|
|
1516
|
-
"number.isFinite": { argTypes: [F64], result: BOOL },
|
|
1517
|
-
"number.isNaN": { argTypes: [F64], result: BOOL },
|
|
1518
|
-
"number.isInteger": { argTypes: [F64], result: BOOL },
|
|
1519
|
-
"number.isSafeInteger": { argTypes: [F64], result: BOOL },
|
|
1520
|
-
"date.now": { argTypes: [], result: F64 },
|
|
1521
|
-
"date.newNow": { argTypes: [], result: DATE_T },
|
|
1522
|
-
"date.newMs": { argTypes: [F64], result: DATE_T },
|
|
1523
|
-
"date.newString": { argTypes: [STRING], result: DATE_T },
|
|
1524
|
-
"date.parse": { argTypes: [STRING], result: F64 },
|
|
1525
|
-
"date.getTime": { argTypes: [DATE_T], result: F64 },
|
|
1526
|
-
"date.valueOf": { argTypes: [DATE_T], result: F64 },
|
|
1527
|
-
"date.toISOString": { argTypes: [F64], result: STRING },
|
|
1528
|
-
"date.toISOStringValue": { argTypes: [DATE_T], result: STRING },
|
|
1529
|
-
"date.getFullYear": { argTypes: [DATE_T], result: F64 },
|
|
1530
|
-
"date.getUTCFullYear": { argTypes: [DATE_T], result: F64 },
|
|
1531
|
-
"date.getMonth": { argTypes: [DATE_T], result: F64 },
|
|
1532
|
-
"date.getUTCMonth": { argTypes: [DATE_T], result: F64 },
|
|
1533
|
-
"date.getDate": { argTypes: [DATE_T], result: F64 },
|
|
1534
|
-
"date.getUTCDate": { argTypes: [DATE_T], result: F64 },
|
|
1535
|
-
"date.getDay": { argTypes: [DATE_T], result: F64 },
|
|
1536
|
-
"date.getUTCDay": { argTypes: [DATE_T], result: F64 },
|
|
1537
|
-
"date.getHours": { argTypes: [DATE_T], result: F64 },
|
|
1538
|
-
"date.getUTCHours": { argTypes: [DATE_T], result: F64 },
|
|
1539
|
-
"date.getMinutes": { argTypes: [DATE_T], result: F64 },
|
|
1540
|
-
"date.getUTCMinutes": { argTypes: [DATE_T], result: F64 },
|
|
1541
|
-
"date.getSeconds": { argTypes: [DATE_T], result: F64 },
|
|
1542
|
-
"date.getUTCSeconds": { argTypes: [DATE_T], result: F64 },
|
|
1543
|
-
"date.getMilliseconds": { argTypes: [DATE_T], result: F64 },
|
|
1544
|
-
"date.getUTCMilliseconds": { argTypes: [DATE_T], result: F64 },
|
|
1545
|
-
"date.getTimezoneOffset": { argTypes: [DATE_T], result: F64 },
|
|
1546
|
-
"date.parseGetTime": { argTypes: [STRING], result: F64 },
|
|
1547
|
-
"date.utc": { argTypes: [F64, F64, F64, F64, F64, F64, F64], result: F64 },
|
|
1548
|
-
"text.decode": { argTypes: [BYTES_U8], result: STRING },
|
|
1549
|
-
"bytes.bufferSource": { argTypes: [DYN], result: BYTES_U8 },
|
|
1550
|
-
"text.decodeBufferSource": { argTypes: [DYN], result: STRING },
|
|
1551
|
-
"text.decodeOptions": { argTypes: [BYTES_U8, BOOL, BOOL], result: STRING },
|
|
1552
|
-
"text.decodeStream": { argTypes: [DYN, BYTES_U8, F64, BOOL, BOOL, BOOL], result: STRING },
|
|
1553
|
-
"text.decodeLegacyOptions": { argTypes: [BYTES_U8, F64, BOOL, BOOL], result: STRING },
|
|
1554
|
-
"text.decodeLegacy": { argTypes: [BYTES_U8, F64], result: STRING },
|
|
1555
|
-
"text.decoderEncoding": { argTypes: [DYN], result: F64 },
|
|
1556
|
-
"text.decoderName": { argTypes: [F64], result: STRING },
|
|
1557
|
-
"text.encodeInto": { argTypes: [DYN, DYN], result: DYN },
|
|
1558
|
-
"buffer.isAscii": { argTypes: [DYN], result: BOOL },
|
|
1559
|
-
"buffer.isUtf8": { argTypes: [DYN], result: BOOL },
|
|
1560
|
-
"buffer.transcode": { argTypes: [DYN, DYN, DYN], result: BYTES_U8 },
|
|
1561
|
-
"fs.mkdirRecursiveSync": { argTypes: [STRING], result: VOID },
|
|
1562
|
-
"fs.rmOptsSync": { argTypes: [STRING, BOOL, BOOL], result: VOID },
|
|
1563
|
-
"fs.rmRetrySync": { argTypes: [STRING, BOOL, BOOL, F64, F64], result: VOID },
|
|
1564
|
-
"fs.mkdtempSync": { argTypes: [STRING], result: STRING },
|
|
1565
|
-
"fs.accessSync": { argTypes: [STRING, F64], result: VOID },
|
|
1566
|
-
"fs.readFdSync": { argTypes: [F64, STRING], result: STRING },
|
|
1567
|
-
"fs.readFdSyncBytes": { argTypes: [F64], result: BYTES_U8 },
|
|
1568
|
-
"process.isTTY": { argTypes: [F64], result: BOOL },
|
|
1569
|
-
// Like process.envGet: the result is the module's interned
|
|
1570
|
-
// `number | undefined` union — checked by arms in the libCall case.
|
|
1571
|
-
"process.columns": { argTypes: [F64], result: VOID },
|
|
1572
|
-
"process.rows": { argTypes: [F64], result: VOID },
|
|
1573
|
-
"process.stdinDestroy": { argTypes: [], result: VOID },
|
|
1574
|
-
"process.stdinSetRawMode": { argTypes: [BOOL], result: VOID },
|
|
1575
|
-
// Arg 0 is a packed f64[] OR a bytes value (the spread-typed-array
|
|
1576
|
-
// form) — checked in the libCall case.
|
|
1577
|
-
"string.fromCharCode": { argTypes: [null], result: STRING },
|
|
1578
|
-
"string.fromCodePoint": { argTypes: [null], result: STRING },
|
|
1579
|
-
"string.lastIndexOf": { argTypes: [STRING, STRING], result: F64 },
|
|
1580
|
-
"string.lastIndexOfFrom": { argTypes: [STRING, STRING, F64], result: F64 },
|
|
1581
|
-
"string.raw": { argTypes: [arrayOf(STRING), arrayOf(STRING)], result: STRING },
|
|
1582
|
-
};
|
|
11
|
+
import { LIB_FN_SIGS } from "./builtin-signatures.js";
|
|
12
|
+
import { REGEX_INTRINSIC_SIGS, STR_INTRINSIC_SIGS } from "./intrinsic-signatures.js";
|
|
1583
13
|
/** True for an object type naming a runtime-provided error class. */
|
|
1584
14
|
function isBuiltinErrorObject(t) {
|
|
1585
15
|
return t.kind === "object" && RUNTIME_ERROR_CLASSES.has(t.className);
|
|
@@ -1591,12 +21,23 @@ function isBuiltinErrorObject(t) {
|
|
|
1591
21
|
* the body/call-site split is spelled out in the validator. */
|
|
1592
22
|
function callSiteReturnType(fn) {
|
|
1593
23
|
if (fn.async && fn.generator !== undefined) {
|
|
1594
|
-
return {
|
|
24
|
+
return {
|
|
25
|
+
kind: "generator",
|
|
26
|
+
async: true,
|
|
27
|
+
yieldT: fn.generator.yieldT,
|
|
28
|
+
retT: fn.returnType,
|
|
29
|
+
nextT: fn.generator.nextT,
|
|
30
|
+
};
|
|
1595
31
|
}
|
|
1596
32
|
if (fn.async)
|
|
1597
33
|
return { kind: "promise", inner: fn.returnType };
|
|
1598
34
|
if (fn.generator !== undefined) {
|
|
1599
|
-
return {
|
|
35
|
+
return {
|
|
36
|
+
kind: "generator",
|
|
37
|
+
yieldT: fn.generator.yieldT,
|
|
38
|
+
retT: fn.returnType,
|
|
39
|
+
nextT: fn.generator.nextT,
|
|
40
|
+
};
|
|
1600
41
|
}
|
|
1601
42
|
return fn.returnType;
|
|
1602
43
|
}
|
|
@@ -1625,20 +66,32 @@ export function validateModule(mod) {
|
|
|
1625
66
|
const retainedFfiCallbacks = new Map();
|
|
1626
67
|
for (const entry of mod.ffiImports ?? []) {
|
|
1627
68
|
if (entry.callbackOperation !== undefined) {
|
|
1628
|
-
const fail = (detail) => {
|
|
69
|
+
const fail = (detail) => {
|
|
70
|
+
errors.push({
|
|
71
|
+
message: `FFI callback operation "${entry.name}" ${detail}`,
|
|
72
|
+
loc: moduleLoc,
|
|
73
|
+
});
|
|
74
|
+
};
|
|
1629
75
|
if (!entry.library || entry.library.includes("\0"))
|
|
1630
76
|
fail("requires a library name");
|
|
1631
77
|
if (entry.callbackOperation === "register") {
|
|
1632
78
|
const param = entry.params[0];
|
|
1633
|
-
if (entry.params.length !== 1 ||
|
|
1634
|
-
param
|
|
1635
|
-
param
|
|
1636
|
-
|
|
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)
|
|
1637
88
|
fail("has an invalid registration ABI");
|
|
1638
89
|
}
|
|
1639
90
|
else if (entry.callbackOperation === "release") {
|
|
1640
91
|
const target = entry.callbackTarget ? ffiByName.get(entry.callbackTarget) : undefined;
|
|
1641
|
-
if (entry.params.length !== 0 ||
|
|
92
|
+
if (entry.params.length !== 0 ||
|
|
93
|
+
entry.returns !== "void" ||
|
|
94
|
+
target?.callbackOperation !== "register" ||
|
|
1642
95
|
target.library !== entry.library)
|
|
1643
96
|
fail("has an invalid release target or ABI");
|
|
1644
97
|
}
|
|
@@ -1646,31 +99,52 @@ export function validateModule(mod) {
|
|
|
1646
99
|
fail("has an invalid operation");
|
|
1647
100
|
}
|
|
1648
101
|
else if (entry.callbackTarget !== undefined) {
|
|
1649
|
-
errors.push({
|
|
102
|
+
errors.push({
|
|
103
|
+
message: `FFI binding "${entry.name}" has a callback target without a release operation`,
|
|
104
|
+
loc: moduleLoc,
|
|
105
|
+
});
|
|
1650
106
|
}
|
|
1651
107
|
const ids = new Set();
|
|
1652
108
|
for (const param of entry.params) {
|
|
1653
109
|
if (!isFfiCallbackParam(param))
|
|
1654
110
|
continue;
|
|
1655
111
|
if (ids.has(param.callback.id)) {
|
|
1656
|
-
errors.push({
|
|
112
|
+
errors.push({
|
|
113
|
+
message: `FFI binding "${entry.name}" has duplicate callback id "${param.callback.id}"`,
|
|
114
|
+
loc: moduleLoc,
|
|
115
|
+
});
|
|
1657
116
|
}
|
|
1658
117
|
ids.add(param.callback.id);
|
|
1659
118
|
if (param.callback.invoke !== "script-thread" && param.callback.invoke !== "foreign") {
|
|
1660
|
-
errors.push({
|
|
119
|
+
errors.push({
|
|
120
|
+
message: `FFI callback "${entry.name}:${param.callback.id}" has invalid invoke mode`,
|
|
121
|
+
loc: moduleLoc,
|
|
122
|
+
});
|
|
1661
123
|
}
|
|
1662
124
|
if (param.callback.invoke === "foreign") {
|
|
1663
125
|
if (param.callback.params.some((p) => p === "i64" || p === "u64" || p === "pointer")) {
|
|
1664
|
-
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
|
+
});
|
|
1665
130
|
}
|
|
1666
131
|
if (param.callback.lifetime !== "retained") {
|
|
1667
|
-
errors.push({
|
|
132
|
+
errors.push({
|
|
133
|
+
message: `FFI foreign callback "${entry.name}:${param.callback.id}" is not retained`,
|
|
134
|
+
loc: moduleLoc,
|
|
135
|
+
});
|
|
1668
136
|
}
|
|
1669
137
|
if (param.callback.returns !== "void") {
|
|
1670
|
-
errors.push({
|
|
138
|
+
errors.push({
|
|
139
|
+
message: `FFI foreign callback "${entry.name}:${param.callback.id}" does not return void`,
|
|
140
|
+
loc: moduleLoc,
|
|
141
|
+
});
|
|
1671
142
|
}
|
|
1672
143
|
if (!param.callback.params.some(isFfiContextParam)) {
|
|
1673
|
-
errors.push({
|
|
144
|
+
errors.push({
|
|
145
|
+
message: `FFI foreign callback "${entry.name}:${param.callback.id}" has no context`,
|
|
146
|
+
loc: moduleLoc,
|
|
147
|
+
});
|
|
1674
148
|
}
|
|
1675
149
|
}
|
|
1676
150
|
if (param.callback.lifetime === "retained") {
|
|
@@ -1679,7 +153,10 @@ export function validateModule(mod) {
|
|
|
1679
153
|
const hasInnerContext = param.callback.params.some(isFfiContextParam);
|
|
1680
154
|
const outerContexts = entry.params.filter((candidate) => isFfiContextParam(candidate) && candidate.context === param.callback.id).length;
|
|
1681
155
|
if (hasInnerContext !== (outerContexts === 1)) {
|
|
1682
|
-
errors.push({
|
|
156
|
+
errors.push({
|
|
157
|
+
message: `FFI callback "${entry.name}:${param.callback.id}" has inconsistent context slots`,
|
|
158
|
+
loc: moduleLoc,
|
|
159
|
+
});
|
|
1683
160
|
}
|
|
1684
161
|
}
|
|
1685
162
|
}
|
|
@@ -1689,7 +166,10 @@ export function validateModule(mod) {
|
|
|
1689
166
|
continue;
|
|
1690
167
|
const target = retainedFfiCallbacks.get(param.callback.release);
|
|
1691
168
|
if (target === undefined) {
|
|
1692
|
-
errors.push({
|
|
169
|
+
errors.push({
|
|
170
|
+
message: `FFI release "${entry.name}:${param.callback.release}" has no retained target`,
|
|
171
|
+
loc: moduleLoc,
|
|
172
|
+
});
|
|
1693
173
|
continue;
|
|
1694
174
|
}
|
|
1695
175
|
// A call registering its own release target defeats the emitted
|
|
@@ -1698,7 +178,10 @@ export function validateModule(mod) {
|
|
|
1698
178
|
const registeredBySameCall = entry.params.some((candidate) => isFfiCallbackParam(candidate) &&
|
|
1699
179
|
`${entry.name}:${candidate.callback.id}` === param.callback.release);
|
|
1700
180
|
if (registeredBySameCall) {
|
|
1701
|
-
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
|
+
});
|
|
1702
185
|
}
|
|
1703
186
|
// Structural ABI comparison: a params entry is a value-class string
|
|
1704
187
|
// or a {context} object. Key order and incidental object shape must
|
|
@@ -1713,12 +196,18 @@ export function validateModule(mod) {
|
|
|
1713
196
|
}) &&
|
|
1714
197
|
param.callback.returns === target.returns;
|
|
1715
198
|
if (!inherited) {
|
|
1716
|
-
errors.push({
|
|
199
|
+
errors.push({
|
|
200
|
+
message: `FFI release "${entry.name}:${param.callback.release}" does not inherit its target ABI`,
|
|
201
|
+
loc: moduleLoc,
|
|
202
|
+
});
|
|
1717
203
|
}
|
|
1718
204
|
const hasInnerContext = target.params.some(isFfiContextParam);
|
|
1719
205
|
const outerContexts = entry.params.filter((candidate) => isFfiContextParam(candidate) && candidate.context === param.callback.release).length;
|
|
1720
206
|
if (hasInnerContext !== (outerContexts === 1)) {
|
|
1721
|
-
errors.push({
|
|
207
|
+
errors.push({
|
|
208
|
+
message: `FFI release "${entry.name}:${param.callback.release}" has inconsistent context slots`,
|
|
209
|
+
loc: moduleLoc,
|
|
210
|
+
});
|
|
1722
211
|
}
|
|
1723
212
|
}
|
|
1724
213
|
}
|
|
@@ -1731,14 +220,23 @@ export function validateModule(mod) {
|
|
|
1731
220
|
for (const e of mod.lib.exports) {
|
|
1732
221
|
const fn = functionsByName.get(e.fnName);
|
|
1733
222
|
if (!fn) {
|
|
1734
|
-
errors.push({
|
|
223
|
+
errors.push({
|
|
224
|
+
message: `library export "${e.symbol}": missing function "${e.fnName}"`,
|
|
225
|
+
loc: entryLoc,
|
|
226
|
+
});
|
|
1735
227
|
continue;
|
|
1736
228
|
}
|
|
1737
229
|
if (fn.async === true || fn.generator !== undefined) {
|
|
1738
|
-
errors.push({
|
|
230
|
+
errors.push({
|
|
231
|
+
message: `library export "${e.symbol}": "${e.fnName}" is async/generator`,
|
|
232
|
+
loc: fn.loc,
|
|
233
|
+
});
|
|
1739
234
|
}
|
|
1740
235
|
if (fn.captures !== undefined) {
|
|
1741
|
-
errors.push({
|
|
236
|
+
errors.push({
|
|
237
|
+
message: `library export "${e.symbol}": "${e.fnName}" captures an environment`,
|
|
238
|
+
loc: fn.loc,
|
|
239
|
+
});
|
|
1742
240
|
}
|
|
1743
241
|
if (fn.params.length !== e.params.length) {
|
|
1744
242
|
errors.push({
|
|
@@ -1770,27 +268,39 @@ export function validateModule(mod) {
|
|
|
1770
268
|
}
|
|
1771
269
|
}
|
|
1772
270
|
if (!functionsByName.has(mod.entry)) {
|
|
1773
|
-
errors.push({
|
|
271
|
+
errors.push({
|
|
272
|
+
message: `library module missing its entry function "${mod.entry}"`,
|
|
273
|
+
loc: entryLoc,
|
|
274
|
+
});
|
|
1774
275
|
}
|
|
1775
276
|
// Host-callback channels: the register symbol and the channel list are
|
|
1776
277
|
// paired (the profile loader refuses otherwise, so a miss here is a
|
|
1777
278
|
// compiler bug), slots are the declaration order, and every channel
|
|
1778
279
|
// has its matching ffiImport (the lowering recognizes calls by it).
|
|
1779
280
|
const cbs = mod.lib.callbacks ?? [];
|
|
1780
|
-
if (
|
|
1781
|
-
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
|
+
});
|
|
1782
286
|
}
|
|
1783
287
|
const cbNames = new Set();
|
|
1784
288
|
cbs.forEach((cb, i) => {
|
|
1785
289
|
if (cb.slot !== i) {
|
|
1786
|
-
errors.push({
|
|
290
|
+
errors.push({
|
|
291
|
+
message: `library callback "${cb.name}": slot ${cb.slot} out of declaration order (expected ${i})`,
|
|
292
|
+
loc: entryLoc,
|
|
293
|
+
});
|
|
1787
294
|
}
|
|
1788
295
|
if (cbNames.has(cb.name)) {
|
|
1789
296
|
errors.push({ message: `duplicate library callback channel "${cb.name}"`, loc: entryLoc });
|
|
1790
297
|
}
|
|
1791
298
|
cbNames.add(cb.name);
|
|
1792
299
|
if (!(mod.ffiImports ?? []).some((f) => f.name === cb.name)) {
|
|
1793
|
-
errors.push({
|
|
300
|
+
errors.push({
|
|
301
|
+
message: `library callback "${cb.name}" has no matching ffiImport`,
|
|
302
|
+
loc: entryLoc,
|
|
303
|
+
});
|
|
1794
304
|
}
|
|
1795
305
|
});
|
|
1796
306
|
}
|
|
@@ -1802,49 +312,81 @@ export function validateModule(mod) {
|
|
|
1802
312
|
}
|
|
1803
313
|
classesByName.set(cls.name, cls);
|
|
1804
314
|
if (cls.localCaptures !== undefined && (cls.runtime || cls.genericOf !== undefined)) {
|
|
1805
|
-
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
|
+
});
|
|
1806
319
|
}
|
|
1807
320
|
if (cls.localCaptures !== undefined) {
|
|
1808
321
|
const environment = cls.fields.find((field) => field.name === `%classEnvironment:${cls.name}`);
|
|
1809
322
|
if (environment?.type.kind !== "classval" || environment.type.className !== cls.name) {
|
|
1810
|
-
errors.push({
|
|
323
|
+
errors.push({
|
|
324
|
+
message: `class ${cls.name}: local class requires its constructor environment field`,
|
|
325
|
+
loc: cls.loc,
|
|
326
|
+
});
|
|
1811
327
|
}
|
|
1812
328
|
}
|
|
1813
329
|
if (cls.localBaseCapture !== undefined) {
|
|
1814
330
|
const base = cls.localCaptures?.[cls.localBaseCapture];
|
|
1815
|
-
if (!Number.isInteger(cls.localBaseCapture) ||
|
|
331
|
+
if (!Number.isInteger(cls.localBaseCapture) ||
|
|
332
|
+
base?.type.kind !== "classval" ||
|
|
333
|
+
base.type.className !== cls.base) {
|
|
1816
334
|
errors.push({ message: `class ${cls.name}: invalid local base capture`, loc: cls.loc });
|
|
1817
335
|
}
|
|
1818
336
|
}
|
|
1819
337
|
if (cls.baseValueGlobal !== undefined) {
|
|
1820
338
|
const global = mod.globals?.find((global) => global.id === cls.baseValueGlobal);
|
|
1821
|
-
if (cls.localBaseCapture !== undefined ||
|
|
339
|
+
if (cls.localBaseCapture !== undefined ||
|
|
340
|
+
!cls.base ||
|
|
341
|
+
global?.type.kind !== "classval" ||
|
|
342
|
+
global.type.className !== cls.base) {
|
|
1822
343
|
errors.push({ message: `class ${cls.name}: invalid computed base global`, loc: cls.loc });
|
|
1823
344
|
}
|
|
1824
345
|
}
|
|
1825
346
|
if (cls.jsLength !== undefined && (!Number.isSafeInteger(cls.jsLength) || cls.jsLength < 0)) {
|
|
1826
347
|
errors.push({ message: `class ${cls.name}: invalid constructor length`, loc: cls.loc });
|
|
1827
348
|
}
|
|
1828
|
-
if (cls.tracksOwnFields &&
|
|
1829
|
-
|
|
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
|
+
});
|
|
1830
356
|
}
|
|
1831
357
|
if (cls.prototypeDataHelper !== undefined) {
|
|
1832
358
|
const helper = functionsByName.get(cls.prototypeDataHelper);
|
|
1833
|
-
if (!helper ||
|
|
1834
|
-
|
|
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
|
+
});
|
|
1835
368
|
}
|
|
1836
369
|
}
|
|
1837
370
|
if (cls.instancePrototypeHelper !== undefined) {
|
|
1838
371
|
const helper = functionsByName.get(cls.instancePrototypeHelper);
|
|
1839
372
|
const receiver = helper?.params[0]?.type;
|
|
1840
|
-
if (!helper ||
|
|
1841
|
-
helper.
|
|
1842
|
-
|
|
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
|
+
});
|
|
1843
384
|
}
|
|
1844
385
|
}
|
|
1845
386
|
for (const symbol of cls.symbolFields ?? []) {
|
|
1846
387
|
const global = mod.globals?.find((global) => global.id === symbol.globalId);
|
|
1847
|
-
if (global?.type.kind !== "symbol" ||
|
|
388
|
+
if (global?.type.kind !== "symbol" ||
|
|
389
|
+
!cls.fields.some((field) => field.name === symbol.field)) {
|
|
1848
390
|
errors.push({ message: `class ${cls.name}: invalid symbol field metadata`, loc: cls.loc });
|
|
1849
391
|
}
|
|
1850
392
|
}
|
|
@@ -1858,7 +400,10 @@ export function validateModule(mod) {
|
|
|
1858
400
|
else
|
|
1859
401
|
seen.set(f.name, f.type);
|
|
1860
402
|
if (isUnitType(f.type)) {
|
|
1861
|
-
errors.push({
|
|
403
|
+
errors.push({
|
|
404
|
+
message: `class ${cls.name}: field "${f.name}" is ${f.type.kind}`,
|
|
405
|
+
loc: cls.loc,
|
|
406
|
+
});
|
|
1862
407
|
}
|
|
1863
408
|
}
|
|
1864
409
|
// Duplicate class names, like classesByName, select the last declaration.
|
|
@@ -1873,10 +418,16 @@ export function validateModule(mod) {
|
|
|
1873
418
|
// module function exists for them (and must not).
|
|
1874
419
|
for (const m of cls.abstractMethods ?? []) {
|
|
1875
420
|
if (!cls.methods?.includes(m)) {
|
|
1876
|
-
errors.push({
|
|
421
|
+
errors.push({
|
|
422
|
+
message: `class ${cls.name}: abstract method "${m}" not in methods`,
|
|
423
|
+
loc: cls.loc,
|
|
424
|
+
});
|
|
1877
425
|
}
|
|
1878
426
|
if (functionsByName.has(`%${cls.name}.${m}`)) {
|
|
1879
|
-
errors.push({
|
|
427
|
+
errors.push({
|
|
428
|
+
message: `class ${cls.name}: abstract method "${m}" has a function`,
|
|
429
|
+
loc: cls.loc,
|
|
430
|
+
});
|
|
1880
431
|
}
|
|
1881
432
|
}
|
|
1882
433
|
for (const m of cls.methods ?? []) {
|
|
@@ -1898,8 +449,13 @@ export function validateModule(mod) {
|
|
|
1898
449
|
errors.push({ message: `class ${cls.name}: undeclared base "${cls.base}"`, loc: cls.loc });
|
|
1899
450
|
continue;
|
|
1900
451
|
}
|
|
1901
|
-
if (base.localCaptures !== undefined &&
|
|
1902
|
-
|
|
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
|
+
});
|
|
1903
459
|
}
|
|
1904
460
|
const seen = new Set([cls.name]);
|
|
1905
461
|
for (let c = base; c; c = c.base !== undefined ? classesByName.get(c.base) : undefined) {
|
|
@@ -1924,7 +480,10 @@ export function validateModule(mod) {
|
|
|
1924
480
|
continue;
|
|
1925
481
|
const family = classesByName.get(cls.genericOf);
|
|
1926
482
|
if (!family) {
|
|
1927
|
-
errors.push({
|
|
483
|
+
errors.push({
|
|
484
|
+
message: `class ${cls.name}: undeclared generic family "${cls.genericOf}"`,
|
|
485
|
+
loc: cls.loc,
|
|
486
|
+
});
|
|
1928
487
|
continue;
|
|
1929
488
|
}
|
|
1930
489
|
let ancestor = false;
|
|
@@ -1937,7 +496,10 @@ export function validateModule(mod) {
|
|
|
1937
496
|
}
|
|
1938
497
|
}
|
|
1939
498
|
if (!ancestor) {
|
|
1940
|
-
errors.push({
|
|
499
|
+
errors.push({
|
|
500
|
+
message: `class ${cls.name}: generic family "${cls.genericOf}" is not an ancestor`,
|
|
501
|
+
loc: cls.loc,
|
|
502
|
+
});
|
|
1941
503
|
}
|
|
1942
504
|
}
|
|
1943
505
|
const noLoc = { file: mod.sourceFile, start: 0, end: 0 };
|
|
@@ -1960,7 +522,10 @@ export function validateModule(mod) {
|
|
|
1960
522
|
// unit field is as malformed as a void one. dyn and jsval slots
|
|
1961
523
|
// are valid; both are refcounted values held by the record shape.
|
|
1962
524
|
if (f.type.kind === "void" || isUnitType(f.type)) {
|
|
1963
|
-
errors.push({
|
|
525
|
+
errors.push({
|
|
526
|
+
message: `record ${rec.id}: field "${f.name}" is ${f.type.kind}`,
|
|
527
|
+
loc: noLoc,
|
|
528
|
+
});
|
|
1964
529
|
}
|
|
1965
530
|
if (f.type.kind === "record" && !recordIds.has(f.type.shapeId)) {
|
|
1966
531
|
errors.push({
|
|
@@ -1974,13 +539,18 @@ export function validateModule(mod) {
|
|
|
1974
539
|
// shapes share one index. All indexes belong to this validation call.
|
|
1975
540
|
recordValidation.set(rec.id, {
|
|
1976
541
|
fields,
|
|
1977
|
-
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])),
|
|
1978
545
|
hasAccessorSlots: shapeHasAccessorSlots(rec),
|
|
1979
546
|
});
|
|
1980
547
|
// Canonical order is the shape's identity — enforce it.
|
|
1981
548
|
const sorted = [...rec.fields].map((f) => f.name).sort();
|
|
1982
549
|
if (rec.fields.some((f, i) => f.name !== sorted[i])) {
|
|
1983
|
-
errors.push({
|
|
550
|
+
errors.push({
|
|
551
|
+
message: `record ${rec.id}: fields are not in canonical (sorted) order`,
|
|
552
|
+
loc: noLoc,
|
|
553
|
+
});
|
|
1984
554
|
}
|
|
1985
555
|
// Tuple shapes carry exactly the positional fields "0".."n-1" (arity =
|
|
1986
556
|
// field count) — anything else has no honest index/JSON story.
|
|
@@ -1993,13 +563,17 @@ export function validateModule(mod) {
|
|
|
1993
563
|
break;
|
|
1994
564
|
}
|
|
1995
565
|
}
|
|
1996
|
-
if (rec.fields.length === 0 ||
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
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
|
+
});
|
|
2000
571
|
}
|
|
2001
572
|
if (rec.indexValue) {
|
|
2002
|
-
errors.push({
|
|
573
|
+
errors.push({
|
|
574
|
+
message: `record ${rec.id}: a tuple cannot carry an index signature`,
|
|
575
|
+
loc: noLoc,
|
|
576
|
+
});
|
|
2003
577
|
}
|
|
2004
578
|
}
|
|
2005
579
|
// Index-signature shapes: the overflow value type is fenced to the map
|
|
@@ -2030,12 +604,21 @@ export function validateModule(mod) {
|
|
|
2030
604
|
const arm = u.arms[candidate.tag];
|
|
2031
605
|
const record = arm?.kind === "record" ? recordsById.get(arm.shapeId) : undefined;
|
|
2032
606
|
const member = record ? recordValidation.get(record.id)?.fields.get(field) : undefined;
|
|
2033
|
-
if (!Number.isInteger(candidate.tag) ||
|
|
2034
|
-
|
|
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
|
+
});
|
|
2035
615
|
}
|
|
2036
616
|
tags.add(candidate.tag);
|
|
2037
617
|
if (candidate.values.length === 0) {
|
|
2038
|
-
errors.push({
|
|
618
|
+
errors.push({
|
|
619
|
+
message: `union ${u.id}: empty discriminant values for tag ${candidate.tag}`,
|
|
620
|
+
loc: noLoc,
|
|
621
|
+
});
|
|
2039
622
|
}
|
|
2040
623
|
for (const value of candidate.values) {
|
|
2041
624
|
if (value === undefined) {
|
|
@@ -2043,20 +626,31 @@ export function validateModule(mod) {
|
|
|
2043
626
|
continue;
|
|
2044
627
|
}
|
|
2045
628
|
const fieldTypes = member?.kind === "union"
|
|
2046
|
-
? unionsById.get(member.unionId)?.arms ?? []
|
|
2047
|
-
|
|
2048
|
-
|
|
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"
|
|
2049
637
|
: typeof value === "number" && Number.isFinite(value) && type.kind === "f64");
|
|
2050
638
|
const key = typeof value + ":" + String(value);
|
|
2051
639
|
if (!valid || values.has(key)) {
|
|
2052
|
-
errors.push({
|
|
640
|
+
errors.push({
|
|
641
|
+
message: `union ${u.id}: invalid or repeated discriminant value ${key}`,
|
|
642
|
+
loc: noLoc,
|
|
643
|
+
});
|
|
2053
644
|
}
|
|
2054
645
|
values.add(key);
|
|
2055
646
|
}
|
|
2056
647
|
}
|
|
2057
648
|
for (let tag = 0; tag < u.arms.length; tag++) {
|
|
2058
649
|
if (u.arms[tag].kind === "record" && !tags.has(tag)) {
|
|
2059
|
-
errors.push({
|
|
650
|
+
errors.push({
|
|
651
|
+
message: `union ${u.id}: missing discriminant for record arm ${tag}`,
|
|
652
|
+
loc: noLoc,
|
|
653
|
+
});
|
|
2060
654
|
}
|
|
2061
655
|
}
|
|
2062
656
|
}
|
|
@@ -2075,7 +669,10 @@ export function validateModule(mod) {
|
|
|
2075
669
|
}
|
|
2076
670
|
if ((arm.kind === "map" || arm.kind === "set" || arm.kind === "promise") &&
|
|
2077
671
|
!unionContainerArmsOk(u.arms)) {
|
|
2078
|
-
errors.push({
|
|
672
|
+
errors.push({
|
|
673
|
+
message: `union ${u.id}: ${arm.kind} arm ${i} beside non-unit arms`,
|
|
674
|
+
loc: noLoc,
|
|
675
|
+
});
|
|
2079
676
|
}
|
|
2080
677
|
if (arm.kind === "record" && !recordsById.has(arm.shapeId)) {
|
|
2081
678
|
errors.push({
|
|
@@ -2167,7 +764,10 @@ export function validateModule(mod) {
|
|
|
2167
764
|
};
|
|
2168
765
|
for (const g of mod.globals ?? []) {
|
|
2169
766
|
if (g.tdz && g.type.kind !== "record" && g.type.kind !== "func" && g.type.kind !== "dyn") {
|
|
2170
|
-
errors.push({
|
|
767
|
+
errors.push({
|
|
768
|
+
message: `TDZ global "${g.name}" must have record, function, or checked-value storage`,
|
|
769
|
+
loc: noLoc,
|
|
770
|
+
});
|
|
2171
771
|
}
|
|
2172
772
|
if (isUnitType(g.type)) {
|
|
2173
773
|
errors.push({ message: `global "${g.name}" has bare unit type ${g.type.kind}`, loc: noLoc });
|
|
@@ -2210,7 +810,9 @@ export function validateModule(mod) {
|
|
|
2210
810
|
// membership, and virtual-call resolution local to this validation invocation.
|
|
2211
811
|
const classValidation = {
|
|
2212
812
|
fields: classFields,
|
|
2213
|
-
hierarchy: new Set(),
|
|
813
|
+
hierarchy: new Set(),
|
|
814
|
+
implementations: new Map(),
|
|
815
|
+
virtualCalls: new Map(),
|
|
2214
816
|
};
|
|
2215
817
|
for (const cls of classesByName.values()) {
|
|
2216
818
|
if (cls.base !== undefined) {
|
|
@@ -2360,7 +962,9 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
2360
962
|
// Same-kind mismatches (func vs func, record vs record) would be
|
|
2361
963
|
// unreadable as bare kinds — the structural keys show WHERE the two
|
|
2362
964
|
// types diverge.
|
|
2363
|
-
const detail = want.kind === expr.type.kind
|
|
965
|
+
const detail = want.kind === expr.type.kind
|
|
966
|
+
? ` (expected ${typeKey(want)}, got ${typeKey(expr.type)})`
|
|
967
|
+
: "";
|
|
2364
968
|
err(`${what}: expected ${want.kind}, got ${expr.type.kind}${detail}`, expr.loc);
|
|
2365
969
|
}
|
|
2366
970
|
};
|
|
@@ -2459,8 +1063,12 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
2459
1063
|
continue;
|
|
2460
1064
|
}
|
|
2461
1065
|
if (e.kind === "logical") {
|
|
2462
|
-
if (e.type.kind !== "f64" &&
|
|
2463
|
-
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") {
|
|
2464
1072
|
err(`logical ${e.op} must be f64|string|bool|jsval|union|dyn, got ${e.type.kind}`, e.loc);
|
|
2465
1073
|
}
|
|
2466
1074
|
if (e.type.kind === "union")
|
|
@@ -2610,7 +1218,8 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
2610
1218
|
// procStream is the ONE non-f64 numLit: process.stdout/stderr as
|
|
2611
1219
|
// first-class values mint the stream's fd (1/2) as the scalar —
|
|
2612
1220
|
// the prefixStream idiom.
|
|
2613
|
-
if (e.type.kind !== "f64" &&
|
|
1221
|
+
if (e.type.kind !== "f64" &&
|
|
1222
|
+
!(e.type.kind === "procStream" && (e.value === 1 || e.value === 2))) {
|
|
2614
1223
|
err("numLit must be f64", e.loc);
|
|
2615
1224
|
}
|
|
2616
1225
|
break;
|
|
@@ -2777,7 +1386,22 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
2777
1386
|
// choose ARRAY_VALUE versus ARRAY_UNDEFINED before the final result
|
|
2778
1387
|
// is evaluated. Delegation also needs a local loop. Nested control
|
|
2779
1388
|
// flow is checked recursively; jumps still cannot leave the region.
|
|
2780
|
-
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
|
+
]);
|
|
2781
1405
|
if (e.generatorDelegate) {
|
|
2782
1406
|
if (!fn.generator || fn.async)
|
|
2783
1407
|
err("delegation sequence outside a synchronous generator", e.loc);
|
|
@@ -3018,7 +1642,8 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
3018
1642
|
if (!helper) {
|
|
3019
1643
|
err(`orDefault retag calls undeclared function "${e.retag}"`, e.loc);
|
|
3020
1644
|
}
|
|
3021
|
-
else if (helper.params.length !== 1 ||
|
|
1645
|
+
else if (helper.params.length !== 1 ||
|
|
1646
|
+
!typeEquals(helper.params[0].type, e.left.type)) {
|
|
3022
1647
|
err(`orDefault retag ${e.retag} must take exactly the left union`, e.loc);
|
|
3023
1648
|
}
|
|
3024
1649
|
else if (!typeEquals(callSiteReturnType(helper), e.type)) {
|
|
@@ -3043,8 +1668,12 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
3043
1668
|
if (!def) {
|
|
3044
1669
|
err(`toString of unknown union ${e.operand.type.unionId}`, e.loc);
|
|
3045
1670
|
}
|
|
3046
|
-
else if (!def.arms.every((a) => a.kind === "undefinedT" ||
|
|
3047
|
-
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" ||
|
|
3048
1677
|
(a.kind === "bytes" && a.elem === "u8"))) {
|
|
3049
1678
|
err("toString union operand has a non-stringable arm (frontend must fence)", e.loc);
|
|
3050
1679
|
}
|
|
@@ -3240,17 +1869,35 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
3240
1869
|
break;
|
|
3241
1870
|
}
|
|
3242
1871
|
const recv = e.receiver.type;
|
|
3243
|
-
// The
|
|
1872
|
+
// The DataView getters and setters use a bytes<u8>
|
|
3244
1873
|
// view; dataViewNew and byteOffset take ANY elem kind (views form
|
|
3245
1874
|
// over any typed array's storage, owners answer byteOffset 0).
|
|
3246
|
-
const
|
|
3247
|
-
const isNum = e.method === "readNum" ||
|
|
1875
|
+
const isDv = e.method.startsWith("dvGet") || e.method.startsWith("dvSet");
|
|
1876
|
+
const isNum = e.method === "readNum" ||
|
|
1877
|
+
e.method === "writeNum" ||
|
|
1878
|
+
e.method === "readNumVar" ||
|
|
1879
|
+
e.method === "writeNumVar";
|
|
3248
1880
|
const U8_ONLY_EXTRA = new Set([
|
|
3249
|
-
"toString",
|
|
3250
|
-
"
|
|
3251
|
-
"
|
|
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",
|
|
3252
1899
|
]);
|
|
3253
|
-
const u8Only = U8_ONLY_EXTRA.has(e.method) || isNum ||
|
|
1900
|
+
const u8Only = U8_ONLY_EXTRA.has(e.method) || isNum || isDv;
|
|
3254
1901
|
if (u8Only && recv.elem !== "u8") {
|
|
3255
1902
|
err(`bytesIntrinsic ${e.method} on a ${recv.elem} receiver (u8 only)`, e.loc);
|
|
3256
1903
|
}
|
|
@@ -3260,6 +1907,11 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
3260
1907
|
if (isNum && e.args[0]?.kind !== "strLit") {
|
|
3261
1908
|
err(`bytesIntrinsic ${e.method} args[0] must be a strLit kind token`, e.loc);
|
|
3262
1909
|
}
|
|
1910
|
+
else if (isNum &&
|
|
1911
|
+
e.args[0]?.kind === "strLit" &&
|
|
1912
|
+
!validByteNumberToken(e.method, e.args[0].value)) {
|
|
1913
|
+
err(`bytesIntrinsic ${e.method} invalid kind token '${e.args[0].value}'`, e.loc);
|
|
1914
|
+
}
|
|
3263
1915
|
// fillStr/writeStr carry their NORMALIZED encoding as args[1],
|
|
3264
1916
|
// always a strLit (the frontend folds the aliases).
|
|
3265
1917
|
if ((e.method === "fillStr" || e.method === "writeStr") && e.args[1]?.kind !== "strLit") {
|
|
@@ -3293,49 +1945,61 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
3293
1945
|
// Object.hasOwn: "toString" is a real method name here and must
|
|
3294
1946
|
// not answer from Object.prototype.
|
|
3295
1947
|
const extraSig = Object.hasOwn(EXTRA_SIGS, e.method) ? EXTRA_SIGS[e.method] : undefined;
|
|
3296
|
-
const sig = extraSig ??
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
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"
|
|
3319
1979
|
? { argTypes: [STRING, F64, F64], minArgs: 3, result: F64 }
|
|
3320
|
-
: e.method === "
|
|
3321
|
-
? { argTypes: [STRING, F64, F64
|
|
3322
|
-
: e.method === "
|
|
3323
|
-
? { argTypes: [F64, F64], minArgs:
|
|
3324
|
-
: e.method
|
|
3325
|
-
? {
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
:
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
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
|
+
});
|
|
3339
2003
|
if (e.args.length < sig.minArgs || e.args.length > sig.argTypes.length) {
|
|
3340
2004
|
err(`bytesIntrinsic ${e.method}: ${e.args.length} args`, e.loc);
|
|
3341
2005
|
}
|
|
@@ -3357,47 +2021,64 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
3357
2021
|
break;
|
|
3358
2022
|
}
|
|
3359
2023
|
const elem = e.receiver.type.elem;
|
|
3360
|
-
const sig = e.method === "
|
|
3361
|
-
? { argTypes:
|
|
3362
|
-
: e.method === "
|
|
3363
|
-
? { argTypes: [
|
|
3364
|
-
: e.method === "
|
|
3365
|
-
? { argTypes: [F64], result:
|
|
3366
|
-
: e.method === "
|
|
3367
|
-
? { argTypes:
|
|
3368
|
-
: e.method === "
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
:
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
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
|
|
3397
2075
|
if (e.method === "getNumber" && elem.kind !== "f64") {
|
|
3398
2076
|
err(`arrIntrinsic getNumber requires f64 elements, got ${elem.kind}`, e.loc);
|
|
3399
2077
|
}
|
|
3400
|
-
if (e.method === "indexEq" &&
|
|
2078
|
+
if (e.method === "indexEq" &&
|
|
2079
|
+
elem.kind !== "f64" &&
|
|
2080
|
+
elem.kind !== "bool" &&
|
|
2081
|
+
elem.kind !== "string") {
|
|
3401
2082
|
err(`arrIntrinsic indexEq requires primitive elements, got ${elem.kind}`, e.loc);
|
|
3402
2083
|
}
|
|
3403
2084
|
if (e.method === "flatCopy" && !typeEquals(e.type, e.receiver.type)) {
|
|
@@ -3407,7 +2088,9 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
3407
2088
|
err("arrIntrinsic flatOne result must match the nested array type", e.loc);
|
|
3408
2089
|
}
|
|
3409
2090
|
if (e.method === "join" &&
|
|
3410
|
-
elem.kind !== "f64" &&
|
|
2091
|
+
elem.kind !== "f64" &&
|
|
2092
|
+
elem.kind !== "string" &&
|
|
2093
|
+
elem.kind !== "bool" &&
|
|
3411
2094
|
!(elem.kind === "union" &&
|
|
3412
2095
|
(unions
|
|
3413
2096
|
.get(elem.unionId)
|
|
@@ -3420,11 +2103,14 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
3420
2103
|
// misjudge JS ===; the frontend fences these.
|
|
3421
2104
|
err(`arrIntrinsic ${e.method} on union elements (frontend must reject)`, e.loc);
|
|
3422
2105
|
}
|
|
3423
|
-
if ((e.method === "shift" || e.method === "pop") &&
|
|
2106
|
+
if ((e.method === "shift" || e.method === "pop") &&
|
|
2107
|
+
!(elem.kind === "dyn" && e.type.kind === "dyn")) {
|
|
3424
2108
|
const rdef = e.type.kind === "union" ? unions.get(e.type.unionId) : undefined;
|
|
3425
2109
|
if (!rdef ||
|
|
3426
2110
|
!rdef.arms.some((arm) => arm.kind === "undefinedT") ||
|
|
3427
|
-
!(elem.kind === "union"
|
|
2111
|
+
!(elem.kind === "union"
|
|
2112
|
+
? typeEquals(elem, e.type)
|
|
2113
|
+
: rdef.arms.some((arm) => typeEquals(arm, elem)))) {
|
|
3428
2114
|
err(`arrIntrinsic ${e.method} result must be the elem|undefined union`, e.loc);
|
|
3429
2115
|
}
|
|
3430
2116
|
}
|
|
@@ -3514,19 +2200,30 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
3514
2200
|
}
|
|
3515
2201
|
break;
|
|
3516
2202
|
}
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3528
|
-
|
|
3529
|
-
|
|
2203
|
+
if (e.method === "valueSet" &&
|
|
2204
|
+
!isSupportedSetElem(value, value.kind === "union" ? unions.get(value.unionId)?.arms : undefined)) {
|
|
2205
|
+
err(`mapIntrinsic valueSet element kind ${value.kind} (frontend must fence)`, e.loc);
|
|
2206
|
+
}
|
|
2207
|
+
const sig = e.method === "clone"
|
|
2208
|
+
? { argTypes: [], result: e.receiver.type }
|
|
2209
|
+
: e.method === "keySet" || e.method === "valueSet"
|
|
2210
|
+
? {
|
|
2211
|
+
argTypes: [],
|
|
2212
|
+
result: { kind: "set", elem: e.method === "keySet" ? key : value },
|
|
2213
|
+
}
|
|
2214
|
+
: e.method === "set"
|
|
2215
|
+
? { argTypes: [key, value], result: VOID }
|
|
2216
|
+
: e.method === "has" || e.method === "delete"
|
|
2217
|
+
? { argTypes: [key], result: BOOL }
|
|
2218
|
+
: e.method === "clear" || e.method === "iterEnter" || e.method === "iterExit"
|
|
2219
|
+
? { argTypes: [], result: VOID }
|
|
2220
|
+
: e.method === "iterLive"
|
|
2221
|
+
? { argTypes: [F64], result: BOOL }
|
|
2222
|
+
: e.method === "iterKey"
|
|
2223
|
+
? { argTypes: [F64], result: key }
|
|
2224
|
+
: e.method === "iterValue"
|
|
2225
|
+
? { argTypes: [F64], result: value }
|
|
2226
|
+
: { argTypes: [], result: F64 }; // size / iterCount
|
|
3530
2227
|
if (e.args.length !== sig.argTypes.length) {
|
|
3531
2228
|
err(`mapIntrinsic ${e.method}: ${e.args.length} args, expected ${sig.argTypes.length}`, e.loc);
|
|
3532
2229
|
}
|
|
@@ -3563,19 +2260,21 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
3563
2260
|
break;
|
|
3564
2261
|
}
|
|
3565
2262
|
const { elem } = e.receiver.type;
|
|
3566
|
-
const sig = e.method === "
|
|
3567
|
-
? { argTypes: [
|
|
3568
|
-
: e.method === "
|
|
3569
|
-
? { argTypes: [elem], result:
|
|
3570
|
-
: e.method === "
|
|
3571
|
-
? { argTypes: [], result:
|
|
3572
|
-
: e.method === "
|
|
3573
|
-
? { argTypes: [
|
|
3574
|
-
: e.method === "
|
|
3575
|
-
? { argTypes: [F64], result:
|
|
3576
|
-
: e.method === "
|
|
3577
|
-
? { argTypes: [], result:
|
|
3578
|
-
:
|
|
2263
|
+
const sig = e.method === "clone"
|
|
2264
|
+
? { argTypes: [], result: e.receiver.type }
|
|
2265
|
+
: e.method === "add"
|
|
2266
|
+
? { argTypes: [elem], result: VOID }
|
|
2267
|
+
: e.method === "has" || e.method === "delete"
|
|
2268
|
+
? { argTypes: [elem], result: BOOL }
|
|
2269
|
+
: e.method === "clear" || e.method === "iterEnter" || e.method === "iterExit"
|
|
2270
|
+
? { argTypes: [], result: VOID }
|
|
2271
|
+
: e.method === "iterLive"
|
|
2272
|
+
? { argTypes: [F64], result: BOOL }
|
|
2273
|
+
: e.method === "iterKey"
|
|
2274
|
+
? { argTypes: [F64], result: elem }
|
|
2275
|
+
: e.method === "toArray"
|
|
2276
|
+
? { argTypes: [], result: arrayOf(elem) }
|
|
2277
|
+
: { argTypes: [], result: F64 }; // size / iterCount
|
|
3579
2278
|
if (e.args.length !== sig.argTypes.length) {
|
|
3580
2279
|
err(`setIntrinsic ${e.method}: ${e.args.length} args, expected ${sig.argTypes.length}`, e.loc);
|
|
3581
2280
|
}
|
|
@@ -3911,7 +2610,8 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
3911
2610
|
// word to read; a standalone target class has one possible value
|
|
3912
2611
|
// and the frontend folds it statically.
|
|
3913
2612
|
if (classes.get(e.classValue.type.className)?.localCaptures !== undefined &&
|
|
3914
|
-
e.value.type.kind === "object" &&
|
|
2613
|
+
e.value.type.kind === "object" &&
|
|
2614
|
+
classes.get(e.value.type.className)?.localCaptures !== undefined)
|
|
3915
2615
|
break;
|
|
3916
2616
|
if (!hierarchy.has(e.classValue.type.className)) {
|
|
3917
2617
|
err(`instanceOfValue against standalone class "${e.classValue.type.className}"`, e.loc);
|
|
@@ -4102,12 +2802,14 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4102
2802
|
// literal key naming no declared field) skip the declared check
|
|
4103
2803
|
// and require the overflow to exist.
|
|
4104
2804
|
const surfaces = (t) => typeEquals(t, e.type) ||
|
|
4105
|
-
(e.type.kind === "union" &&
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
(!!
|
|
4110
|
-
|
|
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
|
+
})()) ||
|
|
4111
2813
|
e.type.kind === "dyn";
|
|
4112
2814
|
if (e.overflowOnly && !shape.indexValue) {
|
|
4113
2815
|
err(`recordKeyGet on ${e.shapeId}: overflowOnly read of a shape without an index signature`, e.loc);
|
|
@@ -4318,7 +3020,8 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4318
3020
|
expectType(e.value, { kind: "dyn" }, "dynTest operand");
|
|
4319
3021
|
if (e.type.kind !== "bool")
|
|
4320
3022
|
err("dynTest must be bool", e.loc);
|
|
4321
|
-
if (e.bytesElem !== undefined &&
|
|
3023
|
+
if (e.bytesElem !== undefined &&
|
|
3024
|
+
(e.test !== "bytes" || !Object.hasOwn(BYTES_ELEMENT_NAME, e.bytesElem))) {
|
|
4322
3025
|
err("dynTest bytesElem requires a valid bytes test", e.loc);
|
|
4323
3026
|
}
|
|
4324
3027
|
break;
|
|
@@ -4396,7 +3099,9 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4396
3099
|
checkExpr(e.value);
|
|
4397
3100
|
expectType(e.value, { kind: "caught" }, "caughtNarrow operand");
|
|
4398
3101
|
const t = e.type;
|
|
4399
|
-
const ok = t.kind === "f64" ||
|
|
3102
|
+
const ok = t.kind === "f64" ||
|
|
3103
|
+
t.kind === "bool" ||
|
|
3104
|
+
t.kind === "string" ||
|
|
4400
3105
|
(t.kind === "object" && hierarchy.has(t.className));
|
|
4401
3106
|
if (!ok) {
|
|
4402
3107
|
err(`caughtNarrow to ${t.kind === "object" ? `non-hierarchy class "${t.className}"` : t.kind}`, e.loc);
|
|
@@ -4484,11 +3189,14 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4484
3189
|
// non-unit arms have no keyed read at all. Number keys read ARRAY
|
|
4485
3190
|
// arms; string keys read RECORD arms.
|
|
4486
3191
|
const resultUnion = e.type.kind === "union" ? unions.get(e.type.unionId) : undefined;
|
|
4487
|
-
const surfaces = (t) => typeEquals(t, e.type) ||
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
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
|
+
})());
|
|
4492
3200
|
def.arms.forEach((arm, i) => {
|
|
4493
3201
|
if (arm.kind === "undefinedT" || arm.kind === "nullT") {
|
|
4494
3202
|
if (!resultUnion?.arms.some((a) => a.kind === "undefinedT")) {
|
|
@@ -4666,25 +3374,32 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4666
3374
|
// The stream constructors (trailing option callbacks), write/end
|
|
4667
3375
|
// (the optional chunk/cb tail), and unpipe (the optional
|
|
4668
3376
|
// destination) admit a longer list the same way.
|
|
4669
|
-
const variadic = e.fn === "emitter.emit" ||
|
|
4670
|
-
e.fn === "
|
|
4671
|
-
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" ||
|
|
4672
3383
|
e.fn === "passthrough.new" ||
|
|
4673
|
-
e.fn === "readable.init" ||
|
|
4674
|
-
e.fn === "
|
|
3384
|
+
e.fn === "readable.init" ||
|
|
3385
|
+
e.fn === "writable.init" ||
|
|
3386
|
+
e.fn === "duplex.init" ||
|
|
3387
|
+
e.fn === "transform.init" ||
|
|
4675
3388
|
e.fn === "passthrough.init" ||
|
|
4676
|
-
e.fn === "readable.initDyn" ||
|
|
4677
|
-
e.fn === "
|
|
3389
|
+
e.fn === "readable.initDyn" ||
|
|
3390
|
+
e.fn === "writable.initDyn" ||
|
|
3391
|
+
e.fn === "duplex.initDyn" ||
|
|
3392
|
+
e.fn === "transform.initDyn" ||
|
|
4678
3393
|
e.fn === "passthrough.initDyn" ||
|
|
4679
|
-
e.fn === "stream.pipeline" ||
|
|
3394
|
+
e.fn === "stream.pipeline" ||
|
|
3395
|
+
e.fn === "stream.pipelineDyn" ||
|
|
4680
3396
|
e.fn === "sp.pipeline" ||
|
|
4681
3397
|
e.fn === "writable.write" ||
|
|
4682
|
-
e.fn === "writable.writeStr" ||
|
|
3398
|
+
e.fn === "writable.writeStr" ||
|
|
3399
|
+
e.fn === "writable.writeU" ||
|
|
4683
3400
|
e.fn === "writable.end" ||
|
|
4684
3401
|
e.fn === "readable.unpipe";
|
|
4685
|
-
if (variadic
|
|
4686
|
-
? e.args.length < sig.argTypes.length
|
|
4687
|
-
: e.args.length !== sig.argTypes.length) {
|
|
3402
|
+
if (variadic ? e.args.length < sig.argTypes.length : e.args.length !== sig.argTypes.length) {
|
|
4688
3403
|
err(`libCall ${e.fn}: ${e.args.length} args, expected ${sig.argTypes.length}`, e.loc);
|
|
4689
3404
|
}
|
|
4690
3405
|
e.args.forEach((a, i) => {
|
|
@@ -4707,7 +3422,12 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4707
3422
|
return;
|
|
4708
3423
|
if (checkLibEmitterCall(e, sig.result))
|
|
4709
3424
|
return;
|
|
4710
|
-
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") {
|
|
4711
3431
|
const recv = e.args[0];
|
|
4712
3432
|
let cls = recv?.type.kind === "object" ? classes.get(recv.type.className) : undefined;
|
|
4713
3433
|
while (cls?.base)
|
|
@@ -4730,7 +3450,11 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4730
3450
|
}
|
|
4731
3451
|
}
|
|
4732
3452
|
function checkLibValueCall(e) {
|
|
4733
|
-
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") {
|
|
4734
3458
|
const inner = e.type.kind === "promise" ? e.type.inner : undefined;
|
|
4735
3459
|
const shape = inner?.kind === "record" ? records.get(inner.shapeId) : undefined;
|
|
4736
3460
|
const countName = e.fn === "fileHandle.read" || e.fn === "fileHandle.readv" ? "bytesRead" : "bytesWritten";
|
|
@@ -4738,8 +3462,13 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4738
3462
|
const payload = e.args[1]?.type;
|
|
4739
3463
|
const count = shape ? recordValidation.get(shape.id)?.fields.get(countName) : undefined;
|
|
4740
3464
|
const buffer = shape ? recordValidation.get(shape.id)?.fields.get(payloadName) : undefined;
|
|
4741
|
-
const ok = shape !== undefined &&
|
|
4742
|
-
|
|
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 &&
|
|
4743
3472
|
typeEquals(buffer, payload);
|
|
4744
3473
|
if (!ok) {
|
|
4745
3474
|
err(`libCall ${e.fn} must return a promise of { ${countName}: number, ${payloadName} }`, e.loc);
|
|
@@ -4769,8 +3498,7 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4769
3498
|
const inner = e.type.kind === "promise" ? e.type.inner : null;
|
|
4770
3499
|
const union = inner?.kind === "union" ? unions.get(inner.unionId) : undefined;
|
|
4771
3500
|
if (inner === null ||
|
|
4772
|
-
(!typeEquals(inner, valueType) &&
|
|
4773
|
-
!union?.arms.some((arm) => typeEquals(arm, valueType)))) {
|
|
3501
|
+
(!typeEquals(inner, valueType) && !union?.arms.some((arm) => typeEquals(arm, valueType)))) {
|
|
4774
3502
|
err(`libCall ${e.fn} must return a promise whose value includes ${valueType.kind}`, e.loc);
|
|
4775
3503
|
}
|
|
4776
3504
|
return true;
|
|
@@ -4846,7 +3574,8 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4846
3574
|
}
|
|
4847
3575
|
if (e.fn === "http2.serverOnSessionError") {
|
|
4848
3576
|
const cbT = e.args[1]?.type;
|
|
4849
|
-
const ok = cbT?.kind === "func" &&
|
|
3577
|
+
const ok = cbT?.kind === "func" &&
|
|
3578
|
+
cbT.ret.kind === "void" &&
|
|
4850
3579
|
cbT.params.length <= 2 &&
|
|
4851
3580
|
(cbT.params[0] === undefined ||
|
|
4852
3581
|
(cbT.params[0].kind === "object" && cbT.params[0].className === "%Error")) &&
|
|
@@ -4919,16 +3648,24 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4919
3648
|
}
|
|
4920
3649
|
return true;
|
|
4921
3650
|
}
|
|
4922
|
-
if (e.fn === "http.requestCb" ||
|
|
4923
|
-
e.fn === "
|
|
4924
|
-
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" ||
|
|
4925
3657
|
e.fn === "https.requestUrlCb") {
|
|
4926
3658
|
// The response listener: void, no params or exactly (res: httpReq).
|
|
4927
|
-
const cbT = e.args[e.fn === "http.requestCb"
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
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
|
|
4932
3669
|
: 1]?.type;
|
|
4933
3670
|
let ok = cbT?.kind === "func" && cbT.ret.kind === "void" && cbT.params.length <= 1;
|
|
4934
3671
|
if (ok && cbT?.kind === "func" && cbT.params.length === 1) {
|
|
@@ -4964,7 +3701,8 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
4964
3701
|
}
|
|
4965
3702
|
return true;
|
|
4966
3703
|
}
|
|
4967
|
-
if (e.fn === "http.serverOnUpgrade" ||
|
|
3704
|
+
if (e.fn === "http.serverOnUpgrade" ||
|
|
3705
|
+
e.fn === "http.clientOnUpgrade" ||
|
|
4968
3706
|
e.fn === "http.serverOnConnect") {
|
|
4969
3707
|
// (req, socket, head) or any shorter prefix, void return. The
|
|
4970
3708
|
// 'connect' registration additionally admits a socket slot
|
|
@@ -5001,8 +3739,11 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5001
3739
|
let ok = funcOk(t);
|
|
5002
3740
|
if (!ok && t?.kind === "union") {
|
|
5003
3741
|
const def = unions.get(t.unionId);
|
|
5004
|
-
ok =
|
|
5005
|
-
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");
|
|
5006
3747
|
}
|
|
5007
3748
|
if (!ok) {
|
|
5008
3749
|
err(`libCall ${e.fn} callback shape (frontend must fence)`, e.loc);
|
|
@@ -5015,13 +3756,20 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5015
3756
|
// void — the emitter synthesizes the answer thunk from these
|
|
5016
3757
|
// types, so the structure must hold.
|
|
5017
3758
|
const t = e.args[2]?.type;
|
|
5018
|
-
let ok = t?.kind === "func" &&
|
|
5019
|
-
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";
|
|
5020
3764
|
if (ok && t?.kind === "func") {
|
|
5021
3765
|
const cbT = t.params[2];
|
|
5022
|
-
ok =
|
|
5023
|
-
cbT.
|
|
5024
|
-
|
|
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";
|
|
5025
3773
|
}
|
|
5026
3774
|
if (!ok) {
|
|
5027
3775
|
err(`libCall net.connectLookup resolver shape (frontend must fence)`, e.loc);
|
|
@@ -5036,7 +3784,9 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5036
3784
|
}
|
|
5037
3785
|
if (e.fn === "http.requestConnCb") {
|
|
5038
3786
|
const cbT = e.args[6]?.type;
|
|
5039
|
-
const ok = cbT?.kind === "func" &&
|
|
3787
|
+
const ok = cbT?.kind === "func" &&
|
|
3788
|
+
cbT.ret.kind === "void" &&
|
|
3789
|
+
cbT.params.length <= 1 &&
|
|
5040
3790
|
(cbT.params[0] === undefined || cbT.params[0].kind === "httpReq");
|
|
5041
3791
|
if (!ok)
|
|
5042
3792
|
err(`libCall ${e.fn} callback shape (frontend must fence)`, e.loc);
|
|
@@ -5057,7 +3807,8 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5057
3807
|
}
|
|
5058
3808
|
if (e.fn === "http.resSocket") {
|
|
5059
3809
|
const def = e.type.kind === "union" ? unions.get(e.type.unionId) : undefined;
|
|
5060
|
-
const ok = def &&
|
|
3810
|
+
const ok = def &&
|
|
3811
|
+
def.arms.length === 2 &&
|
|
5061
3812
|
def.arms.some((a) => a.kind === "netSocket") &&
|
|
5062
3813
|
def.arms.some((a) => a.kind === "nullT");
|
|
5063
3814
|
if (!ok)
|
|
@@ -5066,14 +3817,18 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5066
3817
|
}
|
|
5067
3818
|
if (e.fn === "http.reqH2Stream") {
|
|
5068
3819
|
const def = e.type.kind === "union" ? unions.get(e.type.unionId) : undefined;
|
|
5069
|
-
const ok = def &&
|
|
3820
|
+
const ok = def &&
|
|
3821
|
+
def.arms.length === 2 &&
|
|
5070
3822
|
def.arms.some((a) => a.kind === "http2Stream") &&
|
|
5071
3823
|
def.arms.some((a) => a.kind === "undefinedT");
|
|
5072
3824
|
if (!ok)
|
|
5073
3825
|
err(`libCall http.reqH2Stream must return the 'Http2Stream | undefined' union`, e.loc);
|
|
5074
3826
|
return true;
|
|
5075
3827
|
}
|
|
5076
|
-
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") {
|
|
5077
3832
|
// Result is the interned `string | undefined` union (envGet's).
|
|
5078
3833
|
const def = e.type.kind === "union" ? unions.get(e.type.unionId) : undefined;
|
|
5079
3834
|
const ok = def &&
|
|
@@ -5087,24 +3842,30 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5087
3842
|
}
|
|
5088
3843
|
if (e.fn === "http.reqHeaderValues" || e.fn === "http.reqTrailerValues") {
|
|
5089
3844
|
const def = e.type.kind === "union" ? unions.get(e.type.unionId) : undefined;
|
|
5090
|
-
const ok = def &&
|
|
5091
|
-
def.arms
|
|
3845
|
+
const ok = def &&
|
|
3846
|
+
def.arms.length === 2 &&
|
|
3847
|
+
def.arms[0].kind === "array" &&
|
|
3848
|
+
def.arms[0].elem.kind === "string" &&
|
|
5092
3849
|
def.arms[1].kind === "undefinedT";
|
|
5093
3850
|
if (!ok)
|
|
5094
3851
|
err(`libCall ${e.fn} must return the 'string[] | undefined' union`, e.loc);
|
|
5095
3852
|
return true;
|
|
5096
3853
|
}
|
|
5097
|
-
if (e.fn === "net.createServerCb" ||
|
|
3854
|
+
if (e.fn === "net.createServerCb" ||
|
|
3855
|
+
e.fn === "net.serverOnConnection" ||
|
|
5098
3856
|
e.fn === "net.serverOnSecureConnection" ||
|
|
5099
|
-
e.fn === "http.serverSetTimeoutCb" ||
|
|
3857
|
+
e.fn === "http.serverSetTimeoutCb" ||
|
|
3858
|
+
e.fn === "http.serverOnTimeout" ||
|
|
5100
3859
|
e.fn === "http.clientOnSocket" ||
|
|
5101
|
-
e.fn === "net.sockOnData" ||
|
|
3860
|
+
e.fn === "net.sockOnData" ||
|
|
3861
|
+
e.fn === "net.serverOnError" ||
|
|
5102
3862
|
e.fn === "net.sockOnError") {
|
|
5103
3863
|
// The program-dependent listener shapes: a void closure with no
|
|
5104
3864
|
// params, or exactly the one supported parameter per event
|
|
5105
3865
|
// (socket handle / data chunk bytes / error %Error). The
|
|
5106
3866
|
// callback slot is arg 0 for createServerCb, arg 1 otherwise.
|
|
5107
|
-
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;
|
|
5108
3869
|
let ok = cbT?.kind === "func" && cbT.ret.kind === "void" && cbT.params.length <= 1;
|
|
5109
3870
|
if (ok && cbT?.kind === "func" && cbT.params.length === 1) {
|
|
5110
3871
|
const p = cbT.params[0];
|
|
@@ -5129,15 +3890,20 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5129
3890
|
// (Error|null, SecureContext|undefined) whose arms the emitted
|
|
5130
3891
|
// answer thunk decodes; here the structural func shape is what
|
|
5131
3892
|
// the validator can pin.
|
|
5132
|
-
const sniOk = (t) => t?.kind === "func" &&
|
|
5133
|
-
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";
|
|
5134
3898
|
const argT = e.args[2]?.type;
|
|
5135
3899
|
let ok = sniOk(argT);
|
|
5136
3900
|
if (!ok && argT?.kind === "union") {
|
|
5137
3901
|
const def = unions.get(argT.unionId);
|
|
5138
|
-
ok =
|
|
5139
|
-
def
|
|
5140
|
-
|
|
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));
|
|
5141
3907
|
}
|
|
5142
3908
|
if (!ok) {
|
|
5143
3909
|
err(`libCall ${e.fn} SNI callback shape (frontend must fence)`, e.loc);
|
|
@@ -5197,20 +3963,26 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5197
3963
|
return false;
|
|
5198
3964
|
}
|
|
5199
3965
|
function checkLibFileCall(e) {
|
|
5200
|
-
if (e.fn === "zlib.deflateCb" ||
|
|
5201
|
-
e.fn === "zlib.
|
|
5202
|
-
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") {
|
|
5203
3973
|
const cbT = e.args[1]?.type;
|
|
5204
3974
|
let ok = cbT?.kind === "func" && cbT.ret.kind === "void" && cbT.params.length <= 2;
|
|
5205
3975
|
if (ok && cbT?.kind === "func" && cbT.params.length >= 1) {
|
|
5206
3976
|
const error = cbT.params[0];
|
|
5207
3977
|
if (error.kind !== "dyn") {
|
|
5208
3978
|
const def = error.kind === "union" ? unions.get(error.unionId) : undefined;
|
|
5209
|
-
ok =
|
|
5210
|
-
def
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
(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"));
|
|
5214
3986
|
}
|
|
5215
3987
|
}
|
|
5216
3988
|
if (ok && cbT?.kind === "func" && cbT.params.length === 2) {
|
|
@@ -5240,7 +4012,8 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5240
4012
|
def !== undefined &&
|
|
5241
4013
|
def.arms.some((a) => a.kind === "nullT") &&
|
|
5242
4014
|
def.arms.some((a) => a.kind === "object" && a.className === "%Error") &&
|
|
5243
|
-
def.arms.every((a) => a.kind === "nullT" ||
|
|
4015
|
+
def.arms.every((a) => a.kind === "nullT" ||
|
|
4016
|
+
a.kind === "undefinedT" ||
|
|
5244
4017
|
(a.kind === "object" && a.className === "%Error"));
|
|
5245
4018
|
}
|
|
5246
4019
|
}
|
|
@@ -5255,9 +4028,12 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5255
4028
|
const shape = e.type.kind === "record" ? records.get(e.type.shapeId) : undefined;
|
|
5256
4029
|
const ok = shape !== undefined &&
|
|
5257
4030
|
shape.fields.length === 3 &&
|
|
5258
|
-
shape.fields[0].name === "address" &&
|
|
5259
|
-
shape.fields[
|
|
5260
|
-
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";
|
|
5261
4037
|
if (!ok) {
|
|
5262
4038
|
err(`libCall net.serverAddress must return the {address, family, port} record`, e.loc);
|
|
5263
4039
|
}
|
|
@@ -5268,9 +4044,12 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5268
4044
|
const shape = e.type.kind === "record" ? records.get(e.type.shapeId) : undefined;
|
|
5269
4045
|
const ok = shape !== undefined &&
|
|
5270
4046
|
shape.fields.length === 3 &&
|
|
5271
|
-
shape.fields[0].name === "address" &&
|
|
5272
|
-
shape.fields[
|
|
5273
|
-
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";
|
|
5274
4053
|
if (!ok) {
|
|
5275
4054
|
err(`libCall dgram.address must return the {address, family, port} record`, e.loc);
|
|
5276
4055
|
}
|
|
@@ -5281,7 +4060,9 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5281
4060
|
// name: string, parentPath: string} rows (canonical field
|
|
5282
4061
|
// order; the structure lowerFsReaddirTypesCall pinned).
|
|
5283
4062
|
const result = e.fn === "fsp.readdirTypes"
|
|
5284
|
-
? e.type.kind === "promise"
|
|
4063
|
+
? e.type.kind === "promise"
|
|
4064
|
+
? e.type.inner
|
|
4065
|
+
: undefined
|
|
5285
4066
|
: e.type;
|
|
5286
4067
|
const shape = result?.kind === "array" && result.elem.kind === "record"
|
|
5287
4068
|
? records.get(result.elem.shapeId)
|
|
@@ -5290,9 +4071,12 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5290
4071
|
!shape.tuple &&
|
|
5291
4072
|
shape.indexValue === undefined &&
|
|
5292
4073
|
shape.fields.length === 3 &&
|
|
5293
|
-
shape.fields[0].name === "%dtype" &&
|
|
5294
|
-
shape.fields[
|
|
5295
|
-
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";
|
|
5296
4080
|
if (!ok) {
|
|
5297
4081
|
err(`libCall ${e.fn} must return ${e.fn === "fsp.readdirTypes" ? "a promise of " : ""}the Dirent record array`, e.loc);
|
|
5298
4082
|
}
|
|
@@ -5304,12 +4088,28 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5304
4088
|
// scopeid f64, the other's `number | undefined`) — the structure
|
|
5305
4089
|
// lowerOsNetworkInterfacesCall pinned.
|
|
5306
4090
|
const shape = e.type.kind === "record" ? records.get(e.type.shapeId) : undefined;
|
|
5307
|
-
let ok = shape !== undefined &&
|
|
5308
|
-
|
|
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;
|
|
5309
4098
|
const arrArm = ivDef?.arms.find((a) => a.kind === "array");
|
|
5310
|
-
ok =
|
|
5311
|
-
|
|
5312
|
-
|
|
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");
|
|
5313
4113
|
if (!ok) {
|
|
5314
4114
|
err(`libCall os.networkInterfaces must return the NetworkInterfaceInfo dictionary record`, e.loc);
|
|
5315
4115
|
}
|
|
@@ -5323,12 +4123,22 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5323
4123
|
// number arm, type-level only) — the structure
|
|
5324
4124
|
// lowerQuerystringParseCall pinned.
|
|
5325
4125
|
const shape = e.type.kind === "record" ? records.get(e.type.shapeId) : undefined;
|
|
5326
|
-
let ok = shape !== undefined &&
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
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");
|
|
5332
4142
|
if (!ok) {
|
|
5333
4143
|
err(`libCall qs.parse must return the ParsedUrlQuery dictionary record`, e.loc);
|
|
5334
4144
|
}
|
|
@@ -5339,14 +4149,18 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5339
4149
|
function checkLibProcessCall(e) {
|
|
5340
4150
|
if (e.fn === "cp.execFile") {
|
|
5341
4151
|
const cb = e.args[2]?.type;
|
|
5342
|
-
if (cb?.kind !== "func" ||
|
|
4152
|
+
if (cb?.kind !== "func" ||
|
|
4153
|
+
cb.rest === true ||
|
|
4154
|
+
cb.params.length > 3 ||
|
|
4155
|
+
cb.ret.kind !== "void") {
|
|
5343
4156
|
err(`libCall cp.execFile callback must be a non-rest void function with at most three parameters`, e.loc);
|
|
5344
4157
|
}
|
|
5345
4158
|
else {
|
|
5346
4159
|
const error = cb.params[0];
|
|
5347
4160
|
if (error !== undefined) {
|
|
5348
4161
|
const def = error.kind === "union" ? unions.get(error.unionId) : undefined;
|
|
5349
|
-
if (!def ||
|
|
4162
|
+
if (!def ||
|
|
4163
|
+
def.arms.length !== 2 ||
|
|
5350
4164
|
!def.arms.some((arm) => arm.kind === "nullT") ||
|
|
5351
4165
|
!def.arms.some((arm) => arm.kind === "object" && arm.className === "%Error")) {
|
|
5352
4166
|
err(`libCall cp.execFile callback error parameter must be Error | null`, e.loc);
|
|
@@ -5364,7 +4178,10 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5364
4178
|
}
|
|
5365
4179
|
if (e.fn === "child.onSpawn") {
|
|
5366
4180
|
const cb = e.args[1];
|
|
5367
|
-
if (!cb ||
|
|
4181
|
+
if (!cb ||
|
|
4182
|
+
cb.type.kind !== "func" ||
|
|
4183
|
+
cb.type.params.length !== 0 ||
|
|
4184
|
+
cb.type.ret.kind !== "void")
|
|
5368
4185
|
err("child.onSpawn callback must be () => void", e.loc);
|
|
5369
4186
|
}
|
|
5370
4187
|
if (e.fn === "child.onExit" || e.fn === "child.onClose" || e.fn === "child.onError") {
|
|
@@ -5416,8 +4233,10 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5416
4233
|
err(`libCall ${e.fn} callback shape (frontend must fence)`, e.loc);
|
|
5417
4234
|
return true;
|
|
5418
4235
|
}
|
|
5419
|
-
if (e.fn === "process.onExit" ||
|
|
5420
|
-
e.fn === "
|
|
4236
|
+
if (e.fn === "process.onExit" ||
|
|
4237
|
+
e.fn === "process.offExit" ||
|
|
4238
|
+
e.fn === "stdin.onData" ||
|
|
4239
|
+
e.fn === "stdin.onError") {
|
|
5421
4240
|
// The listener: a void closure with no params, or exactly the
|
|
5422
4241
|
// one supported parameter shape per event (code number / data
|
|
5423
4242
|
// chunk bytes / error %Error).
|
|
@@ -5526,7 +4345,8 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5526
4345
|
const t = e.type;
|
|
5527
4346
|
const cbU = t.kind === "func" && t.params.length === 1 ? t.params[0] : null;
|
|
5528
4347
|
const def = cbU?.kind === "union" ? unions.get(cbU.unionId) : undefined;
|
|
5529
|
-
const ok = t.kind === "func" &&
|
|
4348
|
+
const ok = t.kind === "func" &&
|
|
4349
|
+
(t.ret.kind === "netServer" || t.ret.kind === "void") &&
|
|
5530
4350
|
def &&
|
|
5531
4351
|
def.arms.some((a) => a.kind === "func" && a.params.length <= 1 && a.ret.kind === "void") &&
|
|
5532
4352
|
def.arms.some((a) => a.kind === "undefinedT");
|
|
@@ -5563,10 +4383,17 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5563
4383
|
// of the undefined global mapped to (never materialized).
|
|
5564
4384
|
return true;
|
|
5565
4385
|
}
|
|
5566
|
-
if (e.fn === "error.nodeThrow" ||
|
|
5567
|
-
e.fn === "
|
|
5568
|
-
e.fn === "
|
|
5569
|
-
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" ||
|
|
5570
4397
|
e.fn === "tls.caCertsChk") {
|
|
5571
4398
|
// Always throws — the result type is the replaced expression's
|
|
5572
4399
|
// own (never materialized; the global.undefRead pattern). The
|
|
@@ -5588,7 +4415,10 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5588
4415
|
}
|
|
5589
4416
|
return true;
|
|
5590
4417
|
}
|
|
5591
|
-
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") {
|
|
5592
4422
|
// Receiver: exactly %DOMException (subclassing is fenced — the
|
|
5593
4423
|
// hidden runtime slots admit no other layout).
|
|
5594
4424
|
const recv = e.args[0];
|
|
@@ -5646,12 +4476,19 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5646
4476
|
return false;
|
|
5647
4477
|
}
|
|
5648
4478
|
function checkLibStreamCall(e, fixedArgs, result) {
|
|
5649
|
-
if (e.fn.startsWith("readable.") ||
|
|
5650
|
-
e.fn.startsWith("
|
|
5651
|
-
e.fn.startsWith("
|
|
5652
|
-
e.fn
|
|
5653
|
-
e.fn
|
|
5654
|
-
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" ||
|
|
5655
4492
|
e.fn === "stream.pipelineDyn") {
|
|
5656
4493
|
// Receiver/result: stream-hierarchy objects (a class whose base
|
|
5657
4494
|
// chain reaches a runtime stream class). Constructors have no
|
|
@@ -5754,10 +4591,14 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5754
4591
|
}
|
|
5755
4592
|
return true;
|
|
5756
4593
|
}
|
|
5757
|
-
if (e.fn === "readable.pause" ||
|
|
5758
|
-
e.fn === "readable.
|
|
5759
|
-
e.fn === "readable.
|
|
5760
|
-
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" ||
|
|
5761
4602
|
e.fn === "stream.iteratorClose") {
|
|
5762
4603
|
if (!typeEquals(e.type, e.args[0].type)) {
|
|
5763
4604
|
err(`libCall ${e.fn} must return its receiver's type (the chaining 'this')`, e.loc);
|
|
@@ -5772,11 +4613,15 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5772
4613
|
}
|
|
5773
4614
|
if (e.fn === "readable.read" || e.fn === "readable.flowing" || e.fn === "stream.errored") {
|
|
5774
4615
|
const def = e.type.kind === "union" ? unions.get(e.type.unionId) : undefined;
|
|
5775
|
-
const wantArm = (t) => e.fn === "readable.read"
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
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");
|
|
5780
4625
|
if (!ok)
|
|
5781
4626
|
err(`libCall ${e.fn} must return its nullable union`, e.loc);
|
|
5782
4627
|
return true;
|
|
@@ -5795,9 +4640,11 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5795
4640
|
return false;
|
|
5796
4641
|
}
|
|
5797
4642
|
function checkLibEmitterCall(e, result) {
|
|
5798
|
-
if ((e.fn.startsWith("emitter.") || e.fn === "stream.onDyn") &&
|
|
4643
|
+
if ((e.fn.startsWith("emitter.") || e.fn === "stream.onDyn") &&
|
|
4644
|
+
e.fn !== "emitter.setDefaultMax" &&
|
|
5799
4645
|
e.fn !== "emitter.setDefaultMaxChk" &&
|
|
5800
|
-
e.fn !== "emitter.getDefaultMax" &&
|
|
4646
|
+
e.fn !== "emitter.getDefaultMax" &&
|
|
4647
|
+
e.fn !== "emitter.checkListener") {
|
|
5801
4648
|
// Receiver: an emitter-hierarchy object (the %EventEmitter class
|
|
5802
4649
|
// itself, or a class whose base chain reaches it). emitter.new
|
|
5803
4650
|
// has no receiver — its RESULT is the bare emitter class.
|
|
@@ -5823,20 +4670,28 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5823
4670
|
return true;
|
|
5824
4671
|
}
|
|
5825
4672
|
// The chaining forms return the receiver's own static class.
|
|
5826
|
-
if (e.fn === "emitter.on" ||
|
|
5827
|
-
e.fn === "emitter.
|
|
5828
|
-
e.fn === "emitter.
|
|
5829
|
-
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" ||
|
|
5830
4683
|
e.fn === "emitter.setMaxChk") {
|
|
5831
4684
|
if (!typeEquals(e.type, e.args[0].type)) {
|
|
5832
4685
|
err(`libCall ${e.fn} must return its receiver's type (the chaining 'this')`, e.loc);
|
|
5833
4686
|
}
|
|
5834
4687
|
// The listener slots carry closures (the dyn family's checked-
|
|
5835
4688
|
// dynamic listener is table-checked; its adapter is a func).
|
|
5836
|
-
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") {
|
|
5837
4691
|
err(`libCall ${e.fn} listener must be a func`, e.loc);
|
|
5838
4692
|
}
|
|
5839
|
-
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") {
|
|
5840
4695
|
err(`libCall ${e.fn} adapter must be a func`, e.loc);
|
|
5841
4696
|
}
|
|
5842
4697
|
return true;
|
|
@@ -5876,9 +4731,14 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5876
4731
|
err("libCall emitter.emitFlex payloads must be checked-dynamic", e.loc);
|
|
5877
4732
|
}
|
|
5878
4733
|
}
|
|
5879
|
-
if (e.fn === "emitter.emit" ||
|
|
5880
|
-
e.fn === "emitter.
|
|
5881
|
-
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") {
|
|
5882
4742
|
if (!typeEquals(e.type, result)) {
|
|
5883
4743
|
err(`libCall ${e.fn} must be ${result.kind}, got ${e.type.kind}`, e.loc);
|
|
5884
4744
|
}
|
|
@@ -5915,7 +4775,9 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5915
4775
|
// reads), which matches exactly the undefined arm.
|
|
5916
4776
|
const jsonOk = (t) => isJsonSafeType(t, (id) => records.get(id), (id) => unions.get(id));
|
|
5917
4777
|
const undefArmedOk = e.type.kind === "union" &&
|
|
5918
|
-
(unions
|
|
4778
|
+
(unions
|
|
4779
|
+
.get(e.type.unionId)
|
|
4780
|
+
?.arms.every((a) => a.kind === "undefinedT" ||
|
|
5919
4781
|
jsonOk(a) ||
|
|
5920
4782
|
isDynTypedRefType(a) ||
|
|
5921
4783
|
DYN_HANDLE_KINDS.has(a.kind)) ??
|
|
@@ -5933,7 +4795,13 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5933
4795
|
// Runtime HANDLE targets unwrap the checked-dynamic tree's handle kind by tag (a
|
|
5934
4796
|
// retained reference, no copy — DYN_HANDLE_KINDS).
|
|
5935
4797
|
const handleOk = DYN_HANDLE_KINDS.has(e.type.kind);
|
|
5936
|
-
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) {
|
|
5937
4805
|
err(`dynCheck against non-JSON-representable type ${e.type.kind}`, e.loc);
|
|
5938
4806
|
}
|
|
5939
4807
|
break;
|
|
@@ -5974,7 +4842,9 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
5974
4842
|
// The undefined next-channel has no C value form: such yields are
|
|
5975
4843
|
// void-typed (statement position only — the frontend fences reads).
|
|
5976
4844
|
if (e.captureCompletion) {
|
|
5977
|
-
if (fn.async ||
|
|
4845
|
+
if (fn.async ||
|
|
4846
|
+
e.type.kind !== "dyn" ||
|
|
4847
|
+
!typeEquals(e.captureCompletion.returnType, fn.returnType)) {
|
|
5978
4848
|
err("invalid captured generator completion", e.loc);
|
|
5979
4849
|
}
|
|
5980
4850
|
}
|
|
@@ -6143,7 +5013,8 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
6143
5013
|
if (resolve.kind !== "func" || resolve.ret.kind !== "void") {
|
|
6144
5014
|
err("promiseWithResolvers resolve must be a void-returning function", e.loc);
|
|
6145
5015
|
}
|
|
6146
|
-
else if (inner.kind === "void"
|
|
5016
|
+
else if (inner.kind === "void"
|
|
5017
|
+
? resolve.params.length !== 0
|
|
6147
5018
|
: resolve.params.length !== 1 || !typeEquals(resolve.params[0], inner)) {
|
|
6148
5019
|
err(`promiseWithResolvers resolve param must match the promise's inner type`, e.loc);
|
|
6149
5020
|
}
|
|
@@ -6197,26 +5068,64 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
6197
5068
|
if (e.type.kind !== jsOpResultKind(e.op)) {
|
|
6198
5069
|
err(`jsOp ${e.op} must be ${jsOpResultKind(e.op)}, got ${e.type.kind}`, e.loc);
|
|
6199
5070
|
}
|
|
6200
|
-
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" ||
|
|
6201
5076
|
e.op === "callSpread"; // the spread expression's source spelling (V8's nullish text spells it)
|
|
6202
5077
|
if (named !== (e.name !== undefined)) {
|
|
6203
5078
|
err(`jsOp ${e.op} ${named ? "requires" : "forbids"} a name`, e.loc);
|
|
6204
5079
|
}
|
|
6205
5080
|
const arity = {
|
|
6206
|
-
add: 2,
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
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,
|
|
6211
5110
|
callSpread: 3, // callee + pre array + spread source
|
|
6212
|
-
callMethod: null,
|
|
6213
|
-
|
|
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)
|
|
6214
5119
|
};
|
|
6215
5120
|
const want = arity[e.op];
|
|
6216
5121
|
if (want !== null && want !== undefined && e.args.length !== want) {
|
|
6217
5122
|
err(`jsOp ${e.op} takes ${want} arg(s), got ${e.args.length}`, e.loc);
|
|
6218
5123
|
}
|
|
6219
|
-
if (want === null &&
|
|
5124
|
+
if (want === null &&
|
|
5125
|
+
e.op !== "objLit" &&
|
|
5126
|
+
e.op !== "arrLit" &&
|
|
5127
|
+
e.op !== "tplStrings" &&
|
|
5128
|
+
e.args.length < 1) {
|
|
6220
5129
|
err(`jsOp ${e.op} needs a receiver/callee arg`, e.loc);
|
|
6221
5130
|
}
|
|
6222
5131
|
if (e.op === "callFnThis" && e.args.length < 2) {
|
|
@@ -6553,7 +5462,9 @@ function validateFunction(fn, functions, ffiByName, classes, records, recordVali
|
|
|
6553
5462
|
checkExpr(s.value);
|
|
6554
5463
|
// dyn throws are allowed: the dyn node rides the REF cell arm by
|
|
6555
5464
|
// reference (the JS-lane `throw err` of a dyn argument).
|
|
6556
|
-
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") {
|
|
6557
5468
|
err(`throw of a ${s.value.type.kind} value`, s.loc);
|
|
6558
5469
|
}
|
|
6559
5470
|
break;
|