@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { lowerStaticPrivateAssignment } from "./private-statics.js";
|
|
2
|
-
import { keepsInitializerLayout, notePreservedLayout } from "./structural-instances.js";
|
|
2
|
+
import { keepsCheckedDynamicValue, keepsInitializerLayout, notePreservedLayout, } from "./structural-instances.js";
|
|
3
3
|
import { partialFieldRead } from "./partial-assertions.js";
|
|
4
4
|
import { jsGlobalValueByName } from "./global-values.js";
|
|
5
5
|
import { lowerTupleAliasDecl, stripTypeWrappers } from "./typed-arguments.js";
|
|
@@ -7,14 +7,15 @@ import { islandHandleBinding, lowerIslandExpr, isIslandRequireSpec, lowerIslandR
|
|
|
7
7
|
import { isIslandSubclassDecl } from "../../node-islands/boundary.js";
|
|
8
8
|
import { allBytesArms, indexedUnionArms, lowerIndexedUnionMember, lowerIndexedUnionNumberRead, lowerIndexedUnionRead, } from "./indexed-unions.js";
|
|
9
9
|
import { declaredMemberOf, fenceDatePrototypeWrite, isPromisePrototypeRead, lowerUnionKeyedRead, } from "./expressions/property-access.js";
|
|
10
|
-
import { hostedStorageView, hostsAll } from "./expressions/hosted-narrowing.js";
|
|
10
|
+
import { hostedStorageView, hostsAll, recordViewHosted } from "./expressions/hosted-narrowing.js";
|
|
11
|
+
import { assertionViewCopy, bindingIdentityUse, bindingWrite } from "./divergences.js";
|
|
11
12
|
import { requestGeneralStreamSurface } from "./general-streams.js";
|
|
12
13
|
import { lowerForAwaitDynStream, nodeStreamInterfaceSide } from "./dyn-streams.js";
|
|
13
14
|
import { lowerForAwaitValueStream } from "./builtins/hash-stream.js";
|
|
14
15
|
import { lowerChildPropertyWrite } from "./handle-properties.js";
|
|
15
16
|
import { matchAllRowsReadByElements, storedMatchAllRowsReadByElements, } from "./containers/match-row-uses.js";
|
|
16
17
|
import { dynUndefinedExpr, nodeThrowExpr, numLit, strLit, varRef } from "../../ir/build.js";
|
|
17
|
-
import { runtimeKeyPatternRead } from "./expressions/keyed-field-targets.js";
|
|
18
|
+
import { literalFieldKeys, runtimeKeyPatternRead } from "./expressions/keyed-field-targets.js";
|
|
18
19
|
import { declaresHoistedBinding, staticCondition } from "./static-typeof.js";
|
|
19
20
|
import { lowerCollectionSpread } from "./containers/collection-methods.js";
|
|
20
21
|
import { lowerEventObjectPropertyWrite } from "./lower-event-target.js";
|
|
@@ -39,17 +40,18 @@ import { requireInitFlagStmt } from "./require-initialization.js";
|
|
|
39
40
|
import { isJsonRequireDecl } from "./json-require.js";
|
|
40
41
|
import { isTimeValueDateDeclaration } from "./date-values.js";
|
|
41
42
|
import { bindingSource } from "../binding-source.js";
|
|
42
|
-
import { lowerConstructorReturn } from "./constructor-returns.js";
|
|
43
|
+
import { clearPendingPrimitiveReturn, lowerConstructorReturn } from "./constructor-returns.js";
|
|
43
44
|
import { statementGroupKey } from "./type-failure.js";
|
|
44
45
|
import { cjsExportValueByName, cjsNamespaceDestructureOf, cjsTableMethodEntry, inlineProgramRequireOf, requireNestedPatternsOf, splitRequireAssignmentOf, splitRequireBindingOf, splitRequireBindingOfIdent, splitRequireEarlyReadOf, wholeExportSymbolOfModule, } from "./cjs-inline-require.js";
|
|
45
46
|
import { cjsExportMemberWriteGlobalOf, isCjsExportsIdentifier, isCjsModuleExports, isFreshExportsReset, } from "./cjs-exports-object.js";
|
|
46
47
|
import { isDeadTscHelperDecl, tscInteropBindingOfDecl } from "./cjs-tsc-interop.js";
|
|
47
48
|
import { arrayValueRead, arrayValueStore, arrayValueType, unionArrayValueRead, lowerSafeIndexRead, } from "./array-values.js";
|
|
48
49
|
import { lowerForAwaitGenerator, lowerForOfGenerator, lowerYieldStarStatement, } from "./lower-generators.js";
|
|
49
|
-
import { classAsyncGeneratorIterator, lowerForAwaitBuiltin } from "./lower-async-iteration.js";
|
|
50
|
+
import { classAsyncGeneratorIterator, isNodeReadableIteratorSource, isWebReadableIteratorSource, lowerForAwaitBuiltin, } from "./lower-async-iteration.js";
|
|
50
51
|
import { BOOL, BYTES_U8, CAUGHT, DATE_T, DYN_HANDLE_KINDS, DYN, F64, SEARCH_PARAMS_T, STRING, UNDEFINED_T, VOID, arrayOf, isDynTypedRefType, isUnitType, shapeHasAccessorSlots, typeEquals, } from "../../ir/ir.js";
|
|
51
52
|
import { PoisonError, boundIdentifiersOf, dynFallbackType, neverTaintedJsType, staticImportNamespaceType, } from "./lowerer.js";
|
|
52
53
|
import { enforceLibBoundary, lowerSurplusCalls } from "./lib-boundary.js";
|
|
54
|
+
import { isBuiltinIdentityToken, isPrimitiveValueType, lowerPrimitiveBaseDelete, } from "./primitive-throws.js";
|
|
53
55
|
import { cjsExportAssignmentOf, cjsExportChainOf, cjsVoidInitPreambleReals, cjsExportDiscardReason, cjsExportTargetLiteral, isCjsJsFile, isEsModuleStamp, isJsSourceFile, locOf, requireEarlyReference, requireSpecOf, } from "../program.js";
|
|
54
56
|
import { isStrictCode } from "./strict-mode.js";
|
|
55
57
|
import { markSloppyRecordWrites } from "./frozen-records.js";
|
|
@@ -62,7 +64,7 @@ import { lowerForOfArrayIter, lowerForOfMap, lowerForOfSearchParams, lowerForOfS
|
|
|
62
64
|
import { lowerForOfHelperChain } from "./containers/iterator-helpers.js";
|
|
63
65
|
import { objectIterOverIndexShape } from "./containers/indexed-objects.js";
|
|
64
66
|
import { strCharsCall } from "./containers/array-construction.js";
|
|
65
|
-
import { bindingContextualGenericFnNodeOf, bindingGenericFnAliasInfoOf, bindingGenericFnInfoOf, bindingGenericFnNodeOf, genericBindingPresenceStore, genericBindingStoredValue, implicitLocalFnInfoOf, implicitLocalFnNodeOf, implicitMethodCallInfersReturn, genericLocalClassBinding, } from "./generic-functions.js";
|
|
67
|
+
import { bindingContextualGenericFnNodeOf, bindingGenericFnAliasInfoOf, bindingGenericFnInfoOf, bindingGenericFnNodeOf, genericAliasPresenceStore, genericBindingPresenceStore, genericBindingStoredValue, implicitLocalFnInfoOf, implicitLocalFnNodeOf, implicitMethodCallInfersReturn, genericLocalClassBinding, } from "./generic-functions.js";
|
|
66
68
|
import { bindingNeverReassigned, deadUnmappableBinding, fileWritesBinding, nullishExprUnitOf, nullishGenericBindingUnitOf, } from "./binding-analysis.js";
|
|
67
69
|
import { hasExplicitJsDocReturn } from "./function-returns.js";
|
|
68
70
|
import { recordKeysArrayCall } from "./lower-calls.js";
|
|
@@ -1726,6 +1728,39 @@ export function lowerStmt(lowerer, stmt) {
|
|
|
1726
1728
|
// observed empty returns even when JSDoc omits undefined. Any remaining
|
|
1727
1729
|
// incompatible boundary keeps the ordinary per-statement refusal.
|
|
1728
1730
|
let value = null;
|
|
1731
|
+
// A derived constructor that can record a pending TypeError on a
|
|
1732
|
+
// primitive return drops it when a return of its own completes: a
|
|
1733
|
+
// `finally` block's `return;`, `return undefined` or `return this`
|
|
1734
|
+
// replaces the earlier completion instead of leaving it pending. The
|
|
1735
|
+
// drop follows the operand, which may throw — an operand that throws
|
|
1736
|
+
// never completes the return, so a `finally` that catches it and then
|
|
1737
|
+
// finishes resumes the earlier primitive return (and its TypeError).
|
|
1738
|
+
const withClearedPending = (ret) => {
|
|
1739
|
+
const clear = clearPendingPrimitiveReturn(lowerer, stmt);
|
|
1740
|
+
if (clear.length === 0)
|
|
1741
|
+
return ret;
|
|
1742
|
+
const loc = locOf(stmt);
|
|
1743
|
+
const body = ret.kind === "block" ? ret.body : [ret];
|
|
1744
|
+
const last = body.at(-1);
|
|
1745
|
+
if (last?.kind !== "return")
|
|
1746
|
+
return { kind: "block", body: [...clear, ret], loc };
|
|
1747
|
+
const before = body.slice(0, -1);
|
|
1748
|
+
if (last.value === null)
|
|
1749
|
+
return { kind: "block", body: [...before, ...clear, last], loc };
|
|
1750
|
+
// A constructor returns void, so a valued operand only evaluates for
|
|
1751
|
+
// effect — ahead of the drop, since a `return this.fail()` inside a
|
|
1752
|
+
// `finally` that catches the throw never completes.
|
|
1753
|
+
return {
|
|
1754
|
+
kind: "block",
|
|
1755
|
+
body: [
|
|
1756
|
+
...before,
|
|
1757
|
+
{ kind: "exprStmt", expr: last.value, loc },
|
|
1758
|
+
...clear,
|
|
1759
|
+
{ kind: "return", value: null, loc },
|
|
1760
|
+
],
|
|
1761
|
+
loc,
|
|
1762
|
+
};
|
|
1763
|
+
};
|
|
1729
1764
|
if (stmt.expression) {
|
|
1730
1765
|
// A constructor's returned object replaces the constructed `this`.
|
|
1731
1766
|
if (lowerer.currentClass?.ctor) {
|
|
@@ -1733,7 +1768,7 @@ export function lowerStmt(lowerer, stmt) {
|
|
|
1733
1768
|
if (constructorReturn !== null)
|
|
1734
1769
|
return constructorReturn;
|
|
1735
1770
|
}
|
|
1736
|
-
return lowerer.lowerReturnStmt(stmt.expression, locOf(stmt));
|
|
1771
|
+
return withClearedPending(lowerer.lowerReturnStmt(stmt.expression, locOf(stmt)));
|
|
1737
1772
|
}
|
|
1738
1773
|
else if (lowerer.ctx.returnType.kind === "union") {
|
|
1739
1774
|
value = lowerer.wrappedUndefined(lowerer.ctx.returnType, locOf(stmt));
|
|
@@ -1749,8 +1784,8 @@ export function lowerStmt(lowerer, stmt) {
|
|
|
1749
1784
|
}
|
|
1750
1785
|
// An async generator's bare return has no operand to await.
|
|
1751
1786
|
if (lowerer.ctx.isAsync === true && lowerer.ctx.generator)
|
|
1752
|
-
return { kind: "return", value, awaited: true, loc: locOf(stmt) };
|
|
1753
|
-
return { kind: "return", value, loc: locOf(stmt) };
|
|
1787
|
+
return withClearedPending({ kind: "return", value, awaited: true, loc: locOf(stmt) });
|
|
1788
|
+
return withClearedPending({ kind: "return", value, loc: locOf(stmt) });
|
|
1754
1789
|
}
|
|
1755
1790
|
if (ts.isBreakStatement(stmt) || ts.isContinueStatement(stmt)) {
|
|
1756
1791
|
const kw = ts.isBreakStatement(stmt) ? "break" : "continue";
|
|
@@ -5003,17 +5038,20 @@ function evolvingArrayHolderType(lowerer, decl) {
|
|
|
5003
5038
|
return null;
|
|
5004
5039
|
return evolvingArrayHold(lowerer, decl.initializer) === null ? null : DYN;
|
|
5005
5040
|
}
|
|
5006
|
-
/** A single static type for an initializer-less
|
|
5007
|
-
* later plain writes all agree. An evolving
|
|
5008
|
-
* until control flow proves a write, so a scalar slot is sound
|
|
5009
|
-
* every ordinary use already has that concrete flow type
|
|
5010
|
-
*
|
|
5011
|
-
*
|
|
5012
|
-
*
|
|
5013
|
-
* the
|
|
5014
|
-
*
|
|
5015
|
-
*
|
|
5016
|
-
* (
|
|
5041
|
+
/** A single static type for an initializer-less `let` without an
|
|
5042
|
+
* annotation whose later plain writes all agree. An evolving local reads as
|
|
5043
|
+
* `undefined` until control flow proves a write, so a scalar slot is sound
|
|
5044
|
+
* only when every ordinary use already has that concrete flow type (or an
|
|
5045
|
+
* arm of it). A write of `null` or `undefined` joins the written type as an
|
|
5046
|
+
* optional arm (`let stat; try { stat = lstatSync(".") } catch { stat = null }`
|
|
5047
|
+
* holds `Stats | null`). A write's call counts when its signature is
|
|
5048
|
+
* declared in the standard library, whose return types are declared rather
|
|
5049
|
+
* than inferred from JavaScript. A closure capture can observe the local
|
|
5050
|
+
* before an outer assignment, and the checker leaves captured evolving lets
|
|
5051
|
+
* broad: a captured runtime handle (`let child; if (...) child = spawn(...)`)
|
|
5052
|
+
* takes the handle or `undefined`, which nested functions read as a
|
|
5053
|
+
* checked-dynamic value (closureDynLets), and other captured bindings stay
|
|
5054
|
+
* checked-dynamic. */
|
|
5017
5055
|
export function inferredEvolvingLetType(lowerer, decl) {
|
|
5018
5056
|
if (!ts.isIdentifier(decl.name))
|
|
5019
5057
|
return null;
|
|
@@ -5068,7 +5106,10 @@ export function inferredEvolvingLetType(lowerer, decl) {
|
|
|
5068
5106
|
}
|
|
5069
5107
|
return "skip";
|
|
5070
5108
|
}
|
|
5071
|
-
|
|
5109
|
+
// A compound assignment (`x += 1`) reads and rewrites the binding
|
|
5110
|
+
// through an operator this scan does not model; a comparison
|
|
5111
|
+
// (`x === null`) only reads it, and the read check below covers that.
|
|
5112
|
+
if (ts.isBinaryExpression(node) && ts.isAssignmentOperator(node.operatorToken.kind)) {
|
|
5072
5113
|
let left = node.left;
|
|
5073
5114
|
while (ts.isParenthesizedExpression(left))
|
|
5074
5115
|
left = left.expression;
|
|
@@ -5091,7 +5132,7 @@ export function inferredEvolvingLetType(lowerer, decl) {
|
|
|
5091
5132
|
return "stop";
|
|
5092
5133
|
}
|
|
5093
5134
|
const mapped = lowerer.mapTypeOf(lowerer.typeOf(node.right));
|
|
5094
|
-
if (!mapped || mapped.kind === "dyn" || mapped.kind === "void"
|
|
5135
|
+
if (!mapped || mapped.kind === "dyn" || mapped.kind === "void") {
|
|
5095
5136
|
invalid = true;
|
|
5096
5137
|
return "stop";
|
|
5097
5138
|
}
|
|
@@ -5114,20 +5155,49 @@ export function inferredEvolvingLetType(lowerer, decl) {
|
|
|
5114
5155
|
return undefined;
|
|
5115
5156
|
};
|
|
5116
5157
|
ts.walkPreorder(scope, visit);
|
|
5117
|
-
|
|
5118
|
-
|
|
5158
|
+
// A write of an already-unioned value contributes its arms, so a call
|
|
5159
|
+
// declared `Stats | null` reads the same as separate value and unit
|
|
5160
|
+
// writes.
|
|
5161
|
+
const armsOf = (t) => t.kind === "union" ? (lowerer.unions.get(t.unionId)?.arms ?? [t]) : [t];
|
|
5162
|
+
const valueArms = [];
|
|
5163
|
+
const unitArms = [];
|
|
5164
|
+
for (const write of writes) {
|
|
5165
|
+
for (const arm of armsOf(write)) {
|
|
5166
|
+
const seen = isUnitType(arm) ? unitArms : valueArms;
|
|
5167
|
+
if (!seen.some((other) => typeEquals(other, arm)))
|
|
5168
|
+
seen.push(arm);
|
|
5169
|
+
}
|
|
5170
|
+
}
|
|
5171
|
+
const value = valueArms[0];
|
|
5172
|
+
if (invalid || value === undefined || valueArms.length > 1)
|
|
5119
5173
|
return null;
|
|
5174
|
+
const arms = [value];
|
|
5175
|
+
if (unitArms.length > 0) {
|
|
5176
|
+
// An evolving local reads as `undefined` before control flow proves a
|
|
5177
|
+
// write, so the optional storage carries that arm as well.
|
|
5178
|
+
arms.push(UNDEFINED_T);
|
|
5179
|
+
for (const unit of unitArms) {
|
|
5180
|
+
if (unit.kind !== "undefinedT")
|
|
5181
|
+
arms.push(unit);
|
|
5182
|
+
}
|
|
5183
|
+
}
|
|
5184
|
+
const storage = arms.length === 1 ? value : { kind: "union", unionId: lowerer.unions.intern(arms) };
|
|
5185
|
+
// A narrowed read sees an arm, or a sub-union of arms, of the storage.
|
|
5120
5186
|
if (!reads.every((read) => {
|
|
5121
5187
|
const mapped = lowerer.mapTypeOf(lowerer.typeOf(read));
|
|
5122
|
-
return mapped !== null && typeEquals(
|
|
5188
|
+
return (mapped !== null && armsOf(mapped).every((arm) => arms.some((own) => typeEquals(own, arm))));
|
|
5123
5189
|
}))
|
|
5124
5190
|
return null;
|
|
5125
5191
|
if (!captured)
|
|
5126
|
-
return
|
|
5127
|
-
if (!DYN_HANDLE_KINDS.has(
|
|
5192
|
+
return storage;
|
|
5193
|
+
if (!DYN_HANDLE_KINDS.has(value.kind))
|
|
5128
5194
|
return null;
|
|
5129
5195
|
lowerer.closureDynLets.add(symbol);
|
|
5130
|
-
|
|
5196
|
+
// A nested function can read the binding before the outer assignment:
|
|
5197
|
+
// the optional arm is what the checked-dynamic read of the closure sees.
|
|
5198
|
+
return storage.kind === "union"
|
|
5199
|
+
? storage
|
|
5200
|
+
: { kind: "union", unionId: lowerer.unions.intern([value, UNDEFINED_T]) };
|
|
5131
5201
|
}
|
|
5132
5202
|
/** Whether a call's resolved signature is declared in the standard library
|
|
5133
5203
|
* (`spawn(...)`), so its declared return type is the value's type. Calls of
|
|
@@ -5313,11 +5383,11 @@ export function lowerVarDecl(lowerer, decl, isLet) {
|
|
|
5313
5383
|
}
|
|
5314
5384
|
// `const h = id` — an ALIAS of a generic function: the alias's symbol
|
|
5315
5385
|
// registers the target's info (calls and pinned values resolve like
|
|
5316
|
-
// the target's own name)
|
|
5317
|
-
// statement emits nothing
|
|
5318
|
-
//
|
|
5386
|
+
// the target's own name) and the binding has no runtime value, so the
|
|
5387
|
+
// statement emits nothing but the flag of a module-scope alias whose
|
|
5388
|
+
// reads can run before it (genericAliasPresenceStore).
|
|
5319
5389
|
if (bindingGenericFnAliasInfoOf(lowerer, decl))
|
|
5320
|
-
return
|
|
5390
|
+
return genericAliasPresenceStore(lowerer, decl);
|
|
5321
5391
|
// `const stored = overloadedDeclaration`: no runtime slot is needed;
|
|
5322
5392
|
// calls project onto the declaration's implementation ABI and value
|
|
5323
5393
|
// reads reuse its interned closure identity.
|
|
@@ -5439,6 +5509,12 @@ export function lowerVarDecl(lowerer, decl, isLet) {
|
|
|
5439
5509
|
raw.type.kind === "dyn" &&
|
|
5440
5510
|
(g.type.kind === "record" ||
|
|
5441
5511
|
g.type.kind === "object" ||
|
|
5512
|
+
// `const p = Promise.all.call(C, xs)` in JavaScript: the call runs
|
|
5513
|
+
// the specification's algorithm with `C`'s capability and returns
|
|
5514
|
+
// whatever `C` constructed, a foreign instance the checker still
|
|
5515
|
+
// calls `Promise<T>`. The binding holds that value as dyn; a
|
|
5516
|
+
// native-promise check would reject it (t262-db B3).
|
|
5517
|
+
(g.type.kind === "promise" && isJsPromiseStaticCall(raw)) ||
|
|
5442
5518
|
(ts.isIdentifier(decl.name) &&
|
|
5443
5519
|
jsBindingKeepsCheckedObject(lowerer, decl.name, g.type) &&
|
|
5444
5520
|
(existingValueForm(decl.initializer) || jsHoldsDynObject(lowerer, decl.initializer)))))
|
|
@@ -5452,6 +5528,18 @@ export function lowerVarDecl(lowerer, decl, isLet) {
|
|
|
5452
5528
|
g.type = raw.type;
|
|
5453
5529
|
notePreservedLayout(lowerer, decl);
|
|
5454
5530
|
}
|
|
5531
|
+
// The same for a module const initialized by an assertion: the value's
|
|
5532
|
+
// storage already answers the asserted view (narrowing.ts), so the
|
|
5533
|
+
// module holds that layout and writes through it reach the object.
|
|
5534
|
+
if (!isVarDeclared(decl) &&
|
|
5535
|
+
(ts.getCombinedNodeFlags(decl) & ts.NodeFlags.Const) !== 0 &&
|
|
5536
|
+
assertionKeepsStorageLayout(lowerer, decl, raw.type, g.type)) {
|
|
5537
|
+
g.type = raw.type;
|
|
5538
|
+
notePreservedLayout(lowerer, decl);
|
|
5539
|
+
}
|
|
5540
|
+
if (!isVarDeclared(decl) &&
|
|
5541
|
+
keepsCheckedDynamicValue(lowerer, decl.initializer, raw.type, g.type))
|
|
5542
|
+
g.type = raw.type;
|
|
5455
5543
|
const arithmetic = raw.type.kind === "union" ? lowerer.unions.get(raw.type.unionId)?.arms : undefined;
|
|
5456
5544
|
if (arithmetic?.length === 2 &&
|
|
5457
5545
|
arithmetic.every((a) => a.kind === "f64" || a.kind === "string" || a.kind === "bool") &&
|
|
@@ -5464,6 +5552,7 @@ export function lowerVarDecl(lowerer, decl, isLet) {
|
|
|
5464
5552
|
lowerer.runtimeOptionalArithmeticGlobals.add(g);
|
|
5465
5553
|
}
|
|
5466
5554
|
const init = lowerer.coerceInto(decl.initializer, raw, g.type);
|
|
5555
|
+
refuseAssertionViewWrite(lowerer, decl);
|
|
5467
5556
|
return {
|
|
5468
5557
|
kind: "assign",
|
|
5469
5558
|
localId: g.id,
|
|
@@ -5505,12 +5594,13 @@ export function lowerVarDecl(lowerer, decl, isLet) {
|
|
|
5505
5594
|
// `let x: number;` — declared, uninitialized. tsc guarantees no read
|
|
5506
5595
|
// before assignment (TS2454) and rejects uninitialized const (TS1155).
|
|
5507
5596
|
// Unannotated `let x;` is an evolving `any` — the checked-dynamic
|
|
5508
|
-
// binding fallback (irTypeOf → dynFallbackType)
|
|
5597
|
+
// binding fallback (irTypeOf → dynFallbackType) unless its writes agree
|
|
5598
|
+
// on a type.
|
|
5509
5599
|
// Undefined-armed unions (`let x: string | undefined;`) are readable
|
|
5510
5600
|
// immediately (the type covers the unassigned state), so they
|
|
5511
5601
|
// initialize to the interned undefined arm like an omitted optional.
|
|
5512
5602
|
let type = lowerer.irTypeOf(decl.name);
|
|
5513
|
-
if (type.kind === "dyn" && isLet &&
|
|
5603
|
+
if (type.kind === "dyn" && isLet && decl.type === undefined) {
|
|
5514
5604
|
type = inferredEvolvingLetType(lowerer, decl) ?? type;
|
|
5515
5605
|
}
|
|
5516
5606
|
// `var v: void;` / `let x: undefined;` — a unit-only binding rides
|
|
@@ -5621,6 +5711,12 @@ export function lowerVarDecl(lowerer, decl, isLet) {
|
|
|
5621
5711
|
type = init.type;
|
|
5622
5712
|
notePreservedLayout(lowerer, decl);
|
|
5623
5713
|
}
|
|
5714
|
+
// An index-signature binding whose assertion of an existing value lowered
|
|
5715
|
+
// to that value (narrowing.ts keeps it instead of answering a copy whose
|
|
5716
|
+
// keys live in a map of its own) keeps the value too: converting it here
|
|
5717
|
+
// would take every write through the binding with it.
|
|
5718
|
+
if (keepsCheckedDynamicValue(lowerer, decl.initializer, init.type, type))
|
|
5719
|
+
type = init.type;
|
|
5624
5720
|
// A JavaScript binding assigned values outside its declared type
|
|
5625
5721
|
// (analyzeJsWidenedBindings in lowerer.ts) holds them as checked-dynamic.
|
|
5626
5722
|
{
|
|
@@ -5678,9 +5774,18 @@ export function lowerVarDecl(lowerer, decl, isLet) {
|
|
|
5678
5774
|
const keepsAssertedObject = init.type.kind === "dyn" &&
|
|
5679
5775
|
!decl.type &&
|
|
5680
5776
|
keptIdentityAssertion(lowerer, decl.initializer) !== undefined;
|
|
5777
|
+
// `const p = Promise.all.call(C, xs)` in JavaScript: the checked-dynamic
|
|
5778
|
+
// promise-static call returns whatever `C` constructed — a foreign
|
|
5779
|
+
// instance, not the `Promise<T>` the checker infers from the signature —
|
|
5780
|
+
// so the binding holds it as dyn (t262-db B3).
|
|
5781
|
+
const keepsPromiseStaticValue = isJsSourceFile(ts.getSourceFileOfNode(decl)) &&
|
|
5782
|
+
!decl.type &&
|
|
5783
|
+
!hasJsTypeAnnotation(decl) &&
|
|
5784
|
+
isJsPromiseStaticCall(init);
|
|
5681
5785
|
if (expandsObject ||
|
|
5682
5786
|
preservesObjectIdentity ||
|
|
5683
5787
|
keepsAssertedObject ||
|
|
5788
|
+
keepsPromiseStaticValue ||
|
|
5684
5789
|
(isJsSourceFile(ts.getSourceFileOfNode(decl)) &&
|
|
5685
5790
|
!decl.type &&
|
|
5686
5791
|
isNativeBuiltinValueInitializer(lowerer, decl.initializer))) {
|
|
@@ -5977,13 +6082,9 @@ export function lowerVarDecl(lowerer, decl, isLet) {
|
|
|
5977
6082
|
// the stored type hosts (`const view: Route & { order: number } = ...`)
|
|
5978
6083
|
// keeps it too: coercing into the annotated layout would copy the
|
|
5979
6084
|
// value and read members the writes have not created yet.
|
|
5980
|
-
if (!isLet &&
|
|
5981
|
-
decl.initializer &&
|
|
5982
|
-
isAssertionInitializer(decl.initializer) &&
|
|
5983
|
-
(settledType.kind === "union" || settledType.kind === "record") &&
|
|
5984
|
-
(init.type.kind === "union" || init.type.kind === "record") &&
|
|
5985
|
-
hostsAll(lowerer, init.type, settledType)) {
|
|
6085
|
+
if (!isLet && assertionKeepsStorageLayout(lowerer, decl, init.type, settledType)) {
|
|
5986
6086
|
settledType = init.type;
|
|
6087
|
+
notePreservedLayout(lowerer, decl);
|
|
5987
6088
|
}
|
|
5988
6089
|
// An exact class behind a generic interface keeps its native
|
|
5989
6090
|
// representation so generic calls can specialize against its body.
|
|
@@ -6012,6 +6113,7 @@ export function lowerVarDecl(lowerer, decl, isLet) {
|
|
|
6012
6113
|
// Slot coercion: `const r: A | B = bValue;` wraps implicitly; width
|
|
6013
6114
|
// subtyping (`const p: {a: number} = wider;`) is rejected, not coerced.
|
|
6014
6115
|
init = lowerer.coerceInto(decl.initializer, init, settledType);
|
|
6116
|
+
refuseAssertionViewWrite(lowerer, decl);
|
|
6015
6117
|
const local = lowerer.declareLocal(decl.name, decl.name.text, settledType, isLet);
|
|
6016
6118
|
if (runtimeStringArithmetic && init.type.kind === "union") {
|
|
6017
6119
|
lowerer.runtimeOptionalArithmeticLocals.add(lowerer.runtimeOptionalRootOf(local));
|
|
@@ -6061,6 +6163,17 @@ function inferredOptionalRecordType(lowerer, decl, declared, actual) {
|
|
|
6061
6163
|
return declared;
|
|
6062
6164
|
return actual;
|
|
6063
6165
|
}
|
|
6166
|
+
/** Whether a lowered initializer is the checked-dynamic `Promise.<static>.call(C, …)`
|
|
6167
|
+
* call (lower-calls.ts, JavaScript sources only). Its result is whatever `C`
|
|
6168
|
+
* constructed, so a binding the checker typed `Promise<T>` holds it as dyn. */
|
|
6169
|
+
function isJsPromiseStaticCall(value) {
|
|
6170
|
+
// Surplus arguments evaluate as statements before the call, so the
|
|
6171
|
+
// initializer is a sequence expression whose result is the call.
|
|
6172
|
+
let result = value;
|
|
6173
|
+
while (result.kind === "seqExpr")
|
|
6174
|
+
result = result.result;
|
|
6175
|
+
return result.kind === "libCall" && result.fn === "promise.genericStatic";
|
|
6176
|
+
}
|
|
6064
6177
|
function lowerVariableInitializer(lowerer, node, expected) {
|
|
6065
6178
|
let value = node;
|
|
6066
6179
|
while (ts.isParenthesizedExpression(value) ||
|
|
@@ -6802,13 +6915,35 @@ function declaresCheckedDynField(lowerer, type, name) {
|
|
|
6802
6915
|
const arms = lowerer.unions.get(type.unionId)?.arms ?? [];
|
|
6803
6916
|
return arms.length > 0 && arms.every((arm) => declaresCheckedDynField(lowerer, arm, name));
|
|
6804
6917
|
}
|
|
6918
|
+
/** The constant property key of a `delete` target: the name of a dot
|
|
6919
|
+
* access, or the one key of a bracket access spelled as a literal or
|
|
6920
|
+
* proved by a literal-typed binding (`const key = "a"`). A key of several
|
|
6921
|
+
* literals folds to nothing — deleting it would need per-key dispatch, so
|
|
6922
|
+
* the record branch refuses and names the keys. Consistent with keyed
|
|
6923
|
+
* record reads/writes (literalFieldKeys), the key expression is not
|
|
6924
|
+
* evaluated: only a literal or an identifier folds, and an identifier
|
|
6925
|
+
* read is pure. */
|
|
6926
|
+
function constantDeleteKey(lowerer, target) {
|
|
6927
|
+
if (ts.isPropertyAccessExpression(target))
|
|
6928
|
+
return target.name.text;
|
|
6929
|
+
if (!ts.isElementAccessExpression(target))
|
|
6930
|
+
return null;
|
|
6931
|
+
const keyNode = target.argumentExpression;
|
|
6932
|
+
if (ts.isStringLiteralLike(keyNode))
|
|
6933
|
+
return keyNode.text;
|
|
6934
|
+
if (!ts.isIdentifier(keyNode))
|
|
6935
|
+
return null;
|
|
6936
|
+
const keys = literalFieldKeys(lowerer, keyNode);
|
|
6937
|
+
return keys?.length === 1 ? keys[0] : null;
|
|
6938
|
+
}
|
|
6805
6939
|
/** Statement-position `delete`: process.env keys → process.envUnset
|
|
6806
6940
|
* (unsetenv), pure `Record<string, T>` keys → recordKeyDelete (the
|
|
6807
6941
|
* overflow Map delete), declared OPTIONAL fields → the field's ABSENT
|
|
6808
6942
|
* state (the slot reads undefined and no longer counts as an own
|
|
6809
6943
|
* property). Everything else
|
|
6810
|
-
* fences with the honest reason — a required field is a struct slot
|
|
6811
|
-
*
|
|
6944
|
+
* fences with the honest reason — a required record field is a struct slot
|
|
6945
|
+
* with no ABSENT state, a class field is part of the instance's fixed
|
|
6946
|
+
* layout, and an optional `unknown`/`any` field maps to the
|
|
6812
6947
|
* checked-dynamic slot, which has no ABSENT state yet. */
|
|
6813
6948
|
function lowerDeleteStatement(lowerer, expr) {
|
|
6814
6949
|
const loc = locOf(expr);
|
|
@@ -6879,6 +7014,18 @@ function lowerDeleteStatement(lowerer, expr) {
|
|
|
6879
7014
|
return unionDelete;
|
|
6880
7015
|
}
|
|
6881
7016
|
let obj = lowerer.lowerExpr(target.expression);
|
|
7017
|
+
// A PRIMITIVE receiver: `delete` runs ToObject on the base AFTER the key,
|
|
7018
|
+
// and the base's type decides the answer — null and undefined throw
|
|
7019
|
+
// Node's TypeError, `?.` on a nullish base short-circuits to `true`
|
|
7020
|
+
// without evaluating the key, and every other primitive deletes from its
|
|
7021
|
+
// ToObject wrapper (a String's indexes and `length` refuse the delete).
|
|
7022
|
+
if (isPrimitiveValueType(obj.type) && !isBuiltinIdentityToken(lowerer, target.expression, obj)) {
|
|
7023
|
+
return {
|
|
7024
|
+
kind: "exprStmt",
|
|
7025
|
+
expr: lowerPrimitiveBaseDelete(lowerer, expr, target, obj, VOID),
|
|
7026
|
+
loc,
|
|
7027
|
+
};
|
|
7028
|
+
}
|
|
6882
7029
|
// `delete this.stack` in an Error subclass that declares a `stack`
|
|
6883
7030
|
// accessor (quickjs-wasi's JSException): V8 gives each error an own
|
|
6884
7031
|
// `stack` that shadows the accessor, and the delete removes it so reads
|
|
@@ -6954,13 +7101,12 @@ function lowerDeleteStatement(lowerer, expr) {
|
|
|
6954
7101
|
loc,
|
|
6955
7102
|
};
|
|
6956
7103
|
}
|
|
6957
|
-
// The constant property key of the target
|
|
6958
|
-
// bracket
|
|
6959
|
-
const
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
: null;
|
|
7104
|
+
// The constant property key of the target: dot access, a literal
|
|
7105
|
+
// bracket, or an element access whose key is a literal-typed binding
|
|
7106
|
+
// (`const key = "a"; delete r[key]`) — the same stance a keyed record
|
|
7107
|
+
// read/write takes (literalFieldKeys): identifier evaluation is pure, so
|
|
7108
|
+
// skipping it matches JavaScript.
|
|
7109
|
+
const constantKey = constantDeleteKey(lowerer, target);
|
|
6964
7110
|
// An OPTIONAL `unknown`/`any` field rides the checked-dynamic slot,
|
|
6965
7111
|
// which has no ABSENT state yet (an omitted such field already reads as
|
|
6966
7112
|
// present), so it cannot delete. Name that reason instead of calling
|
|
@@ -7002,12 +7148,29 @@ function lowerDeleteStatement(lowerer, expr) {
|
|
|
7002
7148
|
if (optionalCheckedDynDelete) {
|
|
7003
7149
|
lowerer.unsupported("SC1090", expr, OPTIONAL_CHECKED_DYN_DELETE);
|
|
7004
7150
|
}
|
|
7005
|
-
|
|
7151
|
+
// A key of SEVERAL literals names no single slot: say that instead of
|
|
7152
|
+
// blaming a field the caller never named.
|
|
7153
|
+
const keyNames = constantKey === null && ts.isElementAccessExpression(target)
|
|
7154
|
+
? literalFieldKeys(lowerer, target.argumentExpression)
|
|
7155
|
+
: null;
|
|
7156
|
+
if (keyNames !== null && keyNames.length > 1) {
|
|
7157
|
+
lowerer.unsupported("SC1090", expr, `'delete' through keys of ${keyNames.length} literals (${keyNames.map((k) => `'${k}'`).join(", ")}; delete one constant key at a time, or switch over the key)`);
|
|
7158
|
+
}
|
|
7159
|
+
lowerer.unsupported("SC1090", expr, "'delete' of required record fields (the shape's slot cannot be removed — only an optional field (`f?: T`) has an absent state, which Object.keys, 'in', and JSON.stringify follow; make the field optional if the program must remove it)");
|
|
7006
7160
|
}
|
|
7007
7161
|
if (optionalCheckedDynDelete) {
|
|
7008
7162
|
lowerer.unsupported("SC1090", expr, OPTIONAL_CHECKED_DYN_DELETE);
|
|
7009
7163
|
}
|
|
7010
|
-
|
|
7164
|
+
// A class field lives in the instance's fixed layout: there is no
|
|
7165
|
+
// per-field presence state for a delete to write, so Object.keys,
|
|
7166
|
+
// `in`, and JSON.stringify would keep reporting the field where Node
|
|
7167
|
+
// drops it. Name that reason instead of the generic receiver fence.
|
|
7168
|
+
if (obj.type.kind === "object" &&
|
|
7169
|
+
constantKey !== null &&
|
|
7170
|
+
lowerer.classes.get(obj.type.className)?.fields.has(constantKey)) {
|
|
7171
|
+
lowerer.unsupported("SC1090", expr, "'delete' of class fields (an instance's fields are its fixed layout — there is no per-field presence state, so Object.keys, 'in', and JSON.stringify would still report a deleted field; only optional record fields (`f?: T`) and Record<string, T> keys delete)");
|
|
7172
|
+
}
|
|
7173
|
+
lowerer.unsupported("SC1090", expr, `'delete' on '${lowerer.fmt(obj.type)}' receivers (process.env keys, pure Record<string, T> keys, and optional record fields delete)`);
|
|
7011
7174
|
}
|
|
7012
7175
|
/** True when the `var`/`let` binding `nameNode` names cannot change after
|
|
7013
7176
|
* the top-level CommonJS export statement `exportNode` that exports it by
|
|
@@ -9667,7 +9830,12 @@ export function lowerForOf(lowerer, stmt) {
|
|
|
9667
9830
|
}
|
|
9668
9831
|
const awaitArray = !!stmt.awaitModifier && lowerer.mapTypeOf(lowerer.typeOf(stmt.expression))?.kind === "array";
|
|
9669
9832
|
if (stmt.awaitModifier && !awaitArray) {
|
|
9670
|
-
|
|
9833
|
+
// A web ReadableStream's and a Node readable's iterator views both type
|
|
9834
|
+
// as AsyncIterableIterator, which lowers like the async protocols — but
|
|
9835
|
+
// the loop consumes each view through its own lowering
|
|
9836
|
+
// (lowerForAwaitBuiltin below).
|
|
9837
|
+
if (!isWebReadableIteratorSource(lowerer, stmt.expression) &&
|
|
9838
|
+
!isNodeReadableIteratorSource(lowerer, stmt.expression)) {
|
|
9671
9839
|
const genT = lowerer.stageSourceType(stmt.expression) ??
|
|
9672
9840
|
lowerer.mapTypeOf(lowerer.typeOf(stmt.expression));
|
|
9673
9841
|
if (genT?.kind === "generator" && genT.async) {
|
|
@@ -12322,4 +12490,54 @@ function isAssertionInitializer(node) {
|
|
|
12322
12490
|
e = e.expression;
|
|
12323
12491
|
return ts.isAsExpression(e) || ts.isTypeAssertion(e);
|
|
12324
12492
|
}
|
|
12493
|
+
/** `const view = route as Route & { order: number }`: the asserted type
|
|
12494
|
+
* refines the record arms the value is stored in (hosted-narrowing.ts), and
|
|
12495
|
+
* a projection (`{ text: string }` over `TextBlock`) only names members the
|
|
12496
|
+
* stored record already holds. Either way Node erases the assertion and
|
|
12497
|
+
* keeps the object, so the binding keeps the value's layout and its writes
|
|
12498
|
+
* reach that object instead of a copy. */
|
|
12499
|
+
function assertionKeepsStorageLayout(lowerer, decl, init, settled) {
|
|
12500
|
+
if (decl.initializer === undefined || !isAssertionInitializer(decl.initializer))
|
|
12501
|
+
return false;
|
|
12502
|
+
if (settled.kind !== "union" && settled.kind !== "record")
|
|
12503
|
+
return false;
|
|
12504
|
+
if (init.kind !== "union" && init.kind !== "record")
|
|
12505
|
+
return false;
|
|
12506
|
+
if (hostsAll(lowerer, init, settled))
|
|
12507
|
+
return true;
|
|
12508
|
+
// A projection (`{ text: string }` over `TextBlock`) keeps the stored
|
|
12509
|
+
// record only when the binding's identity is observable through it
|
|
12510
|
+
// (a write, an identity comparison). A read-only view is equal either
|
|
12511
|
+
// way, keeps the copy narrowing.ts made, and stays reported.
|
|
12512
|
+
if (!bindingIdentityUse(decl, lowerer.checker))
|
|
12513
|
+
return false;
|
|
12514
|
+
return (init.kind === "record" &&
|
|
12515
|
+
settled.kind === "record" &&
|
|
12516
|
+
recordViewHosted(lowerer, init.shapeId, settled.shapeId));
|
|
12517
|
+
}
|
|
12518
|
+
/** `const v = x as { a: number; extra?: string }; v.extra = "x"`: the
|
|
12519
|
+
* assertion's view names a member the value's own layout does not, so the
|
|
12520
|
+
* binding receives a COPY of `x` and the write lands on that copy — Node
|
|
12521
|
+
* erases the assertion and adds the property to `x` itself, so the write
|
|
12522
|
+
* must reach a caller-visible object. Reads of a copy are equal either
|
|
12523
|
+
* way, and so is a nested write through a member the copy shares (the same
|
|
12524
|
+
* child object in both), so only a write to the copy's own field is
|
|
12525
|
+
* refused, by name. Where the layouts agree the binding keeps the value's
|
|
12526
|
+
* storage instead (assertionKeepsStorageLayout), narrowing.ts and
|
|
12527
|
+
* lowerVarDecl record that in layoutKeptNodes, and nothing here fires.
|
|
12528
|
+
* Runs for file-scope and local bindings alike, after the declaration has
|
|
12529
|
+
* been lowered (so the keep is known). */
|
|
12530
|
+
function refuseAssertionViewWrite(lowerer, decl) {
|
|
12531
|
+
if (decl.initializer === undefined || !isAssertionInitializer(decl.initializer))
|
|
12532
|
+
return;
|
|
12533
|
+
if (lowerer.layoutKeptNodes.has(decl.initializer))
|
|
12534
|
+
return;
|
|
12535
|
+
const copy = assertionViewCopy(lowerer, decl.initializer);
|
|
12536
|
+
if (copy === null)
|
|
12537
|
+
return;
|
|
12538
|
+
const write = bindingWrite(lowerer, decl);
|
|
12539
|
+
if (write === null)
|
|
12540
|
+
return;
|
|
12541
|
+
lowerer.unsupported("SC1090", decl, `writing '${write.text}' through '${decl.name.getText()}', a copy of the '${copy.source}' value the assertion views as '${copy.target}' (the write would land on the copy; write through the original binding, or declare the member on the value's type)`);
|
|
12542
|
+
}
|
|
12325
12543
|
//# sourceMappingURL=lower-stmts.js.map
|