@scriptc/compiler 0.4.7 → 0.4.8
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/node-fallback/child_process.d.ts +71 -22
- package/ambient/node-fallback/crypto.d.ts +15 -7
- package/ambient/node-fallback/events.d.ts +23 -5
- package/ambient/node-fallback/fs.d.ts +3 -2
- package/ambient/node-fallback/http.d.ts +23 -17
- package/ambient/node-fallback/https.d.ts +5 -2
- package/ambient/node-fallback/net.d.ts +6 -0
- package/ambient/node-fallback/os.d.ts +11 -1
- package/ambient/node-fallback/path-posix.d.ts +6 -0
- package/ambient/node-fallback/path-win32.d.ts +5 -0
- package/ambient/node-fallback/path.d.ts +2 -0
- package/ambient/node-fallback/zlib.d.ts +31 -2
- package/ambient/scriptc-node-fallback.d.ts +37 -7
- package/ambient/scriptc.d.ts +7 -2
- package/dist/backend/executable-features.js +11 -3
- package/dist/backend/executable-features.js.map +1 -1
- package/dist/backend/library-pack.d.ts +6 -0
- package/dist/backend/library-pack.js +17 -6
- package/dist/backend/library-pack.js.map +1 -1
- package/dist/backend/library-pack.test.d.ts +1 -0
- package/dist/backend/library-pack.test.js +28 -0
- package/dist/backend/library-pack.test.js.map +1 -0
- package/dist/backend/linker.d.ts +9 -2
- package/dist/backend/linker.js +190 -32
- package/dist/backend/linker.js.map +1 -1
- package/dist/backend/lld.d.ts +8 -4
- package/dist/backend/lld.js +19 -13
- package/dist/backend/lld.js.map +1 -1
- package/dist/backend/lld.test.js +3 -1
- package/dist/backend/lld.test.js.map +1 -1
- package/dist/backend/llvm/alloc.d.ts +15 -2
- package/dist/backend/llvm/alloc.js +172 -36
- package/dist/backend/llvm/alloc.js.map +1 -1
- package/dist/backend/llvm/alloc.test.js +69 -1
- package/dist/backend/llvm/alloc.test.js.map +1 -1
- package/dist/backend/llvm/arenas.d.ts +17 -4
- package/dist/backend/llvm/arenas.js +105 -10
- package/dist/backend/llvm/arenas.js.map +1 -1
- package/dist/backend/llvm/arenas.test.js +229 -0
- package/dist/backend/llvm/arenas.test.js.map +1 -1
- package/dist/backend/llvm/bytes-alias.js +10 -1
- package/dist/backend/llvm/bytes-alias.js.map +1 -1
- package/dist/backend/llvm/bytes-headers.js +6 -0
- package/dist/backend/llvm/bytes-headers.js.map +1 -1
- package/dist/backend/llvm/bytes-loop-versions.test.js +25 -0
- package/dist/backend/llvm/bytes-loop-versions.test.js.map +1 -1
- package/dist/backend/llvm/call-lifetimes.js +10 -0
- package/dist/backend/llvm/call-lifetimes.js.map +1 -1
- package/dist/backend/llvm/classes.d.ts +16 -9
- package/dist/backend/llvm/classes.js +142 -37
- package/dist/backend/llvm/classes.js.map +1 -1
- package/dist/backend/llvm/classes.test.js +42 -0
- package/dist/backend/llvm/classes.test.js.map +1 -1
- package/dist/backend/llvm/cpu-dispatch.d.ts +15 -5
- package/dist/backend/llvm/cpu-dispatch.js +31 -7
- package/dist/backend/llvm/cpu-dispatch.js.map +1 -1
- package/dist/backend/llvm/dyn.d.ts +12 -3
- package/dist/backend/llvm/dyn.js +31 -7
- package/dist/backend/llvm/dyn.js.map +1 -1
- package/dist/backend/llvm/emit-function.js +67 -4
- package/dist/backend/llvm/emit-function.js.map +1 -1
- package/dist/backend/llvm/emit-module.js +90 -39
- package/dist/backend/llvm/emit-module.js.map +1 -1
- package/dist/backend/llvm/emit-module.test.d.ts +1 -0
- package/dist/backend/llvm/emit-module.test.js +52 -0
- package/dist/backend/llvm/emit-module.test.js.map +1 -0
- package/dist/backend/llvm/emit-statements.js +99 -15
- package/dist/backend/llvm/emit-statements.js.map +1 -1
- package/dist/backend/llvm/emitter.d.ts +113 -8
- package/dist/backend/llvm/emitter.js +438 -67
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/backend/llvm/emitter.test.js +31 -3
- package/dist/backend/llvm/emitter.test.js.map +1 -1
- package/dist/backend/llvm/expr-async.js +19 -1
- package/dist/backend/llvm/expr-async.js.map +1 -1
- package/dist/backend/llvm/expr-bytes.js +16 -1
- package/dist/backend/llvm/expr-bytes.js.map +1 -1
- package/dist/backend/llvm/expr-calls.js +18 -2
- package/dist/backend/llvm/expr-calls.js.map +1 -1
- package/dist/backend/llvm/expr-dynamic.js +31 -10
- package/dist/backend/llvm/expr-dynamic.js.map +1 -1
- package/dist/backend/llvm/expr-primitives.js +31 -3
- package/dist/backend/llvm/expr-primitives.js.map +1 -1
- package/dist/backend/llvm/expr-records.d.ts +1 -1
- package/dist/backend/llvm/expr-records.js +124 -56
- package/dist/backend/llvm/expr-records.js.map +1 -1
- package/dist/backend/llvm/expr-stream-bridges.js +17 -0
- package/dist/backend/llvm/expr-stream-bridges.js.map +1 -1
- package/dist/backend/llvm/js-groups.d.ts +21 -0
- package/dist/backend/llvm/js-groups.js +277 -0
- package/dist/backend/llvm/js-groups.js.map +1 -0
- package/dist/backend/llvm/js-ic.d.ts +19 -1
- package/dist/backend/llvm/js-ic.js +96 -23
- package/dist/backend/llvm/js-ic.js.map +1 -1
- package/dist/backend/llvm/lib-dispatch.js +132 -1
- package/dist/backend/llvm/lib-dispatch.js.map +1 -1
- package/dist/backend/llvm/lib-network.js +33 -6
- package/dist/backend/llvm/lib-network.js.map +1 -1
- package/dist/backend/llvm/lib-process.js +44 -3
- package/dist/backend/llvm/lib-process.js.map +1 -1
- package/dist/backend/llvm/lib-shared.js +69 -2
- package/dist/backend/llvm/lib-shared.js.map +1 -1
- package/dist/backend/llvm/local-union-storage.test.js +32 -0
- package/dist/backend/llvm/local-union-storage.test.js.map +1 -1
- package/dist/backend/llvm/loop-state.js +7 -2
- package/dist/backend/llvm/loop-state.js.map +1 -1
- package/dist/backend/llvm/map-entry-fusion.d.ts +8 -0
- package/dist/backend/llvm/map-entry-fusion.js +3 -3
- package/dist/backend/llvm/map-entry-fusion.js.map +1 -1
- package/dist/backend/llvm/map-number-lookup.test.js +6 -6
- package/dist/backend/llvm/map-number-lookup.test.js.map +1 -1
- package/dist/backend/llvm/nullable-unions.js +7 -6
- package/dist/backend/llvm/nullable-unions.js.map +1 -1
- package/dist/backend/llvm/nullable-unions.test.js +4 -1
- package/dist/backend/llvm/nullable-unions.test.js.map +1 -1
- package/dist/backend/llvm/receivers.js +3 -0
- package/dist/backend/llvm/receivers.js.map +1 -1
- package/dist/backend/llvm/record-entry-fusion.d.ts +32 -0
- package/dist/backend/llvm/record-entry-fusion.js +217 -0
- package/dist/backend/llvm/record-entry-fusion.js.map +1 -0
- package/dist/backend/llvm/record-results.d.ts +5 -2
- package/dist/backend/llvm/record-results.js +13 -12
- package/dist/backend/llvm/record-results.js.map +1 -1
- package/dist/backend/llvm/record-views.js +12 -6
- package/dist/backend/llvm/record-views.js.map +1 -1
- package/dist/backend/llvm/reference-effects.js +1 -0
- package/dist/backend/llvm/reference-effects.js.map +1 -1
- package/dist/backend/llvm/reference-writes.js +3 -0
- package/dist/backend/llvm/reference-writes.js.map +1 -1
- package/dist/backend/llvm/region-ir.js +1 -0
- package/dist/backend/llvm/region-ir.js.map +1 -1
- package/dist/backend/llvm/region-sites.d.ts +18 -0
- package/dist/backend/llvm/region-sites.js +79 -1
- package/dist/backend/llvm/region-sites.js.map +1 -1
- package/dist/backend/llvm/runtime-registries.test.js +53 -6
- package/dist/backend/llvm/runtime-registries.test.js.map +1 -1
- package/dist/backend/llvm/serialized-ir-emission.test.js +3 -1
- package/dist/backend/llvm/serialized-ir-emission.test.js.map +1 -1
- package/dist/backend/llvm/shapes.d.ts +33 -3
- package/dist/backend/llvm/shapes.js +183 -13
- package/dist/backend/llvm/shapes.js.map +1 -1
- package/dist/backend/llvm/stack-objects.d.ts +1 -2
- package/dist/backend/llvm/stack-objects.js +8 -5
- package/dist/backend/llvm/stack-objects.js.map +1 -1
- package/dist/backend/llvm/walkers.d.ts +12 -0
- package/dist/backend/llvm/walkers.js +46 -2
- package/dist/backend/llvm/walkers.js.map +1 -1
- package/dist/backend/may-throw.js +12 -2
- package/dist/backend/may-throw.js.map +1 -1
- package/dist/backend/may-throw.test.js +13 -0
- package/dist/backend/may-throw.test.js.map +1 -1
- package/dist/backend/native/contracts.d.ts +48 -8
- package/dist/backend/native/executable.js +55 -13
- package/dist/backend/native/executable.js.map +1 -1
- package/dist/backend/native/helper-identity-record.d.ts +11 -0
- package/dist/backend/native/helper-identity-record.js +76 -0
- package/dist/backend/native/helper-identity-record.js.map +1 -0
- package/dist/backend/native/helper-identity-record.test.d.ts +1 -0
- package/dist/backend/native/helper-identity-record.test.js +101 -0
- package/dist/backend/native/helper-identity-record.test.js.map +1 -0
- package/dist/backend/native/library.js +9 -1
- package/dist/backend/native/library.js.map +1 -1
- package/dist/backend/native/runtime-inputs.js +4 -1
- package/dist/backend/native/runtime-inputs.js.map +1 -1
- package/dist/backend/native/vendor.d.ts +1 -1
- package/dist/backend/native/vendor.js +1 -1
- package/dist/backend/native/vendor.js.map +1 -1
- package/dist/backend/native-codegen-core.d.ts +13 -10
- package/dist/backend/native-codegen-core.js +26 -13
- package/dist/backend/native-codegen-core.js.map +1 -1
- package/dist/backend/native-codegen.js +27 -8
- package/dist/backend/native-codegen.js.map +1 -1
- package/dist/backend/native-codegen.test.js +110 -14
- package/dist/backend/native-codegen.test.js.map +1 -1
- package/dist/backend/native-link-info-core.d.ts +37 -8
- package/dist/backend/native-link-info-core.js.map +1 -1
- package/dist/backend/runtime-pack-core.d.ts +17 -2
- package/dist/backend/runtime-pack-core.js +18 -3
- package/dist/backend/runtime-pack-core.js.map +1 -1
- package/dist/backend/runtime-pack-targets.test.js +1 -1
- package/dist/backend/runtime-pack-targets.test.js.map +1 -1
- package/dist/backend/runtime-pack.test.js +211 -2
- package/dist/backend/runtime-pack.test.js.map +1 -1
- package/dist/backend/tree-classes.d.ts +42 -0
- package/dist/backend/tree-classes.js +723 -0
- package/dist/backend/tree-classes.js.map +1 -0
- package/dist/backend/tree-classes.test.d.ts +1 -0
- package/dist/backend/tree-classes.test.js +338 -0
- package/dist/backend/tree-classes.test.js.map +1 -0
- package/dist/backend/vendor-archives.d.ts +5 -1
- package/dist/backend/vendor-archives.js +51 -7
- package/dist/backend/vendor-archives.js.map +1 -1
- package/dist/backend/vendor-inputs.d.ts +25 -4
- package/dist/backend/vendor-inputs.js +68 -4
- package/dist/backend/vendor-inputs.js.map +1 -1
- package/dist/backend/vendor-inputs.test.js +35 -1
- package/dist/backend/vendor-inputs.test.js.map +1 -1
- package/dist/backend/warm-cache.js +1 -1
- package/dist/backend/warm-cache.js.map +1 -1
- package/dist/compat/fetch-profile.js +2 -2
- package/dist/coverage/report.js +47 -0
- package/dist/coverage/report.js.map +1 -1
- package/dist/coverage/surface-manifest.js +1 -1
- package/dist/diagnostics/codes.d.ts +8 -0
- package/dist/diagnostics/codes.js +8 -0
- package/dist/diagnostics/codes.js.map +1 -1
- package/dist/diagnostics/diagnostic.d.ts +27 -9
- package/dist/diagnostics/diagnostic.js +60 -19
- package/dist/diagnostics/diagnostic.js.map +1 -1
- package/dist/diagnostics/envelope.d.ts +18 -0
- package/dist/diagnostics/envelope.js.map +1 -1
- package/dist/executable/executable-cache.d.ts +21 -2
- package/dist/executable/executable-cache.js +21 -1
- package/dist/executable/executable-cache.js.map +1 -1
- package/dist/executable/executable-cache.test.js +123 -1
- package/dist/executable/executable-cache.test.js.map +1 -1
- package/dist/executable/prepare.js +199 -248
- package/dist/executable/prepare.js.map +1 -1
- package/dist/frontend/analysis.js +200 -18
- package/dist/frontend/analysis.js.map +1 -1
- package/dist/frontend/builtin-modules.d.ts +4 -0
- package/dist/frontend/builtin-modules.js +10 -0
- package/dist/frontend/builtin-modules.js.map +1 -1
- package/dist/frontend/early-errors.d.ts +12 -2
- package/dist/frontend/early-errors.js +535 -4
- package/dist/frontend/early-errors.js.map +1 -1
- package/dist/frontend/early-errors.test.js +165 -0
- package/dist/frontend/early-errors.test.js.map +1 -1
- package/dist/frontend/inferred-js-diagnostics.test.js +65 -0
- package/dist/frontend/inferred-js-diagnostics.test.js.map +1 -1
- package/dist/frontend/jsx-opinion-sites.test.d.ts +1 -0
- package/dist/frontend/jsx-opinion-sites.test.js +86 -0
- package/dist/frontend/jsx-opinion-sites.test.js.map +1 -0
- package/dist/frontend/lib-exports.d.ts +23 -4
- package/dist/frontend/lib-exports.js +98 -26
- package/dist/frontend/lib-exports.js.map +1 -1
- package/dist/frontend/lowering/binding-analysis.js +21 -3
- package/dist/frontend/lowering/binding-analysis.js.map +1 -1
- package/dist/frontend/lowering/buffers.d.ts +8 -0
- package/dist/frontend/lowering/buffers.js +43 -0
- package/dist/frontend/lowering/buffers.js.map +1 -0
- package/dist/frontend/lowering/builtin-calls.js +4 -0
- package/dist/frontend/lowering/builtin-calls.js.map +1 -1
- package/dist/frontend/lowering/builtin-namespaces.d.ts +3 -2
- package/dist/frontend/lowering/builtin-namespaces.js +24 -3
- package/dist/frontend/lowering/builtin-namespaces.js.map +1 -1
- package/dist/frontend/lowering/builtin-statics.d.ts +24 -0
- package/dist/frontend/lowering/builtin-statics.js +407 -0
- package/dist/frontend/lowering/builtin-statics.js.map +1 -0
- package/dist/frontend/lowering/builtins/arguments.d.ts +4 -0
- package/dist/frontend/lowering/builtins/arguments.js +12 -0
- package/dist/frontend/lowering/builtins/arguments.js.map +1 -1
- package/dist/frontend/lowering/builtins/atomics.d.ts +6 -1
- package/dist/frontend/lowering/builtins/atomics.js +87 -1
- package/dist/frontend/lowering/builtins/atomics.js.map +1 -1
- package/dist/frontend/lowering/builtins/child-process-methods.js +2 -2
- package/dist/frontend/lowering/builtins/child-process-methods.js.map +1 -1
- package/dist/frontend/lowering/builtins/child-process-sync.d.ts +13 -0
- package/dist/frontend/lowering/builtins/child-process-sync.js +1 -13
- package/dist/frontend/lowering/builtins/child-process-sync.js.map +1 -1
- package/dist/frontend/lowering/builtins/child-process.d.ts +10 -4
- package/dist/frontend/lowering/builtins/child-process.js +560 -27
- package/dist/frontend/lowering/builtins/child-process.js.map +1 -1
- package/dist/frontend/lowering/builtins/compression.d.ts +2 -2
- package/dist/frontend/lowering/builtins/compression.js +41 -21
- package/dist/frontend/lowering/builtins/compression.js.map +1 -1
- package/dist/frontend/lowering/builtins/constants.js +7 -2
- package/dist/frontend/lowering/builtins/constants.js.map +1 -1
- package/dist/frontend/lowering/builtins/filesystem-calls.d.ts +1 -0
- package/dist/frontend/lowering/builtins/filesystem-calls.js +28 -2
- package/dist/frontend/lowering/builtins/filesystem-calls.js.map +1 -1
- package/dist/frontend/lowering/builtins/json.js +4 -0
- package/dist/frontend/lowering/builtins/json.js.map +1 -1
- package/dist/frontend/lowering/builtins/module-calls.js +3 -1
- package/dist/frontend/lowering/builtins/module-calls.js.map +1 -1
- package/dist/frontend/lowering/builtins/numbers.d.ts +4 -1
- package/dist/frontend/lowering/builtins/numbers.js +10 -2
- package/dist/frontend/lowering/builtins/numbers.js.map +1 -1
- package/dist/frontend/lowering/builtins/operating-system.d.ts +6 -3
- package/dist/frontend/lowering/builtins/operating-system.js +96 -16
- package/dist/frontend/lowering/builtins/operating-system.js.map +1 -1
- package/dist/frontend/lowering/builtins/process.d.ts +2 -2
- package/dist/frontend/lowering/builtins/process.js +103 -8
- package/dist/frontend/lowering/builtins/process.js.map +1 -1
- package/dist/frontend/lowering/builtins/promises.js +169 -8
- package/dist/frontend/lowering/builtins/promises.js.map +1 -1
- package/dist/frontend/lowering/builtins/properties.js +6 -2
- package/dist/frontend/lowering/builtins/properties.js.map +1 -1
- package/dist/frontend/lowering/builtins/readline.d.ts +6 -4
- package/dist/frontend/lowering/builtins/readline.js +180 -36
- package/dist/frontend/lowering/builtins/readline.js.map +1 -1
- package/dist/frontend/lowering/builtins/url.js +35 -12
- package/dist/frontend/lowering/builtins/url.js.map +1 -1
- package/dist/frontend/lowering/builtins/webassembly.js +2 -0
- package/dist/frontend/lowering/builtins/webassembly.js.map +1 -1
- package/dist/frontend/lowering/call-arguments.d.ts +10 -0
- package/dist/frontend/lowering/call-arguments.js +37 -2
- package/dist/frontend/lowering/call-arguments.js.map +1 -1
- package/dist/frontend/lowering/call-signatures.d.ts +10 -0
- package/dist/frontend/lowering/call-signatures.js +103 -0
- package/dist/frontend/lowering/call-signatures.js.map +1 -1
- package/dist/frontend/lowering/class-construction.d.ts +14 -2
- package/dist/frontend/lowering/class-construction.js +99 -5
- package/dist/frontend/lowering/class-construction.js.map +1 -1
- package/dist/frontend/lowering/class-dynamic-dispatch.d.ts +9 -0
- package/dist/frontend/lowering/class-dynamic-dispatch.js +1283 -1030
- package/dist/frontend/lowering/class-dynamic-dispatch.js.map +1 -1
- package/dist/frontend/lowering/class-dynamic-dispatch.test.js +158 -0
- package/dist/frontend/lowering/class-dynamic-dispatch.test.js.map +1 -1
- package/dist/frontend/lowering/class-prototypes.js +20 -15
- package/dist/frontend/lowering/class-prototypes.js.map +1 -1
- package/dist/frontend/lowering/class-runtime-statics.d.ts +8 -0
- package/dist/frontend/lowering/class-runtime-statics.js +20 -1
- package/dist/frontend/lowering/class-runtime-statics.js.map +1 -1
- package/dist/frontend/lowering/class-unions.js +21 -4
- package/dist/frontend/lowering/class-unions.js.map +1 -1
- package/dist/frontend/lowering/coercions/function-adapters.js +9 -0
- package/dist/frontend/lowering/coercions/function-adapters.js.map +1 -1
- package/dist/frontend/lowering/coercions/state.d.ts +8 -0
- package/dist/frontend/lowering/coercions/state.js +17 -0
- package/dist/frontend/lowering/coercions/state.js.map +1 -1
- package/dist/frontend/lowering/coercions/structural-plans.js +20 -5
- package/dist/frontend/lowering/coercions/structural-plans.js.map +1 -1
- package/dist/frontend/lowering/coercions/structural.js +10 -1
- package/dist/frontend/lowering/coercions/structural.js.map +1 -1
- package/dist/frontend/lowering/coercions/unions.d.ts +2 -1
- package/dist/frontend/lowering/coercions/unions.js +54 -10
- package/dist/frontend/lowering/coercions/unions.js.map +1 -1
- package/dist/frontend/lowering/constructor-returns.d.ts +23 -2
- package/dist/frontend/lowering/constructor-returns.js +284 -58
- package/dist/frontend/lowering/constructor-returns.js.map +1 -1
- package/dist/frontend/lowering/containers/array-callbacks.js +156 -62
- package/dist/frontend/lowering/containers/array-callbacks.js.map +1 -1
- package/dist/frontend/lowering/containers/array-construction.js +21 -3
- package/dist/frontend/lowering/containers/array-construction.js.map +1 -1
- package/dist/frontend/lowering/containers/array-from-async.js +139 -3
- package/dist/frontend/lowering/containers/array-from-async.js.map +1 -1
- package/dist/frontend/lowering/containers/array-iteration.d.ts +14 -4
- package/dist/frontend/lowering/containers/array-iteration.js +24 -7
- package/dist/frontend/lowering/containers/array-iteration.js.map +1 -1
- package/dist/frontend/lowering/containers/array-methods.js +14 -11
- package/dist/frontend/lowering/containers/array-methods.js.map +1 -1
- package/dist/frontend/lowering/containers/bytes.d.ts +6 -0
- package/dist/frontend/lowering/containers/bytes.js +446 -86
- package/dist/frontend/lowering/containers/bytes.js.map +1 -1
- package/dist/frontend/lowering/containers/callback-arguments.d.ts +5 -0
- package/dist/frontend/lowering/containers/callback-arguments.js +21 -12
- package/dist/frontend/lowering/containers/callback-arguments.js.map +1 -1
- package/dist/frontend/lowering/containers/collection-grouping.js +421 -2
- package/dist/frontend/lowering/containers/collection-grouping.js.map +1 -1
- package/dist/frontend/lowering/containers/collection-methods.js +52 -17
- package/dist/frontend/lowering/containers/collection-methods.js.map +1 -1
- package/dist/frontend/lowering/containers/iterator-helpers.d.ts +23 -0
- package/dist/frontend/lowering/containers/iterator-helpers.js +176 -10
- package/dist/frontend/lowering/containers/iterator-helpers.js.map +1 -1
- package/dist/frontend/lowering/containers/string-and-regexp.d.ts +5 -2
- package/dist/frontend/lowering/containers/string-and-regexp.js +45 -11
- package/dist/frontend/lowering/containers/string-and-regexp.js.map +1 -1
- package/dist/frontend/lowering/crypto-tables.d.ts +3 -3
- package/dist/frontend/lowering/crypto-tables.js +5 -5
- package/dist/frontend/lowering/dispatch-sites.js +3 -0
- package/dist/frontend/lowering/dispatch-sites.js.map +1 -1
- package/dist/frontend/lowering/divergences.d.ts +40 -0
- package/dist/frontend/lowering/divergences.js +239 -20
- package/dist/frontend/lowering/divergences.js.map +1 -1
- package/dist/frontend/lowering/effect-free.d.ts +12 -0
- package/dist/frontend/lowering/effect-free.js +44 -0
- package/dist/frontend/lowering/effect-free.js.map +1 -0
- package/dist/frontend/lowering/expressions/array-literals.d.ts +10 -0
- package/dist/frontend/lowering/expressions/array-literals.js +62 -0
- package/dist/frontend/lowering/expressions/array-literals.js.map +1 -1
- package/dist/frontend/lowering/expressions/binary.js +115 -5
- package/dist/frontend/lowering/expressions/binary.js.map +1 -1
- package/dist/frontend/lowering/expressions/element-access.js +151 -7
- package/dist/frontend/lowering/expressions/element-access.js.map +1 -1
- package/dist/frontend/lowering/expressions/hosted-narrowing.d.ts +15 -0
- package/dist/frontend/lowering/expressions/hosted-narrowing.js +54 -1
- package/dist/frontend/lowering/expressions/hosted-narrowing.js.map +1 -1
- package/dist/frontend/lowering/expressions/identifiers.js +31 -2
- package/dist/frontend/lowering/expressions/identifiers.js.map +1 -1
- package/dist/frontend/lowering/expressions/narrowing.d.ts +3 -0
- package/dist/frontend/lowering/expressions/narrowing.js +175 -22
- package/dist/frontend/lowering/expressions/narrowing.js.map +1 -1
- package/dist/frontend/lowering/expressions/object-literals.js +173 -11
- package/dist/frontend/lowering/expressions/object-literals.js.map +1 -1
- package/dist/frontend/lowering/expressions/optional-chains.js +5 -1
- package/dist/frontend/lowering/expressions/optional-chains.js.map +1 -1
- package/dist/frontend/lowering/expressions/property-access.d.ts +8 -0
- package/dist/frontend/lowering/expressions/property-access.js +379 -109
- package/dist/frontend/lowering/expressions/property-access.js.map +1 -1
- package/dist/frontend/lowering/expressions/relational.js +237 -7
- package/dist/frontend/lowering/expressions/relational.js.map +1 -1
- package/dist/frontend/lowering/expressions/typeof.js +8 -0
- package/dist/frontend/lowering/expressions/typeof.js.map +1 -1
- package/dist/frontend/lowering/expressions/union-fields.d.ts +20 -1
- package/dist/frontend/lowering/expressions/union-fields.js +103 -13
- package/dist/frontend/lowering/expressions/union-fields.js.map +1 -1
- package/dist/frontend/lowering/expressions/updates.js +74 -55
- package/dist/frontend/lowering/expressions/updates.js.map +1 -1
- package/dist/frontend/lowering/function-returns.js +37 -10
- package/dist/frontend/lowering/function-returns.js.map +1 -1
- package/dist/frontend/lowering/general-streams.js +5 -0
- package/dist/frontend/lowering/general-streams.js.map +1 -1
- package/dist/frontend/lowering/generator-delegation.d.ts +15 -7
- package/dist/frontend/lowering/generator-delegation.js +301 -118
- package/dist/frontend/lowering/generator-delegation.js.map +1 -1
- package/dist/frontend/lowering/generic-functions.d.ts +27 -1
- package/dist/frontend/lowering/generic-functions.js +432 -18
- package/dist/frontend/lowering/generic-functions.js.map +1 -1
- package/dist/frontend/lowering/global-function-values.d.ts +25 -0
- package/dist/frontend/lowering/global-function-values.js +193 -0
- package/dist/frontend/lowering/global-function-values.js.map +1 -0
- package/dist/frontend/lowering/global-values.d.ts +6 -4
- package/dist/frontend/lowering/global-values.js +24 -10
- package/dist/frontend/lowering/global-values.js.map +1 -1
- package/dist/frontend/lowering/host-global-values.d.ts +31 -0
- package/dist/frontend/lowering/host-global-values.js +121 -0
- package/dist/frontend/lowering/host-global-values.js.map +1 -0
- package/dist/frontend/lowering/host-globals.d.ts +74 -0
- package/dist/frontend/lowering/host-globals.js +344 -0
- package/dist/frontend/lowering/host-globals.js.map +1 -0
- package/dist/frontend/lowering/http2-constants.js +1 -1
- package/dist/frontend/lowering/iterator-adapters.js +46 -17
- package/dist/frontend/lowering/iterator-adapters.js.map +1 -1
- package/dist/frontend/lowering/iterator-prototype.d.ts +30 -0
- package/dist/frontend/lowering/iterator-prototype.js +160 -0
- package/dist/frontend/lowering/iterator-prototype.js.map +1 -0
- package/dist/frontend/lowering/key-order-witness.js +43 -22
- package/dist/frontend/lowering/key-order-witness.js.map +1 -1
- package/dist/frontend/lowering/key-order-witness.test.js +1 -0
- package/dist/frontend/lowering/key-order-witness.test.js.map +1 -1
- package/dist/frontend/lowering/lib-boundary.js +11 -3
- package/dist/frontend/lowering/lib-boundary.js.map +1 -1
- package/dist/frontend/lowering/lower-assert.js +30 -15
- package/dist/frontend/lowering/lower-assert.js.map +1 -1
- package/dist/frontend/lowering/lower-async-iteration.d.ts +11 -0
- package/dist/frontend/lowering/lower-async-iteration.js +15 -0
- package/dist/frontend/lowering/lower-async-iteration.js.map +1 -1
- package/dist/frontend/lowering/lower-builtin-values.js +11 -1
- package/dist/frontend/lowering/lower-builtin-values.js.map +1 -1
- package/dist/frontend/lowering/lower-calls.d.ts +25 -0
- package/dist/frontend/lowering/lower-calls.js +929 -227
- package/dist/frontend/lowering/lower-calls.js.map +1 -1
- package/dist/frontend/lowering/lower-calls.test.js +59 -16
- package/dist/frontend/lowering/lower-calls.test.js.map +1 -1
- package/dist/frontend/lowering/lower-classes.d.ts +20 -0
- package/dist/frontend/lowering/lower-classes.js +468 -44
- package/dist/frontend/lowering/lower-classes.js.map +1 -1
- package/dist/frontend/lowering/lower-event-emitter.d.ts +6 -2
- package/dist/frontend/lowering/lower-event-emitter.js +253 -83
- package/dist/frontend/lowering/lower-event-emitter.js.map +1 -1
- package/dist/frontend/lowering/lower-exprs.d.ts +1 -1
- package/dist/frontend/lowering/lower-exprs.js +71 -20
- package/dist/frontend/lowering/lower-exprs.js.map +1 -1
- package/dist/frontend/lowering/lower-functions.js +25 -6
- package/dist/frontend/lowering/lower-functions.js.map +1 -1
- package/dist/frontend/lowering/lower-generators.js +57 -10
- package/dist/frontend/lowering/lower-generators.js.map +1 -1
- package/dist/frontend/lowering/lower-global-value.d.ts +6 -0
- package/dist/frontend/lowering/lower-global-value.js +14 -5
- package/dist/frontend/lowering/lower-global-value.js.map +1 -1
- package/dist/frontend/lowering/lower-inspect.d.ts +4 -0
- package/dist/frontend/lowering/lower-inspect.js +638 -64
- package/dist/frontend/lowering/lower-inspect.js.map +1 -1
- package/dist/frontend/lowering/lower-modules.js +48 -2
- package/dist/frontend/lowering/lower-modules.js.map +1 -1
- package/dist/frontend/lowering/lower-namespaces.js +18 -0
- package/dist/frontend/lowering/lower-namespaces.js.map +1 -1
- package/dist/frontend/lowering/lower-node-island.js +16 -6
- package/dist/frontend/lowering/lower-node-island.js.map +1 -1
- package/dist/frontend/lowering/lower-server.js +303 -87
- package/dist/frontend/lowering/lower-server.js.map +1 -1
- package/dist/frontend/lowering/lower-stdlib.js +45 -0
- package/dist/frontend/lowering/lower-stdlib.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.d.ts +14 -11
- package/dist/frontend/lowering/lower-stmts.js +270 -52
- package/dist/frontend/lowering/lower-stmts.js.map +1 -1
- package/dist/frontend/lowering/lower-timers.js +110 -27
- package/dist/frontend/lowering/lower-timers.js.map +1 -1
- package/dist/frontend/lowering/lower-url.js +6 -3
- package/dist/frontend/lowering/lower-url.js.map +1 -1
- package/dist/frontend/lowering/lowerer.d.ts +227 -21
- package/dist/frontend/lowering/lowerer.js +651 -92
- package/dist/frontend/lowering/lowerer.js.map +1 -1
- package/dist/frontend/lowering/lowerer.test.js +18 -0
- package/dist/frontend/lowering/lowerer.test.js.map +1 -1
- package/dist/frontend/lowering/lowering-facts.d.ts +110 -0
- package/dist/frontend/lowering/lowering-facts.js +323 -0
- package/dist/frontend/lowering/lowering-facts.js.map +1 -0
- package/dist/frontend/lowering/lowering-facts.test.d.ts +1 -0
- package/dist/frontend/lowering/lowering-facts.test.js +100 -0
- package/dist/frontend/lowering/lowering-facts.test.js.map +1 -0
- package/dist/frontend/lowering/nan-coded-reads.d.ts +27 -4
- package/dist/frontend/lowering/nan-coded-reads.js +112 -9
- package/dist/frontend/lowering/nan-coded-reads.js.map +1 -1
- package/dist/frontend/lowering/optional-arguments.d.ts +4 -0
- package/dist/frontend/lowering/optional-arguments.js +26 -2
- package/dist/frontend/lowering/optional-arguments.js.map +1 -1
- package/dist/frontend/lowering/partial-assertions.d.ts +0 -3
- package/dist/frontend/lowering/partial-assertions.js +9 -15
- package/dist/frontend/lowering/partial-assertions.js.map +1 -1
- package/dist/frontend/lowering/primitive-throws.d.ts +100 -0
- package/dist/frontend/lowering/primitive-throws.js +241 -0
- package/dist/frontend/lowering/primitive-throws.js.map +1 -0
- package/dist/frontend/lowering/primitive-wrappers.js +1 -0
- package/dist/frontend/lowering/primitive-wrappers.js.map +1 -1
- package/dist/frontend/lowering/record-inherited.d.ts +17 -1
- package/dist/frontend/lowering/record-inherited.js +16 -2
- package/dist/frontend/lowering/record-inherited.js.map +1 -1
- package/dist/frontend/lowering/record-links.d.ts +73 -0
- package/dist/frontend/lowering/record-links.js +797 -0
- package/dist/frontend/lowering/record-links.js.map +1 -0
- package/dist/frontend/lowering/runtime-optional-provenance.d.ts +27 -7
- package/dist/frontend/lowering/runtime-optional-provenance.js +25 -11
- package/dist/frontend/lowering/runtime-optional-provenance.js.map +1 -1
- package/dist/frontend/lowering/runtime-optional-report.d.ts +40 -0
- package/dist/frontend/lowering/runtime-optional-report.js +300 -0
- package/dist/frontend/lowering/runtime-optional-report.js.map +1 -0
- package/dist/frontend/lowering/scoped-type-memo.test.d.ts +1 -0
- package/dist/frontend/lowering/scoped-type-memo.test.js +86 -0
- package/dist/frontend/lowering/scoped-type-memo.test.js.map +1 -0
- package/dist/frontend/lowering/static-typeof.d.ts +3 -1
- package/dist/frontend/lowering/static-typeof.js +6 -1
- package/dist/frontend/lowering/static-typeof.js.map +1 -1
- package/dist/frontend/lowering/strict-mode.d.ts +1 -5
- package/dist/frontend/lowering/strict-mode.js +4 -30
- package/dist/frontend/lowering/strict-mode.js.map +1 -1
- package/dist/frontend/lowering/structural-instances.d.ts +7 -0
- package/dist/frontend/lowering/structural-instances.js +23 -0
- package/dist/frontend/lowering/structural-instances.js.map +1 -1
- package/dist/frontend/lowering/surfaces.d.ts +15 -1
- package/dist/frontend/lowering/surfaces.js +78 -10
- package/dist/frontend/lowering/surfaces.js.map +1 -1
- package/dist/frontend/lowering/union-retag.d.ts +13 -1
- package/dist/frontend/lowering/union-retag.js +55 -1
- package/dist/frontend/lowering/union-retag.js.map +1 -1
- package/dist/frontend/lowering/union-retag.test.js +51 -0
- package/dist/frontend/lowering/union-retag.test.js.map +1 -1
- package/dist/frontend/lowering/unit-journal.d.ts +8 -0
- package/dist/frontend/lowering/unit-journal.js +14 -0
- package/dist/frontend/lowering/unit-journal.js.map +1 -1
- package/dist/frontend/lowering/unit-journal.test.js +36 -1
- package/dist/frontend/lowering/unit-journal.test.js.map +1 -1
- package/dist/frontend/lowering/zlib-constants.js +3 -2
- package/dist/frontend/lowering/zlib-constants.js.map +1 -1
- package/dist/frontend/npm-static.js +78 -9
- package/dist/frontend/npm-static.js.map +1 -1
- package/dist/frontend/npm-static.test.js +95 -2
- package/dist/frontend/npm-static.test.js.map +1 -1
- package/dist/frontend/pipeline.d.ts +5 -4
- package/dist/frontend/pipeline.js +94 -31
- package/dist/frontend/pipeline.js.map +1 -1
- package/dist/frontend/pipeline.test.js +68 -11
- package/dist/frontend/pipeline.test.js.map +1 -1
- package/dist/frontend/program.d.ts +62 -2
- package/dist/frontend/program.js +695 -422
- package/dist/frontend/program.js.map +1 -1
- package/dist/frontend/program.test.js +37 -1
- package/dist/frontend/program.test.js.map +1 -1
- package/dist/frontend/services-node.d.ts +7 -0
- package/dist/frontend/services-node.js +32 -1
- package/dist/frontend/services-node.js.map +1 -1
- package/dist/frontend/services-node.test.js +51 -0
- package/dist/frontend/services-node.test.js.map +1 -1
- package/dist/frontend/shape-inference/overlay.js +68 -2
- package/dist/frontend/shape-inference/overlay.js.map +1 -1
- package/dist/frontend/tier-analysis.d.ts +9 -0
- package/dist/frontend/tier-analysis.js +1 -0
- package/dist/frontend/tier-analysis.js.map +1 -1
- package/dist/frontend/tsc-codes.d.ts +57 -3
- package/dist/frontend/tsc-codes.js +935 -150
- package/dist/frontend/tsc-codes.js.map +1 -1
- package/dist/frontend/tsc-codes.test.js +221 -12
- package/dist/frontend/tsc-codes.test.js.map +1 -1
- package/dist/frontend/type-mapper.d.ts +91 -9
- package/dist/frontend/type-mapper.js +622 -181
- package/dist/frontend/type-mapper.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +80 -15
- package/dist/index.js.map +1 -1
- package/dist/index.test.d.ts +1 -0
- package/dist/index.test.js +60 -0
- package/dist/index.test.js.map +1 -0
- package/dist/ir/builtin-effects.js +43 -0
- package/dist/ir/builtin-effects.js.map +1 -1
- package/dist/ir/builtin-signatures.d.ts +1 -1
- package/dist/ir/builtin-signatures.js +242 -16
- package/dist/ir/builtin-signatures.js.map +1 -1
- package/dist/ir/callback-specialization.d.ts +3 -2
- package/dist/ir/callback-specialization.js +35 -25
- package/dist/ir/callback-specialization.js.map +1 -1
- package/dist/ir/capture-values.d.ts +8 -4
- package/dist/ir/capture-values.js +9 -6
- package/dist/ir/capture-values.js.map +1 -1
- package/dist/ir/char-unit-locals.d.ts +6 -2
- package/dist/ir/char-unit-locals.js +11 -2
- package/dist/ir/char-unit-locals.js.map +1 -1
- package/dist/ir/class-key-index.d.ts +18 -0
- package/dist/ir/class-key-index.js +29 -0
- package/dist/ir/class-key-index.js.map +1 -0
- package/dist/ir/class-key-index.test.d.ts +1 -0
- package/dist/ir/class-key-index.test.js +25 -0
- package/dist/ir/class-key-index.test.js.map +1 -0
- package/dist/ir/codec.generated.d.ts +1 -1
- package/dist/ir/codec.generated.js +724 -648
- package/dist/ir/codec.generated.js.map +1 -1
- package/dist/ir/constant-globals.d.ts +5 -2
- package/dist/ir/constant-globals.js +25 -27
- package/dist/ir/constant-globals.js.map +1 -1
- package/dist/ir/expression-inlining.d.ts +4 -2
- package/dist/ir/expression-inlining.js +8 -2
- package/dist/ir/expression-inlining.js.map +1 -1
- package/dist/ir/field-values.d.ts +5 -2
- package/dist/ir/field-values.js +32 -21
- package/dist/ir/field-values.js.map +1 -1
- package/dist/ir/fields.generated.d.ts +11 -2
- package/dist/ir/fields.generated.js +8 -0
- package/dist/ir/fields.generated.js.map +1 -1
- package/dist/ir/final-fields.js +1 -1
- package/dist/ir/final-fields.js.map +1 -1
- package/dist/ir/function-references.d.ts +5 -4
- package/dist/ir/function-references.js +7 -4
- package/dist/ir/function-references.js.map +1 -1
- package/dist/ir/function-references.test.js +7 -0
- package/dist/ir/function-references.test.js.map +1 -1
- package/dist/ir/init-only-globals.d.ts +4 -2
- package/dist/ir/init-only-globals.js +17 -18
- package/dist/ir/init-only-globals.js.map +1 -1
- package/dist/ir/inline-array-views.js +1 -0
- package/dist/ir/inline-array-views.js.map +1 -1
- package/dist/ir/int32-slots.js +7 -0
- package/dist/ir/int32-slots.js.map +1 -1
- package/dist/ir/ir.d.ts +59 -4
- package/dist/ir/ir.js +7 -0
- package/dist/ir/ir.js.map +1 -1
- package/dist/ir/js-groups.d.ts +51 -0
- package/dist/ir/js-groups.js +394 -0
- package/dist/ir/js-groups.js.map +1 -0
- package/dist/ir/js-groups.test.d.ts +1 -0
- package/dist/ir/js-groups.test.js +555 -0
- package/dist/ir/js-groups.test.js.map +1 -0
- package/dist/ir/js-ic.js +30 -5
- package/dist/ir/js-ic.js.map +1 -1
- package/dist/ir/js-ic.test.js +27 -1
- package/dist/ir/js-ic.test.js.map +1 -1
- package/dist/ir/node-index.d.ts +23 -6
- package/dist/ir/node-index.js +126 -49
- package/dist/ir/node-index.js.map +1 -1
- package/dist/ir/numeric-call-specialization.d.ts +4 -2
- package/dist/ir/numeric-call-specialization.js +40 -26
- package/dist/ir/numeric-call-specialization.js.map +1 -1
- package/dist/ir/paired-while-loops.d.ts +4 -2
- package/dist/ir/paired-while-loops.js +8 -2
- package/dist/ir/paired-while-loops.js.map +1 -1
- package/dist/ir/parameter-versions.d.ts +13 -4
- package/dist/ir/parameter-versions.js +63 -42
- package/dist/ir/parameter-versions.js.map +1 -1
- package/dist/ir/property-bags.d.ts +4 -2
- package/dist/ir/property-bags.js +22 -17
- package/dist/ir/property-bags.js.map +1 -1
- package/dist/ir/row-pairs.d.ts +4 -2
- package/dist/ir/row-pairs.js +12 -11
- package/dist/ir/row-pairs.js.map +1 -1
- package/dist/ir/runtime-features.d.ts +87 -12
- package/dist/ir/runtime-features.js +263 -160
- package/dist/ir/runtime-features.js.map +1 -1
- package/dist/ir/runtime-features.test.js +109 -139
- package/dist/ir/runtime-features.test.js.map +1 -1
- package/dist/ir/runtime-jam-loops.d.ts +35 -0
- package/dist/ir/runtime-jam-loops.js +604 -0
- package/dist/ir/runtime-jam-loops.js.map +1 -0
- package/dist/ir/runtime-jam-loops.test.d.ts +1 -0
- package/dist/ir/runtime-jam-loops.test.js +565 -0
- package/dist/ir/runtime-jam-loops.test.js.map +1 -0
- package/dist/ir/saturating-loop-jams.d.ts +4 -2
- package/dist/ir/saturating-loop-jams.js +11 -10
- package/dist/ir/saturating-loop-jams.js.map +1 -1
- package/dist/ir/scalar-records.d.ts +5 -2
- package/dist/ir/scalar-records.js +12 -2
- package/dist/ir/scalar-records.js.map +1 -1
- package/dist/ir/self-captures.d.ts +4 -2
- package/dist/ir/self-captures.js +32 -27
- package/dist/ir/self-captures.js.map +1 -1
- package/dist/ir/serialize.d.ts +6 -1
- package/dist/ir/serialize.js +87 -23
- package/dist/ir/serialize.js.map +1 -1
- package/dist/ir/serialize.test.js +26 -0
- package/dist/ir/serialize.test.js.map +1 -1
- package/dist/ir/tiers.js +1 -0
- package/dist/ir/tiers.js.map +1 -1
- package/dist/ir/traverse.js +4 -0
- package/dist/ir/traverse.js.map +1 -1
- package/dist/ir/typed-argument-clones.d.ts +30 -0
- package/dist/ir/typed-argument-clones.js +789 -0
- package/dist/ir/typed-argument-clones.js.map +1 -0
- package/dist/ir/union-arm-loops.d.ts +3 -0
- package/dist/ir/union-arm-loops.js +373 -0
- package/dist/ir/union-arm-loops.js.map +1 -0
- package/dist/ir/union-arm-loops.test.d.ts +1 -0
- package/dist/ir/union-arm-loops.test.js +230 -0
- package/dist/ir/union-arm-loops.test.js.map +1 -0
- package/dist/ir/validate.js +88 -18
- package/dist/ir/validate.js.map +1 -1
- package/dist/library/compiler-self-identity.d.ts +8 -2
- package/dist/library/compiler-self-identity.js +92 -18
- package/dist/library/compiler-self-identity.js.map +1 -1
- package/dist/library/compiler-self-identity.test.js +150 -3
- package/dist/library/compiler-self-identity.test.js.map +1 -1
- package/dist/library/int-infer.d.ts +5 -0
- package/dist/library/int-infer.js +15 -3
- package/dist/library/int-infer.js.map +1 -1
- package/dist/library/ir-policy.js +1 -0
- package/dist/library/ir-policy.js.map +1 -1
- package/dist/library/library-cache.d.ts +4 -0
- package/dist/library/library-cache.js +2 -0
- package/dist/library/library-cache.js.map +1 -1
- package/dist/library/library-cache.test.js +26 -0
- package/dist/library/library-cache.test.js.map +1 -1
- package/dist/library/prepare.js +99 -31
- package/dist/library/prepare.js.map +1 -1
- package/dist/native/cache.d.ts +7 -0
- package/dist/native/cache.js +47 -0
- package/dist/native/cache.js.map +1 -1
- package/dist/native/cache.test.js +13 -1
- package/dist/native/cache.test.js.map +1 -1
- package/dist/native/cli.js +1 -1
- package/dist/native/cli.js.map +1 -1
- package/dist/native/compiler.js +18 -3
- package/dist/native/compiler.js.map +1 -1
- package/dist/native/executable-cache-open.test.js +31 -5
- package/dist/native/executable-cache-open.test.js.map +1 -1
- package/dist/native/executable-cache.d.ts +6 -1
- package/dist/native/executable-cache.js +7 -1
- package/dist/native/executable-cache.js.map +1 -1
- package/dist/native/prepare.d.ts +3 -0
- package/dist/native/prepare.js +43 -26
- package/dist/native/prepare.js.map +1 -1
- package/dist/native/prepare.test.js +25 -3
- package/dist/native/prepare.test.js.map +1 -1
- package/dist/native/sanitizer.js +10 -1
- package/dist/native/sanitizer.js.map +1 -1
- package/dist/native/sanitizer.test.js +7 -2
- package/dist/native/sanitizer.test.js.map +1 -1
- package/dist/node-islands/boundary.d.ts +12 -0
- package/dist/node-islands/boundary.js +38 -6
- package/dist/node-islands/boundary.js.map +1 -1
- package/dist/node-islands/boundary.test.d.ts +1 -0
- package/dist/node-islands/boundary.test.js +76 -0
- package/dist/node-islands/boundary.test.js.map +1 -0
- package/dist/node-islands/detect.d.ts +9 -0
- package/dist/node-islands/detect.js +110 -0
- package/dist/node-islands/detect.js.map +1 -1
- package/dist/node-islands/detect.test.js +24 -0
- package/dist/node-islands/detect.test.js.map +1 -1
- package/dist/node-islands/graph-islands.d.ts +40 -0
- package/dist/node-islands/graph-islands.js +128 -0
- package/dist/node-islands/graph-islands.js.map +1 -0
- package/dist/node-islands/growth.d.ts +57 -0
- package/dist/node-islands/growth.js +205 -0
- package/dist/node-islands/growth.js.map +1 -0
- package/dist/node-islands/report.d.ts +12 -0
- package/dist/node-islands/report.js +28 -0
- package/dist/node-islands/report.js.map +1 -1
- package/dist/node-islands/report.test.js +2 -0
- package/dist/node-islands/report.test.js.map +1 -1
- package/dist/node-islands/rules.js +5 -0
- package/dist/node-islands/rules.js.map +1 -1
- package/dist/node-islands/scan.d.ts +11 -2
- package/dist/node-islands/scan.js +61 -9
- package/dist/node-islands/scan.js.map +1 -1
- package/dist/wasm/translate.js +11 -5
- package/dist/wasm/translate.js.map +1 -1
- package/dist/wasm/translate.test.js +35 -0
- package/dist/wasm/translate.test.js.map +1 -1
- package/package.json +20 -20
- package/surface-manifest.json +184 -117
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/** Builtin global functions JavaScript sources read as values (`const p =
|
|
2
|
+
* parseInt`, `globalThis[name]`) beyond the interned function and
|
|
3
|
+
* constructor values (builtinGlobalValue):
|
|
4
|
+
* - parseInt and parseFloat are the Number statics' function values, as in
|
|
5
|
+
* Node (`parseInt === Number.parseInt`).
|
|
6
|
+
* - isNaN and isFinite convert their argument with ToNumber.
|
|
7
|
+
* - Symbol makes a symbol whose description is its argument's ToString, or
|
|
8
|
+
* one without a description when the argument is undefined.
|
|
9
|
+
* - eval throws the EvalError a direct call throws (code-generation.ts).
|
|
10
|
+
* - escape, unescape, WeakRef and AsyncDisposableStack have no lowering:
|
|
11
|
+
* their values have Node's name and length and throw SC2020 when called
|
|
12
|
+
* or constructed, as their direct uses refuse. */
|
|
13
|
+
import { BOOL, DYN, F64, STRING, SYMBOL_T, } from "../../ir/ir.js";
|
|
14
|
+
import { dynUndefinedExpr, nodeThrowExpr, varRef } from "../../ir/build.js";
|
|
15
|
+
import { noLoweringDiag } from "../../diagnostics/diagnostic.js";
|
|
16
|
+
import { lowerNumberParserValue } from "./lower-builtin-values.js";
|
|
17
|
+
import { CODE_GENERATION_DISALLOWED } from "./code-generation.js";
|
|
18
|
+
/** The globals without a lowering, with Node's length for each. */
|
|
19
|
+
const UNLOWERED = new Map([
|
|
20
|
+
["escape", 1],
|
|
21
|
+
["unescape", 1],
|
|
22
|
+
["WeakRef", 1],
|
|
23
|
+
["AsyncDisposableStack", 0],
|
|
24
|
+
]);
|
|
25
|
+
/** Whether `name` is a global without a lowering, whose value throws the
|
|
26
|
+
* fence. TypeScript sources keep the compile-time refusal for these. */
|
|
27
|
+
export function isUnloweredGlobal(name) {
|
|
28
|
+
return UNLOWERED.has(name);
|
|
29
|
+
}
|
|
30
|
+
/** The globals function values are built for: the ones read below, and the
|
|
31
|
+
* ones without a lowering. */
|
|
32
|
+
const GLOBAL_VALUE_NAMES = new Set([
|
|
33
|
+
"parseInt",
|
|
34
|
+
"parseFloat",
|
|
35
|
+
"isNaN",
|
|
36
|
+
"isFinite",
|
|
37
|
+
"Symbol",
|
|
38
|
+
"eval",
|
|
39
|
+
...UNLOWERED.keys(),
|
|
40
|
+
]);
|
|
41
|
+
/** Whether a JavaScript source reads `name` as one of the function values
|
|
42
|
+
* this file builds (never as a class value). */
|
|
43
|
+
export function hasGlobalFunctionValue(name) {
|
|
44
|
+
return GLOBAL_VALUE_NAMES.has(name);
|
|
45
|
+
}
|
|
46
|
+
/** The value a JavaScript source reads for the global function `name`, or
|
|
47
|
+
* null when it has none here. `reportFences` is false for the program's
|
|
48
|
+
* global lookup, which holds every declared global's value whether or not
|
|
49
|
+
* the program reads it: only a read reports the value's fence. */
|
|
50
|
+
export function globalFunctionValue(lowerer, name, loc, reportFences = true) {
|
|
51
|
+
switch (name) {
|
|
52
|
+
case "parseInt":
|
|
53
|
+
case "parseFloat":
|
|
54
|
+
return lowerNumberParserValue(lowerer, name, loc);
|
|
55
|
+
case "isNaN":
|
|
56
|
+
case "isFinite":
|
|
57
|
+
return numberTestValue(lowerer, name, loc);
|
|
58
|
+
case "Symbol":
|
|
59
|
+
return symbolValue(lowerer, loc);
|
|
60
|
+
case "eval":
|
|
61
|
+
return evalValue(lowerer, loc);
|
|
62
|
+
default: {
|
|
63
|
+
const length = UNLOWERED.get(name);
|
|
64
|
+
return length === undefined ? null : unloweredValue(lowerer, name, length, loc, reportFences);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/** A lifted function `%builtin.global.<name>` of one checked-dynamic
|
|
69
|
+
* parameter, defined once, boxed under Node's name and, when it differs
|
|
70
|
+
* from 1, Node's length. */
|
|
71
|
+
function oneArgumentValue(lowerer, name, ret, body, loc, length) {
|
|
72
|
+
const fnName = `%builtin.global.${name}`;
|
|
73
|
+
if (!lowerer.liftedFns.some((fn) => fn.name === fnName))
|
|
74
|
+
lowerer.liftedFns.push({
|
|
75
|
+
name: fnName,
|
|
76
|
+
params: [{ localId: "value.0", name: "value", type: DYN }],
|
|
77
|
+
locals: [{ id: "value.0", name: "value", type: DYN, mutable: false }],
|
|
78
|
+
returnType: ret,
|
|
79
|
+
body: body(varRef("value.0", DYN, loc)),
|
|
80
|
+
loc,
|
|
81
|
+
});
|
|
82
|
+
return {
|
|
83
|
+
kind: "dynFrom",
|
|
84
|
+
value: {
|
|
85
|
+
kind: "closure",
|
|
86
|
+
fnName,
|
|
87
|
+
captures: [],
|
|
88
|
+
type: { kind: "func", params: [DYN], ret },
|
|
89
|
+
loc,
|
|
90
|
+
},
|
|
91
|
+
fnName: name,
|
|
92
|
+
...(length !== undefined ? { fnLength: length } : {}),
|
|
93
|
+
type: DYN,
|
|
94
|
+
loc,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
/** isNaN and isFinite: ToNumber, then the test. */
|
|
98
|
+
function numberTestValue(lowerer, name, loc) {
|
|
99
|
+
return oneArgumentValue(lowerer, name, BOOL, (argument) => [
|
|
100
|
+
{
|
|
101
|
+
kind: "return",
|
|
102
|
+
value: {
|
|
103
|
+
kind: "libCall",
|
|
104
|
+
fn: name === "isNaN" ? "num.isNaN" : "number.isFinite",
|
|
105
|
+
args: [{ kind: "libCall", fn: "dyn.toNumberCoerce", args: [argument], type: F64, loc }],
|
|
106
|
+
type: BOOL,
|
|
107
|
+
loc,
|
|
108
|
+
},
|
|
109
|
+
loc,
|
|
110
|
+
},
|
|
111
|
+
], loc);
|
|
112
|
+
}
|
|
113
|
+
/** Symbol(description). */
|
|
114
|
+
function symbolValue(lowerer, loc) {
|
|
115
|
+
return oneArgumentValue(lowerer, "Symbol", SYMBOL_T, (argument) => [
|
|
116
|
+
{
|
|
117
|
+
kind: "if",
|
|
118
|
+
cond: { kind: "dynTest", test: "undefined", value: argument, type: BOOL, loc },
|
|
119
|
+
then: [
|
|
120
|
+
{
|
|
121
|
+
kind: "return",
|
|
122
|
+
value: { kind: "libCall", fn: "sym.newAnon", args: [], type: SYMBOL_T, loc },
|
|
123
|
+
loc,
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
else_: null,
|
|
127
|
+
loc,
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
kind: "return",
|
|
131
|
+
value: {
|
|
132
|
+
kind: "libCall",
|
|
133
|
+
fn: "sym.new",
|
|
134
|
+
args: [
|
|
135
|
+
{ kind: "libCall", fn: "dyn.toStringCoerce", args: [argument], type: STRING, loc },
|
|
136
|
+
],
|
|
137
|
+
type: SYMBOL_T,
|
|
138
|
+
loc,
|
|
139
|
+
},
|
|
140
|
+
loc,
|
|
141
|
+
},
|
|
142
|
+
], loc,
|
|
143
|
+
// Node's Symbol declares no parameters.
|
|
144
|
+
0);
|
|
145
|
+
}
|
|
146
|
+
/** eval: the EvalError every code-generation call throws. */
|
|
147
|
+
function evalValue(lowerer, loc) {
|
|
148
|
+
return oneArgumentValue(lowerer, "eval", DYN, () => [
|
|
149
|
+
{
|
|
150
|
+
kind: "exprStmt",
|
|
151
|
+
expr: nodeThrowExpr(6, "", CODE_GENERATION_DISALLOWED, F64, loc),
|
|
152
|
+
loc,
|
|
153
|
+
},
|
|
154
|
+
{ kind: "return", value: dynUndefinedExpr(loc), loc },
|
|
155
|
+
], loc);
|
|
156
|
+
}
|
|
157
|
+
/** A global without a lowering: calling or constructing it throws the
|
|
158
|
+
* SC2020 fence its direct use reports. Each read that reaches the value
|
|
159
|
+
* reports the fence; the program's lookup holds the value without
|
|
160
|
+
* reporting one. */
|
|
161
|
+
function unloweredValue(lowerer, name, length, loc, reportFences) {
|
|
162
|
+
const fnName = `%builtin.fence.global.${name}`;
|
|
163
|
+
const diag = noLoweringDiag(name, loc);
|
|
164
|
+
if (!lowerer.liftedFns.some((fn) => fn.name === fnName)) {
|
|
165
|
+
lowerer.liftedFns.push({
|
|
166
|
+
name: fnName,
|
|
167
|
+
params: [],
|
|
168
|
+
locals: [],
|
|
169
|
+
returnType: DYN,
|
|
170
|
+
body: [
|
|
171
|
+
{ kind: "runtimeFence", code: diag.code, message: `${diag.message} [${diag.code}]`, loc },
|
|
172
|
+
],
|
|
173
|
+
loc,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
if (reportFences)
|
|
177
|
+
lowerer.runtimeFences.push(diag);
|
|
178
|
+
return {
|
|
179
|
+
kind: "dynFrom",
|
|
180
|
+
value: {
|
|
181
|
+
kind: "closure",
|
|
182
|
+
fnName,
|
|
183
|
+
captures: [],
|
|
184
|
+
type: { kind: "func", params: [], ret: DYN },
|
|
185
|
+
loc,
|
|
186
|
+
},
|
|
187
|
+
fnName: name,
|
|
188
|
+
fnLength: length,
|
|
189
|
+
type: DYN,
|
|
190
|
+
loc,
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=global-function-values.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-function-values.js","sourceRoot":"","sources":["../../../src/frontend/lowering/global-function-values.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;oDAWoD;AACpD,OAAO,EACL,IAAI,EACJ,GAAG,EACH,GAA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IAAI,GAAG,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACvC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,MAAM,CAAC,EAAE,CAAC;QACxD,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;YACrB,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,EAAE;YACV,UAAU,EAAE,GAAG;YACf,IAAI,EAAE;gBACJ,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE;aAC1F;YACD,GAAG;SACJ,CAAC,CAAC;IACL,CAAC;IACD,IAAI,YAAY;QAAE,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnD,OAAO;QACL,IAAI,EAAE,SAAS;QACf,KAAK,EAAE;YACL,IAAI,EAAE,SAAS;YACf,MAAM;YACN,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE;YAC5C,GAAG;SACJ;QACD,MAAM,EAAE,IAAI;QACZ,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,GAAG;QACT,GAAG;KACJ,CAAC;AACJ,CAAC"}
|
|
@@ -8,8 +8,9 @@ export declare function computedGlobalReadOf(lowerer: Lowerer, sf: ts.SourceFile
|
|
|
8
8
|
/** The value a JavaScript source reads for the declared global `name`
|
|
9
9
|
* taken as a value, whatever its spelling (`name`, `globalThis.name`,
|
|
10
10
|
* `const { name } = globalThis`, `globalThis[name]`), or null when it
|
|
11
|
-
* reads the opaque identity token. `reportFences`
|
|
12
|
-
*
|
|
11
|
+
* reads the opaque identity token. `reportFences` is false for the
|
|
12
|
+
* program's lookup, which holds every declared global's value whether or
|
|
13
|
+
* not the program reads it. */
|
|
13
14
|
export declare function jsGlobalValueByName(lowerer: Lowerer, name: string, loc: SrcLoc, reportFences?: boolean): IrExpr | null;
|
|
14
15
|
/** The value a TypeScript source reads for the declared global `name` at
|
|
15
16
|
* `node` when the checker types the slot it flows into as any or unknown
|
|
@@ -21,8 +22,9 @@ export declare function jsGlobalValueByName(lowerer: Lowerer, name: string, loc:
|
|
|
21
22
|
* signature (lowerIdentifierExpr), and `{ String }` must equal it. */
|
|
22
23
|
export declare function tsUntypedGlobalValue(lowerer: Lowerer, node: ts.Expression, name: string, loc: SrcLoc): IrExpr | null;
|
|
23
24
|
/** jsGlobalValueByName for the globals other than the interned builtin
|
|
24
|
-
* functions and constructors (builtinGlobalValue).
|
|
25
|
-
|
|
25
|
+
* functions and constructors (builtinGlobalValue). `reportFences` is false
|
|
26
|
+
* for the program's lookup (jsGlobalValueByName). */
|
|
27
|
+
export declare function jsSpecialGlobalValue(lowerer: Lowerer, name: string, loc: SrcLoc, reportFences?: boolean): IrExpr | null;
|
|
26
28
|
/** The builtin globals that sloppy-mode functions of the JavaScript source
|
|
27
29
|
* `sf` read through their `this` (`this.Array`, `this["Array"]`) or through
|
|
28
30
|
* a variable it initializes (`var root = this; root.Array`); every declared
|
|
@@ -16,13 +16,14 @@ import * as ts from "../ts7/adapter.js";
|
|
|
16
16
|
import { BYTES_ELEMENT_NAME, DYN, F64, STRING, UNDEFINED_T, } from "../../ir/ir.js";
|
|
17
17
|
import { isJsSourceFile } from "../program.js";
|
|
18
18
|
import { isStrictCode } from "./strict-mode.js";
|
|
19
|
-
import { TEMPORAL_GLOBAL } from "../builtin-modules.js";
|
|
19
|
+
import { COMMONJS_MODULE_BINDINGS, TEMPORAL_GLOBAL } from "../builtin-modules.js";
|
|
20
20
|
import { stdlibGlobalNameOf } from "./surfaces.js";
|
|
21
21
|
import { builtinGlobalValue } from "./expressions/property-access.js";
|
|
22
22
|
import { builtinNamespaceValue } from "./builtin-namespaces.js";
|
|
23
23
|
import { uriFunctionValue } from "./expressions/identifiers.js";
|
|
24
24
|
import { navigatorValue } from "./builtins/navigator.js";
|
|
25
25
|
import { primitiveCtorClosure } from "./lower-exprs.js";
|
|
26
|
+
import { globalFunctionValue, isUnloweredGlobal } from "./global-function-values.js";
|
|
26
27
|
import { WEB_STREAM_CLASSES, programNamesWebStreamClass, webStreamClassValue, } from "./builtins/web-streams-dyn.js";
|
|
27
28
|
const LOOKUP_FN = "%global.builtinValue";
|
|
28
29
|
/** Names the runtime answers before the lookup runs. */
|
|
@@ -103,10 +104,11 @@ function readsBuiltinByName(lowerer, node) {
|
|
|
103
104
|
/** The value a JavaScript source reads for the declared global `name`
|
|
104
105
|
* taken as a value, whatever its spelling (`name`, `globalThis.name`,
|
|
105
106
|
* `const { name } = globalThis`, `globalThis[name]`), or null when it
|
|
106
|
-
* reads the opaque identity token. `reportFences`
|
|
107
|
-
*
|
|
107
|
+
* reads the opaque identity token. `reportFences` is false for the
|
|
108
|
+
* program's lookup, which holds every declared global's value whether or
|
|
109
|
+
* not the program reads it. */
|
|
108
110
|
export function jsGlobalValueByName(lowerer, name, loc, reportFences = true) {
|
|
109
|
-
return (jsSpecialGlobalValue(lowerer, name, loc) ??
|
|
111
|
+
return (jsSpecialGlobalValue(lowerer, name, loc, reportFences) ??
|
|
110
112
|
builtinNamespaceValue(lowerer, name, loc, reportFences) ??
|
|
111
113
|
builtinGlobalValue(name, loc, true));
|
|
112
114
|
}
|
|
@@ -124,7 +126,9 @@ const UNTYPED_UNMODELED = new Set(["Array", "setTimeout", "setImmediate"]);
|
|
|
124
126
|
* String, Number, Boolean or BigInt is the closure with the typed
|
|
125
127
|
* signature (lowerIdentifierExpr), and `{ String }` must equal it. */
|
|
126
128
|
export function tsUntypedGlobalValue(lowerer, node, name, loc) {
|
|
127
|
-
if (isJsSourceFile(ts.getSourceFileOfNode(node)) ||
|
|
129
|
+
if (isJsSourceFile(ts.getSourceFileOfNode(node)) ||
|
|
130
|
+
UNTYPED_UNMODELED.has(name) ||
|
|
131
|
+
isUnloweredGlobal(name))
|
|
128
132
|
return null;
|
|
129
133
|
if (name === "String" || name === "Number" || name === "Boolean" || name === "BigInt")
|
|
130
134
|
return null;
|
|
@@ -155,8 +159,9 @@ function flowsIntoUntypedSlot(lowerer, node) {
|
|
|
155
159
|
}
|
|
156
160
|
}
|
|
157
161
|
/** jsGlobalValueByName for the globals other than the interned builtin
|
|
158
|
-
* functions and constructors (builtinGlobalValue).
|
|
159
|
-
|
|
162
|
+
* functions and constructors (builtinGlobalValue). `reportFences` is false
|
|
163
|
+
* for the program's lookup (jsGlobalValueByName). */
|
|
164
|
+
export function jsSpecialGlobalValue(lowerer, name, loc, reportFences = true) {
|
|
160
165
|
if (name === "NaN" || name === "Infinity")
|
|
161
166
|
return { kind: "numLit", value: name === "NaN" ? NaN : Infinity, type: F64, loc };
|
|
162
167
|
if (name === "String" || name === "Number" || name === "Boolean" || name === "BigInt")
|
|
@@ -185,7 +190,7 @@ export function jsSpecialGlobalValue(lowerer, name, loc) {
|
|
|
185
190
|
return { kind: "libCall", fn: "fetch.function", args: [], type: DYN, loc };
|
|
186
191
|
if (name === "console")
|
|
187
192
|
return { kind: "libCall", fn: "console.native", args: [], type: DYN, loc };
|
|
188
|
-
return
|
|
193
|
+
return globalFunctionValue(lowerer, name, loc, reportFences);
|
|
189
194
|
}
|
|
190
195
|
const URI_FUNCTIONS = new Set([
|
|
191
196
|
"encodeURIComponent",
|
|
@@ -298,7 +303,9 @@ function declaredGlobalNames(lowerer, at) {
|
|
|
298
303
|
return lowerer.checker
|
|
299
304
|
.getPropertiesOfType(lowerer.checker.getTypeOfSymbol(symbol))
|
|
300
305
|
.map((property) => ts.symbolName(property))
|
|
301
|
-
.filter((name) => name !== TEMPORAL_GLOBAL &&
|
|
306
|
+
.filter((name) => name !== TEMPORAL_GLOBAL &&
|
|
307
|
+
!RUNTIME_ANSWERED.has(name) &&
|
|
308
|
+
!COMMONJS_MODULE_BINDINGS.has(name));
|
|
302
309
|
}
|
|
303
310
|
/** The names the program's lookup answers: every declared global when a
|
|
304
311
|
* module reads the global object by computed names, else the ones its
|
|
@@ -337,6 +344,13 @@ export function globalValuesInstall(lowerer, loc) {
|
|
|
337
344
|
: jsGlobalValueByName(lowerer, global, loc, false);
|
|
338
345
|
if (value === null)
|
|
339
346
|
continue;
|
|
347
|
+
// A function boxed here has no source spelling to take its name from
|
|
348
|
+
// (the identifier read's rule): it takes the global's name, as
|
|
349
|
+
// `globalThis.String.name` is "String".
|
|
350
|
+
const boxed = lowerer.coerceToExpected(value, DYN);
|
|
351
|
+
const named = boxed.kind === "dynFrom" && boxed.value.type.kind === "func" && boxed.fnName === undefined
|
|
352
|
+
? { ...boxed, fnName: global }
|
|
353
|
+
: boxed;
|
|
340
354
|
body.push({
|
|
341
355
|
kind: "if",
|
|
342
356
|
cond: {
|
|
@@ -347,7 +361,7 @@ export function globalValuesInstall(lowerer, loc) {
|
|
|
347
361
|
type: { kind: "bool" },
|
|
348
362
|
loc,
|
|
349
363
|
},
|
|
350
|
-
then: [{ kind: "return", value:
|
|
364
|
+
then: [{ kind: "return", value: named, loc }],
|
|
351
365
|
else_: null,
|
|
352
366
|
loc,
|
|
353
367
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-values.js","sourceRoot":"","sources":["../../../src/frontend/lowering/global-values.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;8DAa8D;AAC9D,OAAO,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EACL,kBAAkB,EAClB,GAAG,EACH,GAAG,EACH,MAAM,EACN,WAAW,GAKZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,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CAAC,CAAC,KAAK,EAAE,iBAAiB,CAAC,CAAC;IACxC,cAAc,EAAE,IAAI,GAAG,CAAC,CAAC,kBAAkB,EAAE,gBAAgB,EAAE,aAAa,CAAC,CAAC;IAC9E,YAAY,EAAE,IAAI,GAAG,CAAC;QACpB,gBAAgB;QAChB,6BAA6B;QAC7B,0BAA0B;QAC1B,2BAA2B;QAC3B,8BAA8B;QAC9B,iCAAiC;QACjC,iBAAiB;QACjB,kCAAkC;QAClC,gBAAgB;QAChB,6BAA6B;QAC7B,iCAAiC;QACjC,2BAA2B;QAC3B,sBAAsB;QACtB,mBAAmB;QACnB,mBAAmB;QACnB,mBAAmB;QACnB,qBAAqB;KACtB,CAAC;CACH,CAAC;AAEF;;qEAEqE;AACrE,MAAM,UAAU,iBAAiB,CAC/B,OAAgB,EAChB,EAAsC,EACtC,GAAW;IAEX,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5D,OAAO,CACL,mBAAmB,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI;QAC9C,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,YAAY,EAAE,CAAC,MAAM,GAAG;QAC/B,IAAI,EAAE,MAAM;QACZ,GAAG;KACJ,CACF,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"global-values.js","sourceRoot":"","sources":["../../../src/frontend/lowering/global-values.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;8DAa8D;AAC9D,OAAO,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EACL,kBAAkB,EAClB,GAAG,EACH,GAAG,EACH,MAAM,EACN,WAAW,GAKZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAA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CAAC,EAAE,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IAC5D,OAAO,CACL,mBAAmB,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI;QAC9C,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,YAAY,EAAE,CAAC,MAAM,GAAG;QAC/B,IAAI,EAAE,MAAM;QACZ,GAAG;KACJ,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** The value a read of a Node 24 global native code does not provide
|
|
2
|
+
* answers (host-globals.ts). Node has the constructor, so a read must answer
|
|
3
|
+
* a constructor: the eager read at module init (`export const FormData =
|
|
4
|
+
* instanceOf(globalThis.FormData, …)` in effect's Schema) is a value read,
|
|
5
|
+
* not a use, and refusing it rejects the module before its capability probe
|
|
6
|
+
* ever runs.
|
|
7
|
+
*
|
|
8
|
+
* The value is what Node's class is to native code: `typeof` answers
|
|
9
|
+
* "function", `name` and `length` are Node's, `instanceof` answers false for
|
|
10
|
+
* every value native code can produce (the constructor's `prototype` is an
|
|
11
|
+
* object no value's prototype chain reaches), and constructing or calling it
|
|
12
|
+
* throws the SC2020 fence its direct use reports — native code can never
|
|
13
|
+
* produce an instance. Reads that ARE a use (`new WebSocket(url)`,
|
|
14
|
+
* `FormData()`) keep the compile fence, which a JavaScript source defers to
|
|
15
|
+
* exactly that throw.
|
|
16
|
+
*
|
|
17
|
+
* The constructor is a zero-parameter closure whose function is marked
|
|
18
|
+
* `ownsPrototype`: the runtime gives every such function its own
|
|
19
|
+
* `prototype` object with `constructor` on it (scr_dyn_fn_table), the same
|
|
20
|
+
* shape a program's function declaration has, so `FormData.prototype`,
|
|
21
|
+
* `FormData.prototype.constructor === FormData` and `x instanceof FormData`
|
|
22
|
+
* all answer what Node answers without any property definition here. */
|
|
23
|
+
import * as ts from "../ts7/adapter.js";
|
|
24
|
+
import { type IrExpr } from "../../ir/ir.js";
|
|
25
|
+
import type { Lowerer } from "./lowerer.js";
|
|
26
|
+
/** The constructor value the global `name` reads as. Built once per program
|
|
27
|
+
* (the helper answers the same value every time, as the global object does).
|
|
28
|
+
* A read reports no fence: it does not throw. The value throws the SC2020
|
|
29
|
+
* fence when it is constructed or called, and the call and `new` sites that
|
|
30
|
+
* can see the global report it there (lowerer.hostGlobalFence). */
|
|
31
|
+
export declare function hostGlobalValue(lowerer: Lowerer, name: string, node: ts.Node): IrExpr;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/** The value a read of a Node 24 global native code does not provide
|
|
2
|
+
* answers (host-globals.ts). Node has the constructor, so a read must answer
|
|
3
|
+
* a constructor: the eager read at module init (`export const FormData =
|
|
4
|
+
* instanceOf(globalThis.FormData, …)` in effect's Schema) is a value read,
|
|
5
|
+
* not a use, and refusing it rejects the module before its capability probe
|
|
6
|
+
* ever runs.
|
|
7
|
+
*
|
|
8
|
+
* The value is what Node's class is to native code: `typeof` answers
|
|
9
|
+
* "function", `name` and `length` are Node's, `instanceof` answers false for
|
|
10
|
+
* every value native code can produce (the constructor's `prototype` is an
|
|
11
|
+
* object no value's prototype chain reaches), and constructing or calling it
|
|
12
|
+
* throws the SC2020 fence its direct use reports — native code can never
|
|
13
|
+
* produce an instance. Reads that ARE a use (`new WebSocket(url)`,
|
|
14
|
+
* `FormData()`) keep the compile fence, which a JavaScript source defers to
|
|
15
|
+
* exactly that throw.
|
|
16
|
+
*
|
|
17
|
+
* The constructor is a zero-parameter closure whose function is marked
|
|
18
|
+
* `ownsPrototype`: the runtime gives every such function its own
|
|
19
|
+
* `prototype` object with `constructor` on it (scr_dyn_fn_table), the same
|
|
20
|
+
* shape a program's function declaration has, so `FormData.prototype`,
|
|
21
|
+
* `FormData.prototype.constructor === FormData` and `x instanceof FormData`
|
|
22
|
+
* all answer what Node answers without any property definition here. */
|
|
23
|
+
import * as ts from "../ts7/adapter.js";
|
|
24
|
+
import { BOOL, DYN } from "../../ir/ir.js";
|
|
25
|
+
import { boolLit, varRef } from "../../ir/build.js";
|
|
26
|
+
import { hostGlobalDiag } from "../../diagnostics/diagnostic.js";
|
|
27
|
+
import { hostGlobalLength } from "./host-globals.js";
|
|
28
|
+
import { locOf } from "../program.js";
|
|
29
|
+
/** The constructor value the global `name` reads as. Built once per program
|
|
30
|
+
* (the helper answers the same value every time, as the global object does).
|
|
31
|
+
* A read reports no fence: it does not throw. The value throws the SC2020
|
|
32
|
+
* fence when it is constructed or called, and the call and `new` sites that
|
|
33
|
+
* can see the global report it there (lowerer.hostGlobalFence). */
|
|
34
|
+
export function hostGlobalValue(lowerer, name, node) {
|
|
35
|
+
const loc = locOf(node);
|
|
36
|
+
const helper = `%builtin.hostGlobal.${name}`;
|
|
37
|
+
if (!lowerer.liftedFns.some((fn) => fn.name === helper))
|
|
38
|
+
defineHostGlobalBuilder(lowerer, name, helper, node);
|
|
39
|
+
lowerer.noteEdge(helper);
|
|
40
|
+
return { kind: "call", callee: helper, args: [], type: DYN, loc };
|
|
41
|
+
}
|
|
42
|
+
/** The lifted function that builds the constructor once and answers the same
|
|
43
|
+
* value afterwards. */
|
|
44
|
+
function defineHostGlobalBuilder(lowerer, name, helper, node) {
|
|
45
|
+
const loc = locOf(node);
|
|
46
|
+
const fence = `%builtin.fence.global.${name}`;
|
|
47
|
+
if (!lowerer.liftedFns.some((fn) => fn.name === fence)) {
|
|
48
|
+
const diag = hostGlobalDiag(name, loc);
|
|
49
|
+
lowerer.liftedFns.push({
|
|
50
|
+
name: fence,
|
|
51
|
+
ownsPrototype: true,
|
|
52
|
+
params: [],
|
|
53
|
+
locals: [],
|
|
54
|
+
returnType: DYN,
|
|
55
|
+
body: [{ kind: "runtimeFence", code: diag.code, message: fenceMessage(diag, node), loc }],
|
|
56
|
+
loc,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const storage = `%g.${helper}`;
|
|
60
|
+
const ready = `${storage}%ready`;
|
|
61
|
+
lowerer.globalsList.push({ id: storage, name: `${name} global value`, type: DYN, mutable: true }, { id: ready, name: "%ready", type: BOOL, mutable: true });
|
|
62
|
+
const length = hostGlobalLength(name);
|
|
63
|
+
const body = [
|
|
64
|
+
{
|
|
65
|
+
kind: "if",
|
|
66
|
+
cond: varRef(ready, BOOL, loc),
|
|
67
|
+
then: [{ kind: "return", value: varRef(storage, DYN, loc), loc }],
|
|
68
|
+
else_: null,
|
|
69
|
+
loc,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
kind: "assign",
|
|
73
|
+
localId: storage,
|
|
74
|
+
value: {
|
|
75
|
+
kind: "dynFrom",
|
|
76
|
+
value: {
|
|
77
|
+
kind: "closure",
|
|
78
|
+
fnName: fence,
|
|
79
|
+
captures: [],
|
|
80
|
+
type: { kind: "func", params: [], ret: DYN },
|
|
81
|
+
loc,
|
|
82
|
+
},
|
|
83
|
+
fnName: name,
|
|
84
|
+
...(length !== undefined ? { fnLength: length } : {}),
|
|
85
|
+
type: DYN,
|
|
86
|
+
loc,
|
|
87
|
+
},
|
|
88
|
+
loc,
|
|
89
|
+
},
|
|
90
|
+
// The constructor's own [[Prototype]]: a plain object, so the `instanceof`
|
|
91
|
+
// prototype walk over a FUNCTION value ends at null instead of throwing
|
|
92
|
+
// the runtime's unsupported-getPrototypeOf refusal (the walk starts at the
|
|
93
|
+
// value's [[Prototype]]). Nothing native code produces reaches it, so
|
|
94
|
+
// `x instanceof FormData` answers false for every value native code can
|
|
95
|
+
// produce, functions included.
|
|
96
|
+
{
|
|
97
|
+
kind: "exprStmt",
|
|
98
|
+
expr: {
|
|
99
|
+
kind: "libCall",
|
|
100
|
+
fn: "dyn.setPrototype",
|
|
101
|
+
args: [varRef(storage, DYN, loc), { kind: "dynObjLit", fields: [], type: DYN, loc }],
|
|
102
|
+
type: DYN,
|
|
103
|
+
loc,
|
|
104
|
+
},
|
|
105
|
+
loc,
|
|
106
|
+
},
|
|
107
|
+
{ kind: "assign", localId: ready, value: boolLit(true, loc), loc },
|
|
108
|
+
{ kind: "return", value: varRef(storage, DYN, loc), loc },
|
|
109
|
+
];
|
|
110
|
+
const locals = [];
|
|
111
|
+
lowerer.liftedFns.push({ name: helper, params: [], locals, returnType: DYN, body, loc });
|
|
112
|
+
lowerer.shareHelper(helper);
|
|
113
|
+
}
|
|
114
|
+
/** The thrown message, in the shape every deferred fence throws: the
|
|
115
|
+
* diagnostic's message at the site that first read the value. */
|
|
116
|
+
function fenceMessage(diag, node) {
|
|
117
|
+
const source = ts.getSourceFileOfNode(node);
|
|
118
|
+
const pos = ts.getLineAndCharacterOfPosition(source, diag.loc.start);
|
|
119
|
+
return `${diag.message} [${diag.code} at ${diag.loc.file}:${pos.line + 1}]`;
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=host-global-values.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-global-values.js","sourceRoot":"","sources":["../../../src/frontend/lowering/host-global-values.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;wEAqBwE;AACxE,OAAO,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,GAAG,EAA0C,MAAM,gBAAgB,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC;;;;mEAImE;AACnE,MAAM,UAAU,eAAe,CAAC,OAAgB,EAAE,IAAY,EAAE,IAAa;IAC3E,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;IACxB,MAAM,MAAM,GAAG,uBAAuB,IAAI,EAAE,CAAC;IAC7C,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,KAAK,MAAM,C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.js";
|
|
3
|
+
import type { Lowerer } from "./lowerer.js";
|
|
4
|
+
export declare const NODE_GLOBALS_WITHOUT_NATIVE: ReadonlySet<string>;
|
|
5
|
+
/** Node's `length` for the listed global `name`, or undefined when the table
|
|
6
|
+
* does not know it (the value is then built with the closure's own arity). */
|
|
7
|
+
export declare function hostGlobalLength(name: string): number | undefined;
|
|
8
|
+
/** Whether the read is the callee of a call or `new` — the one use a listed
|
|
9
|
+
* global's value refuses. A bare read answers the constructor (see
|
|
10
|
+
* host-global-values.ts); constructing or calling it can only produce an
|
|
11
|
+
* instance native code does not have, so the compile fence stays (and a
|
|
12
|
+
* JavaScript source defers it to the throw at that statement). */
|
|
13
|
+
export declare function hostGlobalCallTarget(node: ts.Expression): boolean;
|
|
14
|
+
/** Whether `id` reads one of those globals. Own bindings — imports, locals
|
|
15
|
+
* with an initializer, program classes and functions — keep their ordinary
|
|
16
|
+
* lowering; a declaration-file binding (the bundled lib, @types/node) or a
|
|
17
|
+
* program's ambient `declare var` is the global, and an unresolvable name
|
|
18
|
+
* (JavaScript) is Node's. */
|
|
19
|
+
export declare function hostGlobalNameOfIdentifier(lowerer: Lowerer, id: ts.Identifier): string | null;
|
|
20
|
+
/** Whether `receiver` is the global object: `globalThis`, a cast of it
|
|
21
|
+
* (`(globalThis as T)`), or a `const` initialized with either (`const g =
|
|
22
|
+
* globalThis as Record<string, unknown>`). The last shape is how most
|
|
23
|
+
* programs spell the global object, and the runtime's dynamic global object
|
|
24
|
+
* answers undefined for these names. A `let` is not followed: it can be
|
|
25
|
+
* reassigned to another object. */
|
|
26
|
+
export declare function isGlobalObjectRead(lowerer: Lowerer, receiver: ts.Expression, seen?: Set<ts.Symbol>, name?: string | null): boolean;
|
|
27
|
+
/** Whether `access` reads one of those globals off the global object —
|
|
28
|
+
* `globalThis.X`, `(globalThis as T).X`, `alias.X` (`const alias =
|
|
29
|
+
* globalThis`), through parentheses and type casts. */
|
|
30
|
+
export declare function hostGlobalNameOfMember(lowerer: Lowerer, access: ts.PropertyAccessExpression): string | null;
|
|
31
|
+
/** `globalThis["X"]` with a static string key: the same read as `globalThis.X`
|
|
32
|
+
* (the runtime's dynamic path cannot tell the name is Node's). */
|
|
33
|
+
export declare function hostGlobalNameOfElement(lowerer: Lowerer, access: ts.ElementAccessExpression): string | null;
|
|
34
|
+
/** The members a read of a listed global's value answers: the function
|
|
35
|
+
* intrinsics every constructor carries. Node also has the class's own
|
|
36
|
+
* static members (`WebSocket.OPEN`, `FormData.prototype.append`) and its
|
|
37
|
+
* instances' methods, which native code does not provide; reading one is a
|
|
38
|
+
* use of that surface and refuses (SC2020, host-global) rather than
|
|
39
|
+
* answering undefined. */
|
|
40
|
+
export declare const HOST_GLOBAL_VALUE_MEMBERS: ReadonlySet<string>;
|
|
41
|
+
/** The members the value's `prototype` object answers: `constructor`, the
|
|
42
|
+
* link back to the value, which is the same in Node. Node's prototype also
|
|
43
|
+
* carries the class's instance methods (`FormData.prototype.append`), which
|
|
44
|
+
* native code does not have; reading one refuses (SC2020, host-global). */
|
|
45
|
+
export declare const HOST_GLOBAL_PROTOTYPE_MEMBERS: ReadonlySet<string>;
|
|
46
|
+
/** The listed global whose `prototype` object `node` reads — a member read's
|
|
47
|
+
* receiver (`FormData.prototype.append`), a `const` holding that object
|
|
48
|
+
* (`const proto = FormData.prototype; proto.append`), or the
|
|
49
|
+
* `Object.setPrototypeOf` target shape. Null for every other expression. */
|
|
50
|
+
export declare function hostGlobalPrototypeOf(lowerer: Lowerer, node: ts.Expression): string | null;
|
|
51
|
+
/** The listed global whose constructor value `node` holds through the
|
|
52
|
+
* prototype object (`FormData.prototype.constructor`), which is the same
|
|
53
|
+
* value the read answers. Null for every other expression. */
|
|
54
|
+
export declare function hostGlobalConstructorOfPrototype(lowerer: Lowerer, node: ts.Expression): string | null;
|
|
55
|
+
/** The listed global whose prototype member a call reads —
|
|
56
|
+
* `FormData.prototype.append(...)`, `globalThis.WebSocket["send"](...)`.
|
|
57
|
+
* A call reaches lowering without the member-read hook seeing the callee,
|
|
58
|
+
* so the call site asks the same question. Null for `constructor` and for
|
|
59
|
+
* every other expression. */
|
|
60
|
+
export declare function hostGlobalPrototypeMemberOf(lowerer: Lowerer, callee: ts.Expression): string | null;
|
|
61
|
+
/** The listed global an operand reads, in any of the read forms — the
|
|
62
|
+
* expression itself (`typeof X`, a `new` callee, a call callee) — or the
|
|
63
|
+
* one a `const` holding the read answers (`const Ctor = WebSocket;
|
|
64
|
+
* Ctor.OPEN`). A `let` is not followed: it can be reassigned. */
|
|
65
|
+
export declare function hostGlobalNameOfRead(lowerer: Lowerer, operand: ts.Expression): string | null;
|
|
66
|
+
/** The listed global a `typeof` operand reads, in any of the read forms. */
|
|
67
|
+
export declare function hostGlobalNameOfTypeofOperand(lowerer: Lowerer, operand: ts.Expression): string | null;
|
|
68
|
+
/** The compiler's derived name table as the runtime's immortal
|
|
69
|
+
* `templateStrings` array (one per program): the runtime never carries a
|
|
70
|
+
* hand-copied list of host globals. */
|
|
71
|
+
export declare function hostAbsentNamesArg(loc: SrcLoc): IrExpr;
|
|
72
|
+
/** Arms the runtime check at a dynamic site (idempotent): the runtime's
|
|
73
|
+
* global-object read and `in` answers throw for exactly these names. */
|
|
74
|
+
export declare function hostAbsentInstall(loc: SrcLoc): IrExpr;
|