@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,3 +1,4 @@
|
|
|
1
|
+
import * as ts from "./ts7/adapter.js";
|
|
1
2
|
/** Compiler options adopted from the project during preflight. */
|
|
2
3
|
export const ADOPTED_OPTIONS = [
|
|
3
4
|
"strict",
|
|
@@ -35,197 +36,981 @@ export const ADOPTED_OPTIONS = [
|
|
|
35
36
|
"jsxImportSource",
|
|
36
37
|
"reactNamespace",
|
|
37
38
|
];
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
const CHECKER = (why, corpus) => ({
|
|
40
|
+
view: "checker",
|
|
41
|
+
why,
|
|
42
|
+
corpus: corpus ?? [],
|
|
43
|
+
});
|
|
44
|
+
/** `widen`: the diagnostic names a binding or member whose storage and reads
|
|
45
|
+
* become checked-dynamic (jsWidenedBindings / runtimeOptionalBindingTypes). */
|
|
46
|
+
const WIDEN = (why, corpus) => ({
|
|
47
|
+
view: "widen",
|
|
48
|
+
why,
|
|
49
|
+
corpus: corpus ?? [],
|
|
50
|
+
});
|
|
51
|
+
/** `throw`: the site lowers to Node's exception. */
|
|
52
|
+
const THROW = (why, corpus) => ({
|
|
53
|
+
view: "throw",
|
|
54
|
+
why,
|
|
55
|
+
corpus: corpus ?? [],
|
|
56
|
+
});
|
|
57
|
+
/** The row applies only where its guard holds; the code's TRIAGE_ROWS row
|
|
58
|
+
* stays for every other site. */
|
|
59
|
+
const at = (site, row) => ({ ...row, site });
|
|
60
|
+
/** A checked JavaScript file keeps this diagnostic. */
|
|
61
|
+
const inCheckedJs = (row) => ({ ...row, checkedJs: "enforce" });
|
|
62
|
+
/* ---- the site guards ---- */
|
|
63
|
+
/** TS7032 on a PRIVATE setter stays reported: the private-element lowering
|
|
64
|
+
* does not implement the shadowing and brand-check rules those programs
|
|
65
|
+
* exercise, so the program keeps refusing until that lowering exists. */
|
|
66
|
+
const notPrivateName = (node, d) => !ts.isPrivateIdentifier(node) && !ts.getSourceFileOfNode(node).text.startsWith("#", d.pos ?? -1);
|
|
67
|
+
/** TS2362/2363/2365 fire on an operator whose other operand is bigint-ish;
|
|
68
|
+
* plain JavaScript admits the `any` operand, and a primitive wrapper operand
|
|
69
|
+
* (`new Number(1) * 2`) converts with ToPrimitive like any object. */
|
|
70
|
+
const anyOrWrapperOperand = (_node, d) => {
|
|
71
|
+
const text = ts.flattenDiagnosticMessageText(d, "\n");
|
|
72
|
+
return text.includes("'any'") || /'(Number|String|Boolean)'/.test(text);
|
|
73
|
+
};
|
|
74
|
+
/** An index write on a String wrapper (`new String("ab")[5] = "q"`): Node
|
|
75
|
+
* adds the property past the end and ignores writes to the read-only index
|
|
76
|
+
* properties (sloppy) or throws (strict), as the object does. A write
|
|
77
|
+
* through any other readonly index signature keeps tsc's refusal. */
|
|
78
|
+
const stringWrapperReceiver = (_node, d) => ts.flattenDiagnosticMessageText(d, "\n").includes("type 'String'");
|
|
79
|
+
/** The deprecated `Buffer(...)` call without `new`, which Node's Buffer
|
|
80
|
+
* function accepts (containers/bytes.ts lowers it), `fs.ReadStream(...)` /
|
|
81
|
+
* `fs.WriteStream(...)`, which construct their stream
|
|
82
|
+
* (builtins/fs-streams.ts), and `Iterator()` (2348), which throws Node's
|
|
83
|
+
* TypeError at the call (iterator-prototype.ts). Every other class called
|
|
84
|
+
* without `new` keeps the triage's SC1090. */
|
|
85
|
+
const deprecatedBufferCall = (_node, d) => {
|
|
86
|
+
const text = ts.flattenDiagnosticMessageText(d, "\n");
|
|
87
|
+
return (text.includes("'BufferConstructor'") ||
|
|
88
|
+
text.includes("'typeof ReadStream'") ||
|
|
89
|
+
text.includes("'typeof WriteStream'") ||
|
|
90
|
+
text.includes("'IteratorConstructor'"));
|
|
91
|
+
};
|
|
92
|
+
/* ---- family reasons ---- */
|
|
93
|
+
const IMPLICIT_ANY = "a JavaScript value with no annotation is whatever the caller passes: Node has no types to check, and the lowering maps the value dynamically";
|
|
94
|
+
const NULLISH_DEMAND = "strict-null's demand is an inference, not a rule: Node reads whatever the value is, and the use site re-checks or throws as Node does";
|
|
95
|
+
const DYNAMIC_SHAPE = "assignability, arity and callability of an inferred shape are checker opinions: Node calls the value, and the lowering re-checks every lowered form per site";
|
|
96
|
+
const JSDOC_CLAIM = "a JSDoc type-space claim is documentation Node never reads: the values keep their runtime behavior and every use meets the per-site fences";
|
|
97
|
+
const OPINION_ROWS = [
|
|
53
98
|
// implicit any (params, variables, elements, this, returns, rest,
|
|
54
|
-
// construct signatures, index reads over shapes with no index
|
|
55
|
-
//
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
99
|
+
// construct signatures, index reads over shapes with no index signature —
|
|
100
|
+
// typeof globalThis)
|
|
101
|
+
[
|
|
102
|
+
2683,
|
|
103
|
+
CHECKER(IMPLICIT_ANY, [
|
|
104
|
+
"tests/corpus/emitter-listener-this.cjs",
|
|
105
|
+
"tests/corpus/timers-callback-this.cjs",
|
|
106
|
+
]),
|
|
107
|
+
],
|
|
108
|
+
[
|
|
109
|
+
7005,
|
|
110
|
+
CHECKER(IMPLICIT_ANY, [
|
|
111
|
+
"tests/corpus/8799-js-promise-statics-foreign-this.js",
|
|
112
|
+
"tests/corpus/7058-pipeline-function-stages.mjs",
|
|
113
|
+
]),
|
|
114
|
+
],
|
|
115
|
+
[
|
|
116
|
+
7006,
|
|
117
|
+
CHECKER(IMPLICIT_ANY, [
|
|
118
|
+
"tests/corpus/7752-typed-array-dynamic-methods.js",
|
|
119
|
+
"tests/corpus/5548-fs-callback-arguments.cjs",
|
|
120
|
+
]),
|
|
121
|
+
],
|
|
122
|
+
[
|
|
123
|
+
7008,
|
|
124
|
+
CHECKER(IMPLICIT_ANY, [
|
|
125
|
+
"tests/corpus/js-declared-fields.cjs",
|
|
126
|
+
"tests/corpus/js-inherited-field-storage.js",
|
|
127
|
+
]),
|
|
128
|
+
],
|
|
129
|
+
[
|
|
130
|
+
7009,
|
|
131
|
+
CHECKER(IMPLICIT_ANY, [
|
|
132
|
+
"tests/corpus/6562-constructor-function-transform.cjs",
|
|
133
|
+
"tests/corpus/es5-constructor-inspect-names.cjs",
|
|
134
|
+
]),
|
|
135
|
+
],
|
|
136
|
+
[7010, CHECKER(IMPLICIT_ANY)],
|
|
137
|
+
[
|
|
138
|
+
7015,
|
|
139
|
+
CHECKER(IMPLICIT_ANY, [
|
|
140
|
+
"tests/corpus/buffer-computed-members.js",
|
|
141
|
+
"tests/corpus/buffer-fs-member-reads.js",
|
|
142
|
+
]),
|
|
143
|
+
],
|
|
144
|
+
[
|
|
145
|
+
7017,
|
|
146
|
+
CHECKER(IMPLICIT_ANY, [
|
|
147
|
+
"tests/corpus/7485-global-object-own-properties.js",
|
|
148
|
+
"tests/corpus/global-stored-probes.js",
|
|
149
|
+
]),
|
|
150
|
+
],
|
|
151
|
+
[
|
|
152
|
+
7019,
|
|
153
|
+
CHECKER(IMPLICIT_ANY, [
|
|
154
|
+
"tests/corpus/2567-rest-spread-forward.js",
|
|
155
|
+
"tests/corpus/2568-rest-spread-forward-dynamic.js",
|
|
156
|
+
]),
|
|
157
|
+
],
|
|
158
|
+
[
|
|
159
|
+
7022,
|
|
160
|
+
CHECKER(IMPLICIT_ANY, [
|
|
161
|
+
"tests/corpus/5114-var-hoisting-js.js",
|
|
162
|
+
"tests/corpus/1760-surplus-args-drop.cjs",
|
|
163
|
+
]),
|
|
164
|
+
],
|
|
165
|
+
[
|
|
166
|
+
7023,
|
|
167
|
+
CHECKER(IMPLICIT_ANY, [
|
|
168
|
+
"tests/corpus/error-prototype-tostring.js",
|
|
169
|
+
"tests/corpus/function-custom-prototype.js",
|
|
170
|
+
]),
|
|
171
|
+
],
|
|
172
|
+
[
|
|
173
|
+
7024,
|
|
174
|
+
CHECKER(IMPLICIT_ANY, [
|
|
175
|
+
"tests/corpus/7450-crypto-x25519.mjs",
|
|
176
|
+
"tests/corpus/7449-crypto-raw-keys.mjs",
|
|
177
|
+
]),
|
|
178
|
+
],
|
|
179
|
+
[
|
|
180
|
+
7031,
|
|
181
|
+
CHECKER(IMPLICIT_ANY, [
|
|
182
|
+
"tests/corpus/inferred-partial-destructuring.mjs",
|
|
183
|
+
"tests/corpus/7437-duplex-from-signal.mjs",
|
|
184
|
+
]),
|
|
185
|
+
],
|
|
186
|
+
[
|
|
187
|
+
7034,
|
|
188
|
+
CHECKER(IMPLICIT_ANY, [
|
|
189
|
+
"tests/corpus/8799-js-promise-statics-foreign-this.js",
|
|
190
|
+
"tests/corpus/5547-fs-write-stream.cjs",
|
|
191
|
+
]),
|
|
192
|
+
],
|
|
193
|
+
[
|
|
194
|
+
7053,
|
|
195
|
+
CHECKER(IMPLICIT_ANY, [
|
|
196
|
+
"tests/corpus/1731-symbol-field-shapes.cjs",
|
|
197
|
+
"tests/corpus/global-symbol-cache/main.js",
|
|
198
|
+
]),
|
|
199
|
+
],
|
|
200
|
+
// strict-null narrowing demands (possibly null/undefined receivers) and
|
|
201
|
+
// the possibly-undefined values iterated or invoked
|
|
202
|
+
[
|
|
203
|
+
2531,
|
|
204
|
+
CHECKER(NULLISH_DEMAND, [
|
|
205
|
+
"tests/corpus/8702-js-primitive-object-coercion.js",
|
|
206
|
+
"tests/corpus/js-module-function-values.js",
|
|
207
|
+
]),
|
|
208
|
+
],
|
|
209
|
+
[
|
|
210
|
+
2532,
|
|
211
|
+
CHECKER(NULLISH_DEMAND, [
|
|
212
|
+
"tests/corpus/8905-groupby-dynamic-sources.js",
|
|
213
|
+
"tests/corpus/5923-matchall-groups-js.js",
|
|
214
|
+
]),
|
|
215
|
+
],
|
|
216
|
+
[2533, CHECKER(NULLISH_DEMAND)],
|
|
217
|
+
[
|
|
218
|
+
18047,
|
|
219
|
+
CHECKER(NULLISH_DEMAND, [
|
|
220
|
+
"tests/corpus/fetch-body-web-stream-linked.mjs",
|
|
221
|
+
"tests/corpus/8799-js-promise-statics-foreign-this.js",
|
|
222
|
+
]),
|
|
223
|
+
],
|
|
224
|
+
[
|
|
225
|
+
18048,
|
|
226
|
+
CHECKER(NULLISH_DEMAND, [
|
|
227
|
+
"tests/corpus/5923-matchall-groups-js.js",
|
|
228
|
+
"tests/corpus/8079-descriptor-object-shapes.cjs",
|
|
229
|
+
]),
|
|
230
|
+
],
|
|
231
|
+
[18049, CHECKER(NULLISH_DEMAND, ["tests/corpus/5303-stream-finished-callback-opts.cjs"])],
|
|
232
|
+
[
|
|
233
|
+
2488,
|
|
234
|
+
CHECKER(NULLISH_DEMAND, [
|
|
235
|
+
"tests/corpus/2602-dyn-array-destructure.js",
|
|
236
|
+
"tests/corpus/8603-destructuring-catch-bindings.cjs",
|
|
237
|
+
]),
|
|
238
|
+
],
|
|
239
|
+
[2721, CHECKER(NULLISH_DEMAND, ["tests/corpus/8702-js-primitive-object-coercion.js"])],
|
|
240
|
+
[
|
|
241
|
+
2722,
|
|
242
|
+
CHECKER(NULLISH_DEMAND, [
|
|
243
|
+
"tests/corpus/5909-iterator-helper-objects-js.js",
|
|
244
|
+
"tests/corpus/6072-iterator-sources-js.js",
|
|
245
|
+
]),
|
|
246
|
+
],
|
|
78
247
|
// assignability/arity/callability of dynamic call shapes (valid JS,
|
|
79
248
|
// checked at runtime by Node; the lowerer re-checks every lowered form
|
|
80
249
|
// per site) and member/existence probes over dynamic shapes (expando
|
|
81
|
-
// properties, capability probes — the lowerer fences unknown members
|
|
82
|
-
//
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
250
|
+
// properties, capability probes — the lowerer fences unknown members per
|
|
251
|
+
// site with the SC2020 family). 2322/2345/2554/2555/2556/2559/2740/2741/
|
|
252
|
+
// 2769 are CODE-checked JavaScript's: a checked file keeps them.
|
|
253
|
+
[
|
|
254
|
+
2322,
|
|
255
|
+
inCheckedJs(CHECKER(DYNAMIC_SHAPE, [
|
|
256
|
+
"tests/corpus/webassembly-jsapi.mjs",
|
|
257
|
+
"tests/corpus/webassembly-wpt-jsapi.mjs",
|
|
258
|
+
])),
|
|
259
|
+
],
|
|
260
|
+
[
|
|
261
|
+
2339,
|
|
262
|
+
CHECKER(DYNAMIC_SHAPE, [
|
|
263
|
+
"tests/corpus/5548-fs-callback-arguments.cjs",
|
|
264
|
+
"tests/corpus/5549-fs-callback-option-checks.cjs",
|
|
265
|
+
]),
|
|
266
|
+
],
|
|
267
|
+
[
|
|
268
|
+
2345,
|
|
269
|
+
inCheckedJs(CHECKER(DYNAMIC_SHAPE, [
|
|
270
|
+
"tests/corpus/webassembly-wpt-jsapi.mjs",
|
|
271
|
+
"tests/corpus/3035-string-positioned-search-value.js",
|
|
272
|
+
])),
|
|
273
|
+
],
|
|
274
|
+
[
|
|
275
|
+
2349,
|
|
276
|
+
CHECKER(DYNAMIC_SHAPE, [
|
|
277
|
+
"tests/corpus/webassembly-api.mjs",
|
|
278
|
+
"tests/corpus/webassembly-jsapi.mjs",
|
|
279
|
+
]),
|
|
280
|
+
],
|
|
281
|
+
[
|
|
282
|
+
2351,
|
|
283
|
+
CHECKER(DYNAMIC_SHAPE, [
|
|
284
|
+
"tests/corpus/6915-dynamic-builtin-construct.mjs",
|
|
285
|
+
"tests/corpus/typed-array-constructor-values.mjs",
|
|
286
|
+
]),
|
|
287
|
+
],
|
|
288
|
+
[
|
|
289
|
+
2367,
|
|
290
|
+
CHECKER(DYNAMIC_SHAPE, [
|
|
291
|
+
"tests/corpus/stdio-values.mjs",
|
|
292
|
+
"tests/corpus/js-array-default-buffer.js",
|
|
293
|
+
]),
|
|
294
|
+
],
|
|
295
|
+
[
|
|
296
|
+
2554,
|
|
297
|
+
inCheckedJs(CHECKER(DYNAMIC_SHAPE, [
|
|
298
|
+
"tests/corpus/2571-searchparams-arg-validation.cjs",
|
|
299
|
+
"tests/corpus/2597-dgram-send-ladders.cjs",
|
|
300
|
+
])),
|
|
301
|
+
],
|
|
302
|
+
[
|
|
303
|
+
2555,
|
|
304
|
+
inCheckedJs(CHECKER(DYNAMIC_SHAPE, [
|
|
305
|
+
"tests/corpus/js-array-proto-array-likes.js",
|
|
306
|
+
"tests/corpus/3044-array-slice-splice-positions.js",
|
|
307
|
+
])),
|
|
308
|
+
],
|
|
309
|
+
[
|
|
310
|
+
2556,
|
|
311
|
+
inCheckedJs(CHECKER(DYNAMIC_SHAPE, [
|
|
312
|
+
"tests/corpus/5216-perf-spread-arguments.js",
|
|
313
|
+
"tests/corpus/class-super-surplus-spread.mjs",
|
|
314
|
+
])),
|
|
315
|
+
],
|
|
316
|
+
[
|
|
317
|
+
2769,
|
|
318
|
+
inCheckedJs(CHECKER(DYNAMIC_SHAPE, [
|
|
319
|
+
"tests/corpus/7445-crypto-key-pair-options.mjs",
|
|
320
|
+
"tests/corpus/5254-cipher-errors.js",
|
|
321
|
+
])),
|
|
322
|
+
],
|
|
323
|
+
[
|
|
324
|
+
2740,
|
|
325
|
+
inCheckedJs(CHECKER(DYNAMIC_SHAPE, [
|
|
326
|
+
"tests/corpus/6295-jose-hs256/main.mjs",
|
|
327
|
+
"tests/corpus/js-array-default-buffer.js",
|
|
328
|
+
])),
|
|
329
|
+
], // 2322's elaborated form
|
|
330
|
+
[
|
|
331
|
+
2741,
|
|
332
|
+
inCheckedJs(CHECKER(DYNAMIC_SHAPE, [
|
|
333
|
+
"tests/corpus/webassembly-jsapi.mjs",
|
|
334
|
+
"tests/corpus/5446-crypto-secret-key-errors.js",
|
|
335
|
+
])),
|
|
336
|
+
], // 2740's sibling elaboration
|
|
337
|
+
[
|
|
338
|
+
2559,
|
|
339
|
+
inCheckedJs(CHECKER(DYNAMIC_SHAPE, [
|
|
340
|
+
"tests/corpus/7154-crypto-cipher-info.cjs",
|
|
341
|
+
"tests/corpus/5338-stream-operators-checks.cjs",
|
|
342
|
+
])),
|
|
343
|
+
],
|
|
344
|
+
[
|
|
345
|
+
2305,
|
|
346
|
+
CHECKER(DYNAMIC_SHAPE, [
|
|
347
|
+
"tests/corpus/6431-cjs-exports-rebinding/main.cjs",
|
|
348
|
+
"tests/corpus/buffer-slowbuffer.cjs",
|
|
349
|
+
]),
|
|
350
|
+
],
|
|
351
|
+
[
|
|
352
|
+
2551,
|
|
353
|
+
CHECKER(DYNAMIC_SHAPE, [
|
|
354
|
+
"tests/corpus/2595-fs-arg-ladders.cjs",
|
|
355
|
+
"tests/corpus/6704-ecdh-set-public-key.cjs",
|
|
356
|
+
]),
|
|
357
|
+
],
|
|
358
|
+
[2724, CHECKER(DYNAMIC_SHAPE)],
|
|
359
|
+
[2731, CHECKER(DYNAMIC_SHAPE, ["tests/corpus/native-proxy-env.js"])],
|
|
99
360
|
// excess object-literal properties against a JSDoc-inferred contextual
|
|
100
361
|
// type (and the did-you-mean variant): ordinary, working JS — the extra
|
|
101
|
-
// key rides the object at runtime exactly as written (the formatter
|
|
102
|
-
// expand-patterns passes an ignoreUnknown member its own JSDoc
|
|
103
|
-
// never declared)
|
|
104
|
-
|
|
105
|
-
|
|
362
|
+
// key rides the object at runtime exactly as written (the formatter
|
|
363
|
+
// idiom's expand-patterns passes an ignoreUnknown member its own JSDoc
|
|
364
|
+
// type never declared)
|
|
365
|
+
[
|
|
366
|
+
2353,
|
|
367
|
+
CHECKER(JSDOC_CLAIM, [
|
|
368
|
+
"tests/corpus/5440-crypto-hash-encodings.js",
|
|
369
|
+
"tests/corpus/5939-js-let-object-reassigned-wider.js",
|
|
370
|
+
]),
|
|
371
|
+
],
|
|
372
|
+
[2561, CHECKER(JSDOC_CLAIM)],
|
|
106
373
|
// JSDoc TYPE-SPACE claims that fail to check: a value name in a type
|
|
107
374
|
// position (2749/2702), generic constraints and index types spelled in
|
|
108
375
|
// typedefs (2344/2536/2538), an async @returns that is not Promise
|
|
109
376
|
// (1064), and 2366's no-ending-return against a JSDoc-declared return
|
|
110
|
-
// type.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
//
|
|
126
|
-
//
|
|
127
|
-
//
|
|
128
|
-
//
|
|
129
|
-
//
|
|
130
|
-
//
|
|
131
|
-
//
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
377
|
+
// type.
|
|
378
|
+
[2749, CHECKER(JSDOC_CLAIM)],
|
|
379
|
+
[2702, CHECKER(JSDOC_CLAIM)],
|
|
380
|
+
[2344, CHECKER(JSDOC_CLAIM)],
|
|
381
|
+
[2536, CHECKER(JSDOC_CLAIM)],
|
|
382
|
+
[
|
|
383
|
+
2538,
|
|
384
|
+
CHECKER(JSDOC_CLAIM, [
|
|
385
|
+
"tests/corpus/8986-js-dynamic-key-element-read.js",
|
|
386
|
+
"tests/corpus/process-env-computed-keys.js",
|
|
387
|
+
]),
|
|
388
|
+
],
|
|
389
|
+
[1064, CHECKER(JSDOC_CLAIM)],
|
|
390
|
+
[2366, CHECKER(JSDOC_CLAIM, ["tests/corpus/js-object-receiver-storage.js"])],
|
|
391
|
+
// The async-iterator protocol demand (2504). Whether a value is
|
|
392
|
+
// async-iterable is a runtime fact of untyped JS, exactly like the sync
|
|
393
|
+
// demand: `for await` over a non-iterable value and `yield*` in an async
|
|
394
|
+
// generator both lower through the runtime protocol openers, which read
|
|
395
|
+
// the method, call it, and throw TypeError at the site when it is missing,
|
|
396
|
+
// uncallable, or returns a non-object — the same protocol failure Node
|
|
397
|
+
// reports. 2505 is the sync sibling on the typed lowering lanes and stays
|
|
398
|
+
// enforced.
|
|
399
|
+
[
|
|
400
|
+
2504,
|
|
401
|
+
CHECKER("iteration membership is a runtime fact of untyped JS; the protocol openers read the method and throw Node's TypeError at the site"),
|
|
402
|
+
],
|
|
403
|
+
// An UNUSED @ts-expect-error: the directive annotated an error visible
|
|
136
404
|
// under the project's OWN tsconfig world — scriptc's world deliberately
|
|
137
405
|
// differs (adopted options, hidden declaration twins), and an unused
|
|
138
|
-
// suppression changes nothing at runtime
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
//
|
|
406
|
+
// suppression changes nothing at runtime.
|
|
407
|
+
[
|
|
408
|
+
2578,
|
|
409
|
+
CHECKER("an unused @ts-expect-error annotated an error only the project's own world has; nothing changes at runtime"),
|
|
410
|
+
],
|
|
411
|
+
// A primitive on the left of instanceof (`"x" instanceof String`): Node
|
|
412
|
+
// answers false, which the lowering folds.
|
|
413
|
+
[
|
|
414
|
+
2358,
|
|
415
|
+
CHECKER("a primitive operand's instanceof answers false, which the lowering folds", [
|
|
416
|
+
"tests/corpus/8868-class-static-has-instance-hook.js",
|
|
417
|
+
"tests/corpus/js-primitive-wrappers.js",
|
|
418
|
+
]),
|
|
419
|
+
],
|
|
420
|
+
// A lib-floor demand (es2024+ members under the es2023 lib): the member
|
|
144
421
|
// types as the error-any and its use fences per site with the honest
|
|
145
|
-
// no-lowering story instead of gating the whole program
|
|
146
|
-
|
|
422
|
+
// no-lowering story instead of gating the whole program.
|
|
423
|
+
[
|
|
424
|
+
2550,
|
|
425
|
+
CHECKER("a lib-floor demand over a member the runtime may have: the member types as the error-any and its use fences per site"),
|
|
426
|
+
],
|
|
147
427
|
// `export *` ambiguity (2308): Node DEFINES this case — ambiguous names
|
|
148
428
|
// are excluded from the star surface — where tsc asks for an explicit
|
|
149
|
-
// re-export; and 2305's did-you-mean sibling 2614 joins 2305
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
//
|
|
159
|
-
//
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
//
|
|
168
|
-
//
|
|
429
|
+
// re-export; and 2305's did-you-mean sibling 2614 joins 2305.
|
|
430
|
+
[
|
|
431
|
+
2308,
|
|
432
|
+
CHECKER("Node defines an ambiguous `export *`: the ambiguous names are excluded from the star surface"),
|
|
433
|
+
],
|
|
434
|
+
[
|
|
435
|
+
2614,
|
|
436
|
+
CHECKER("the did-you-mean spelling of a member the lowering resolves or fences at the site"),
|
|
437
|
+
],
|
|
438
|
+
// JavaScript subclasses may widen fields or add method parameters. Class
|
|
439
|
+
// lowering checks native storage and override ABIs at each use.
|
|
440
|
+
[
|
|
441
|
+
2415,
|
|
442
|
+
inCheckedJs(CHECKER("a JavaScript subclass may widen a field or add parameters; class lowering checks storage and override ABIs at each use", [
|
|
443
|
+
"tests/corpus/cjs-symbol-key-table/main.js",
|
|
444
|
+
"tests/corpus/js-nullish-inherited-fields.mjs",
|
|
445
|
+
])),
|
|
446
|
+
],
|
|
447
|
+
// A private or protected constructor (`new readline.Interface(...)`, whose
|
|
448
|
+
// declaration is protected): JavaScript has no constructor accessibility,
|
|
449
|
+
// and Node constructs the class. Each `new` meets the lowerer's per-site
|
|
450
|
+
// constructor fences.
|
|
451
|
+
[
|
|
452
|
+
2673,
|
|
453
|
+
CHECKER("JavaScript has no constructor accessibility: Node constructs the class, and each `new` meets the per-site constructor fences"),
|
|
454
|
+
],
|
|
455
|
+
[
|
|
456
|
+
2674,
|
|
457
|
+
CHECKER("JavaScript has no constructor accessibility: Node constructs the class, and each `new` meets the per-site constructor fences", ["tests/corpus/8230-readline-interface-constructor.cjs"]),
|
|
458
|
+
],
|
|
459
|
+
// Unresolvable modules: Node throws WHEN the require executes — the
|
|
460
|
+
// binding types as any and reached uses fence instead of passing
|
|
461
|
+
// unchecked.
|
|
462
|
+
[
|
|
463
|
+
2307,
|
|
464
|
+
CHECKER("an unresolvable module fails when Node loads it: the binding types as any and reached uses fence", [
|
|
465
|
+
"tests/corpus/dynamic-import-not-found.mjs",
|
|
466
|
+
"tests/corpus/2195-require-missing-package/main.mjs",
|
|
467
|
+
]),
|
|
468
|
+
],
|
|
469
|
+
[
|
|
470
|
+
2792,
|
|
471
|
+
CHECKER("an unresolvable module fails when Node loads it: the binding types as any and reached uses fence"),
|
|
472
|
+
],
|
|
473
|
+
// A write to a property declarations mark readonly (2540): `readonly` is a
|
|
474
|
+
// type annotation that Node never sees (Next.js's types mark
|
|
169
475
|
// process.env.NODE_ENV readonly; its server.js assigns it); the write
|
|
170
|
-
// lowers like any other and keeps its runtime behavior
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
//
|
|
176
|
-
|
|
476
|
+
// lowers like any other and keeps its runtime behavior.
|
|
477
|
+
[
|
|
478
|
+
2540,
|
|
479
|
+
CHECKER("`readonly` is an annotation Node never sees: the write lowers like any other and keeps its runtime behavior"),
|
|
480
|
+
],
|
|
481
|
+
// A resolved JavaScript module without declarations (7016): Node loads it
|
|
482
|
+
// like any other module; deployment trees such as Next.js standalone
|
|
483
|
+
// output ship runtime files only, so the binding types as any and its uses
|
|
484
|
+
// take the dynamic paths, as for 2307.
|
|
485
|
+
[
|
|
486
|
+
7016,
|
|
487
|
+
CHECKER("a resolved JavaScript module without declarations loads like any other: the binding types as any and its uses take the dynamic paths", [
|
|
488
|
+
"tests/corpus/6882-node-island-nested-require/main.js",
|
|
489
|
+
"tests/corpus/6880-node-island-cjs-entry/main.js",
|
|
490
|
+
]),
|
|
491
|
+
],
|
|
177
492
|
// `delete` of a property the inference typed required (2790): JS deletes
|
|
178
493
|
// any configurable property, and the lowering checks each delete's
|
|
179
|
-
// receiver itself
|
|
180
|
-
|
|
494
|
+
// receiver itself.
|
|
495
|
+
[
|
|
496
|
+
2790,
|
|
497
|
+
CHECKER("JS deletes any configurable property; the lowering checks each delete's receiver itself", ["tests/corpus/8066-object-hasown-delete.cjs", "tests/corpus/object-literal-members.mjs"]),
|
|
498
|
+
],
|
|
181
499
|
// useUnknownInCatchVariables' annotation demand ("'e' is of type
|
|
182
|
-
// 'unknown'"
|
|
183
|
-
//
|
|
184
|
-
//
|
|
185
|
-
//
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
500
|
+
// 'unknown'"): a JS catch clause CANNOT annotate its variable, so the
|
|
501
|
+
// demand is unsatisfiable in source — exactly the implicit-any story. The
|
|
502
|
+
// values stay 'unknown' and every use meets the lowerer's per-site unknown
|
|
503
|
+
// fences.
|
|
504
|
+
[
|
|
505
|
+
18046,
|
|
506
|
+
CHECKER("a JS catch clause cannot annotate its variable: the demand is unsatisfiable in source, and every use meets the per-site unknown fences", [
|
|
507
|
+
"tests/corpus/process-builtin-values.js",
|
|
508
|
+
"tests/corpus/7545-string-regex-checked-arguments.js",
|
|
509
|
+
]),
|
|
510
|
+
],
|
|
511
|
+
[
|
|
512
|
+
2571,
|
|
513
|
+
CHECKER("a JS catch clause cannot annotate its variable: the demand is unsatisfiable in source, and every use meets the per-site unknown fences", ["tests/corpus/3100-json-callback-holder.js", "tests/corpus/logical-assignment-dynamic.js"]),
|
|
514
|
+
],
|
|
189
515
|
// UNDECLARED NAMES in a JavaScript source: Node resolves them at run time,
|
|
190
516
|
// never at compile time — a READ throws the catchable
|
|
191
517
|
// `ReferenceError: <name> is not defined` at the access (`typeof` of one
|
|
192
518
|
// answers "undefined"), and a sloppy-mode WRITE creates a global. The
|
|
193
519
|
// lowerer turns the read into `scr_undef_global_read` (exact Node text and
|
|
194
520
|
// behavior) and refuses the write with SC1091, which names the Node-island
|
|
195
|
-
// route the sloppy semantics need
|
|
196
|
-
//
|
|
197
|
-
//
|
|
198
|
-
//
|
|
199
|
-
//
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
521
|
+
// route the sloppy semantics need. TypeScript input keeps the compile
|
|
522
|
+
// error: an undeclared name there is a bug, not a runtime path. 2552 is
|
|
523
|
+
// 2304's did-you-mean spelling, and 18004 is the same unresolved name in
|
|
524
|
+
// SHORTHAND position (`{ x }`), which the checker reports against the
|
|
525
|
+
// property instead of the reference.
|
|
526
|
+
[
|
|
527
|
+
2304,
|
|
528
|
+
THROW("a read of an undeclared name throws Node's ReferenceError at the access (typeof answers 'undefined'); a sloppy write is SC1091", ["tests/corpus/8427-sloppy-with-island/main.js", "tests/corpus/8515-js-undeclared-read.js"]),
|
|
529
|
+
],
|
|
530
|
+
[
|
|
531
|
+
2552,
|
|
532
|
+
THROW("a read of an undeclared name throws Node's ReferenceError at the access (typeof answers 'undefined'); a sloppy write is SC1091"),
|
|
533
|
+
],
|
|
534
|
+
[
|
|
535
|
+
18004,
|
|
536
|
+
THROW("a read of an undeclared name throws Node's ReferenceError at the access (typeof answers 'undefined'); a sloppy write is SC1091", ["tests/corpus/8515-js-undeclared-read.js"]),
|
|
537
|
+
],
|
|
203
538
|
// ---- The checker's OPINIONS about legal JavaScript ----
|
|
204
539
|
// Each diagnostic below reports that a construct is unusual for TypeScript,
|
|
205
540
|
// never that it is illegal JavaScript: Node gives it a defined runtime
|
|
206
|
-
// meaning and the lowerer already builds it. TypeScript input keeps
|
|
207
|
-
//
|
|
541
|
+
// meaning and the lowerer already builds it. TypeScript input keeps every
|
|
542
|
+
// one of them.
|
|
208
543
|
//
|
|
209
544
|
// 2695, an unused comma-operand left side (`(0, fn)`, `(0, [[x]] = [])`):
|
|
210
545
|
// the operator evaluates the left operand for its effects and yields the
|
|
211
546
|
// right one; the lowerer emits a sequence expression for it.
|
|
212
|
-
|
|
547
|
+
[
|
|
548
|
+
2695,
|
|
549
|
+
CHECKER("the comma operator evaluates its left operand for effects and yields the right one, which the lowerer emits as a sequence", ["tests/corpus/8700-js-comma-operands.js"]),
|
|
550
|
+
],
|
|
213
551
|
// 18050, `null`/`undefined` in an arithmetic or bitwise position
|
|
214
552
|
// (`null + undefined`, `null * 3`): ToNumber gives them 0 and NaN, which
|
|
215
553
|
// the numeric coercion implements for a unit literal; the demand comes
|
|
216
554
|
// from strictNullChecks, not from JavaScript.
|
|
217
|
-
|
|
555
|
+
[
|
|
556
|
+
18050,
|
|
557
|
+
CHECKER("ToNumber gives null 0 and undefined NaN; the demand comes from strictNullChecks, not from JavaScript", ["tests/corpus/8702-js-nullish-arithmetic.js"]),
|
|
558
|
+
],
|
|
218
559
|
// 7057, a `yield` in a generator with no return-type annotation: the
|
|
219
560
|
// generator protocol is untyped in JavaScript and the sent value is
|
|
220
561
|
// whatever the caller passes. The generator lowering owns the channels.
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
562
|
+
[
|
|
563
|
+
7057,
|
|
564
|
+
CHECKER("an untyped generator's sent value is whatever the caller passes; the generator lowering owns the channels", ["tests/corpus/8703-js-untyped-generators.js"]),
|
|
565
|
+
],
|
|
566
|
+
// 7032, a set accessor whose parameter has no type annotation: a
|
|
567
|
+
// JavaScript setter's parameter is whatever the caller passes. The
|
|
568
|
+
// lowering gives the parameter checked-dynamic storage (`paramShape`), and
|
|
569
|
+
// a read of it stays dynamic rather than checking the caller's value back
|
|
570
|
+
// into the type the checker inferred from a twin getter
|
|
571
|
+
// (jsWidenedBindings), so the stored value keeps its runtime identity. A
|
|
572
|
+
// JSDoc `@param` type is an annotation like any other and keeps its
|
|
573
|
+
// declared storage.
|
|
574
|
+
[
|
|
575
|
+
7032,
|
|
576
|
+
at(notPrivateName, WIDEN("a JavaScript setter's parameter is whatever the caller passes; its storage is checked-dynamic and a read keeps the stored value", ["tests/corpus/8701-js-setter-implicit-any.js"])),
|
|
577
|
+
],
|
|
578
|
+
// tsgo's strict CommonJS modeling fires these on JS shapes 5.9.3 accepted,
|
|
579
|
+
// and the real hazards those shapes carry are fenced by scriptc's OWN
|
|
580
|
+
// analysis, never by these codes — so for JS FILES ONLY they join the
|
|
581
|
+
// opinions (TS sources keep the full gate; the order-parity harness holds
|
|
582
|
+
// both lanes to identical verdicts, so a case where 5.9.3 itself raises one
|
|
583
|
+
// of these on a JS file would fail there, not slip by):
|
|
584
|
+
// - TS2309 ("export assignment with other exported elements") on the
|
|
585
|
+
// table-then-member pattern — cjsExportDiscardReason names every export
|
|
586
|
+
// Node actually discards.
|
|
587
|
+
// - TS2323 ("cannot redeclare exported variable") on symbol-keyed expando
|
|
588
|
+
// assignments in CJS classes (`this[kSym] = v` under `module.exports =
|
|
589
|
+
// Class`) — 5.9.3 synthesized expando symbols, tsgo trips its
|
|
590
|
+
// redeclaration check instead (the corpus's countdown fixture).
|
|
591
|
+
// Ordinary JavaScript functions are constructable even when the checker
|
|
592
|
+
// retains only their call signature after a factory return. Heritage
|
|
593
|
+
// lowering separately verifies the actual constructor implementation
|
|
594
|
+
// (2507).
|
|
595
|
+
[
|
|
596
|
+
2309,
|
|
597
|
+
CHECKER("Node discards the export assignment's siblings by its own rules, which cjsExportDiscardReason names", [
|
|
598
|
+
"tests/corpus/6151-cjs-export-chains/main.js",
|
|
599
|
+
"tests/corpus/6431-cjs-exports-rebinding/main.cjs",
|
|
600
|
+
]),
|
|
601
|
+
],
|
|
602
|
+
[
|
|
603
|
+
2323,
|
|
604
|
+
CHECKER("a symbol-keyed expando assignment under module.exports redeclares nothing at runtime", [
|
|
605
|
+
"tests/corpus/cjs-symbol-key-table/main.js",
|
|
606
|
+
"tests/corpus/cjs-symbol-key-collisions/main.js",
|
|
607
|
+
]),
|
|
608
|
+
],
|
|
609
|
+
[
|
|
610
|
+
2507,
|
|
611
|
+
CHECKER("an ordinary JavaScript function is constructable; heritage lowering verifies the constructor implementation", [
|
|
612
|
+
"tests/corpus/class-factory-inherited-statics.mjs",
|
|
613
|
+
"tests/corpus/6020-class-extends-function-constructor.js",
|
|
614
|
+
]),
|
|
615
|
+
],
|
|
616
|
+
// The SC0001 triage's `relax` rows: legal JavaScript whose construct the
|
|
617
|
+
// lowering already builds Node-exactly. One corpus program pins them all.
|
|
618
|
+
[
|
|
619
|
+
1313,
|
|
620
|
+
CHECKER("an empty statement as an 'if' body is legal JavaScript, and the lowering emits nothing for it", ["tests/corpus/8732-jsts-triage-relax/main.mjs"]),
|
|
621
|
+
],
|
|
622
|
+
[
|
|
623
|
+
2378,
|
|
624
|
+
CHECKER("a 'get' accessor with no return path is legal JavaScript and answers undefined", [
|
|
625
|
+
"tests/corpus/8732-jsts-triage-relax/main.mjs",
|
|
626
|
+
]),
|
|
627
|
+
],
|
|
628
|
+
[
|
|
629
|
+
2447,
|
|
630
|
+
CHECKER("'&' on booleans is legal JavaScript: the operator converts both operands with ToInt32", ["tests/corpus/8732-jsts-triage-relax/main.mjs"]),
|
|
631
|
+
],
|
|
632
|
+
[
|
|
633
|
+
2678,
|
|
634
|
+
CHECKER("comparing two literal values of different types is legal JavaScript", [
|
|
635
|
+
"tests/corpus/8732-jsts-triage-relax/main.mjs",
|
|
636
|
+
]),
|
|
637
|
+
],
|
|
638
|
+
[
|
|
639
|
+
2698,
|
|
640
|
+
CHECKER("object spread of null or undefined is legal JavaScript: the spread contributes no properties", ["tests/corpus/8732-jsts-triage-relax/main.mjs"]),
|
|
641
|
+
],
|
|
642
|
+
[
|
|
643
|
+
2774,
|
|
644
|
+
CHECKER("a function reference in a condition is legal JavaScript and truthy; the condition evaluates as written", ["tests/corpus/8732-jsts-triage-relax/main.mjs"]),
|
|
645
|
+
],
|
|
646
|
+
[
|
|
647
|
+
2783,
|
|
648
|
+
CHECKER("a later property or spread overwriting an earlier property is legal JavaScript, and the last write wins", ["tests/corpus/8732-jsts-triage-relax/main.mjs"]),
|
|
649
|
+
],
|
|
650
|
+
[
|
|
651
|
+
2872,
|
|
652
|
+
CHECKER("an always-truthy expression is legal JavaScript; the condition evaluates as written", [
|
|
653
|
+
"tests/corpus/8732-jsts-triage-relax/main.mjs",
|
|
654
|
+
]),
|
|
655
|
+
],
|
|
656
|
+
[
|
|
657
|
+
2873,
|
|
658
|
+
CHECKER("an always-falsy expression is legal JavaScript; the condition evaluates as written", [
|
|
659
|
+
"tests/corpus/8732-jsts-triage-relax/main.mjs",
|
|
660
|
+
]),
|
|
661
|
+
],
|
|
662
|
+
// Arithmetic whose other operand is bigint-ish: admitted only for an `any`
|
|
663
|
+
// or a primitive wrapper operand (TS2362/2363/2365; the code's TRIAGE row,
|
|
664
|
+
// where one exists, keeps the typed operand).
|
|
665
|
+
[
|
|
666
|
+
2362,
|
|
667
|
+
at(anyOrWrapperOperand, CHECKER("arithmetic on an 'any' or wrapper operand is plain JavaScript: the operator converts it with ToPrimitive", ["tests/corpus/js-primitive-wrappers.js", "tests/corpus/js-primitive-wrappers-zero-arg.js"])),
|
|
668
|
+
],
|
|
669
|
+
[
|
|
670
|
+
2363,
|
|
671
|
+
at(anyOrWrapperOperand, CHECKER("arithmetic on an 'any' or wrapper operand is plain JavaScript: the operator converts it with ToPrimitive")),
|
|
672
|
+
],
|
|
673
|
+
[
|
|
674
|
+
2365,
|
|
675
|
+
at(anyOrWrapperOperand, CHECKER("arithmetic on an 'any' or wrapper operand is plain JavaScript: the operator converts it with ToPrimitive", ["tests/corpus/js-primitive-wrappers.js", "tests/corpus/1614-js-fence-dodges.cjs"])),
|
|
676
|
+
],
|
|
677
|
+
// `new Iterator()` (TS2511): Iterator is the one abstract class the lib
|
|
678
|
+
// exposes, and Node throws its TypeError at the construction, which the
|
|
679
|
+
// lowering reproduces (iterator-prototype.ts).
|
|
680
|
+
[
|
|
681
|
+
2511,
|
|
682
|
+
THROW("Node throws its TypeError when the abstract Iterator class is constructed, and the lowering reproduces it at the site", ["tests/corpus/js-iterator-prototype.js"]),
|
|
683
|
+
],
|
|
684
|
+
// A base constructor's type-argument count (TS2508): JavaScript writes no
|
|
685
|
+
// type arguments, and `class X extends Iterator` names the lib's generic
|
|
686
|
+
// abstract class. The heritage lowering checks the actual base.
|
|
687
|
+
[
|
|
688
|
+
2508,
|
|
689
|
+
CHECKER("JavaScript writes no type arguments, and the heritage lowering checks the actual base class", ["tests/corpus/js-iterator-subclass.js"]),
|
|
690
|
+
],
|
|
691
|
+
// A write through a String wrapper's index (TS2542; every other readonly
|
|
692
|
+
// index signature keeps the triage's refusal).
|
|
693
|
+
[
|
|
694
|
+
2542,
|
|
695
|
+
at(stringWrapperReceiver, CHECKER("Node adds the property past the end and ignores the read-only index writes (sloppy) or throws (strict), as the object does", ["tests/corpus/js-primitive-wrappers.js", "tests/corpus/js-primitive-wrappers-zero-arg.js"])),
|
|
696
|
+
],
|
|
697
|
+
// The deprecated Buffer(...) call and fs.ReadStream/WriteStream (TS2348;
|
|
698
|
+
// every other class called without `new` keeps the triage's SC1090).
|
|
699
|
+
[
|
|
700
|
+
2348,
|
|
701
|
+
at(deprecatedBufferCall, CHECKER("Node's Buffer function and the fs stream constructors accept the call without 'new', and the lowering builds them", [
|
|
702
|
+
"tests/corpus/7529-buffer-constructor.cjs",
|
|
703
|
+
"tests/corpus/8272-fs-stream-call-without-new.cjs",
|
|
704
|
+
])),
|
|
705
|
+
],
|
|
706
|
+
];
|
|
707
|
+
/** Every JavaScript checker opinion, by TypeScript code. */
|
|
708
|
+
export const JS_OPINIONS = new Map(OPINION_ROWS);
|
|
709
|
+
/** The opinion admitting `code` in a JavaScript source, or null for a code
|
|
710
|
+
* with none (the triage table's not-yet-admitted states, and codes no
|
|
711
|
+
* journal has observed). */
|
|
712
|
+
export function jsOpinion(code) {
|
|
713
|
+
return JS_OPINIONS.get(code) ?? null;
|
|
714
|
+
}
|
|
715
|
+
const KEEP_GRAMMAR = "a JavaScript grammar or early error: Node rejects this source with a SyntaxError, and tsc's text describes that rule";
|
|
716
|
+
const KEEP_EARLY_ERROR = "an early error whose runtime failure Node raises too (a ReferenceError or TypeError at the site); tsc's text names the rule";
|
|
717
|
+
const KEEP = (why) => ({ action: "keep", why });
|
|
718
|
+
const REFUSE = (feature, hint) => ({
|
|
719
|
+
action: "refuse",
|
|
720
|
+
feature,
|
|
721
|
+
hint,
|
|
722
|
+
});
|
|
723
|
+
const REWRITE = (feature, hint) => ({
|
|
724
|
+
action: "rewrite",
|
|
725
|
+
feature,
|
|
726
|
+
hint,
|
|
727
|
+
});
|
|
728
|
+
const TRIAGE_ROWS = [
|
|
729
|
+
[1005, KEEP(KEEP_GRAMMAR)],
|
|
730
|
+
[1010, KEEP(KEEP_GRAMMAR)],
|
|
731
|
+
[1014, KEEP(KEEP_GRAMMAR)],
|
|
732
|
+
[1042, KEEP(KEEP_GRAMMAR)],
|
|
733
|
+
[1052, KEEP(KEEP_GRAMMAR)],
|
|
734
|
+
[1054, KEEP(KEEP_GRAMMAR)],
|
|
735
|
+
[1089, KEEP(KEEP_GRAMMAR)],
|
|
736
|
+
[1101, KEEP(KEEP_GRAMMAR)],
|
|
737
|
+
[1102, KEEP(KEEP_GRAMMAR)],
|
|
738
|
+
[1104, KEEP(KEEP_GRAMMAR)],
|
|
739
|
+
[1105, KEEP(KEEP_GRAMMAR)],
|
|
740
|
+
[1106, KEEP(KEEP_GRAMMAR)],
|
|
741
|
+
[1109, KEEP(KEEP_GRAMMAR)],
|
|
742
|
+
[1113, KEEP(KEEP_GRAMMAR)],
|
|
743
|
+
[1114, KEEP(KEEP_GRAMMAR)],
|
|
744
|
+
[1117, KEEP(KEEP_GRAMMAR)],
|
|
745
|
+
[1119, KEEP(KEEP_GRAMMAR)],
|
|
746
|
+
[1121, KEEP(KEEP_GRAMMAR)],
|
|
747
|
+
[1123, KEEP(KEEP_GRAMMAR)],
|
|
748
|
+
[1125, KEEP(KEEP_GRAMMAR)],
|
|
749
|
+
[1127, KEEP(KEEP_GRAMMAR)],
|
|
750
|
+
[1134, KEEP(KEEP_GRAMMAR)],
|
|
751
|
+
[1142, KEEP(KEEP_GRAMMAR)],
|
|
752
|
+
[1156, KEEP(KEEP_GRAMMAR)],
|
|
753
|
+
[1163, KEEP(KEEP_GRAMMAR)],
|
|
754
|
+
[
|
|
755
|
+
1166,
|
|
756
|
+
REWRITE("a computed class field name whose type is not a string, number, or symbol literal", "the class-field lowering needs the key computed at class-definition time, which is the value Node uses"),
|
|
757
|
+
],
|
|
758
|
+
[1189, KEEP(KEEP_GRAMMAR)],
|
|
759
|
+
[1198, KEEP(KEEP_GRAMMAR)],
|
|
760
|
+
[1200, KEEP(KEEP_GRAMMAR)],
|
|
761
|
+
[1210, KEEP(KEEP_GRAMMAR)],
|
|
762
|
+
[1214, KEEP(KEEP_GRAMMAR)],
|
|
763
|
+
[1215, KEEP(KEEP_GRAMMAR)],
|
|
764
|
+
[1260, KEEP(KEEP_GRAMMAR)],
|
|
765
|
+
[1262, KEEP(KEEP_GRAMMAR)],
|
|
766
|
+
[1312, KEEP(KEEP_GRAMMAR)],
|
|
767
|
+
[
|
|
768
|
+
1320,
|
|
769
|
+
REWRITE("an 'await' operand the checker cannot prove is a promise", "Node awaits any value and ignores a non-callable 'then'; the await lowering needs the hostile-'then' path"),
|
|
770
|
+
],
|
|
771
|
+
[1329, KEEP(KEEP_GRAMMAR)],
|
|
772
|
+
[1341, KEEP(KEEP_GRAMMAR)],
|
|
773
|
+
[1359, KEEP(KEEP_GRAMMAR)],
|
|
774
|
+
[1368, KEEP(KEEP_GRAMMAR)],
|
|
775
|
+
[1451, KEEP(KEEP_GRAMMAR)],
|
|
776
|
+
[1487, KEEP(KEEP_GRAMMAR)],
|
|
777
|
+
[1488, KEEP(KEEP_GRAMMAR)],
|
|
778
|
+
[1489, KEEP(KEEP_GRAMMAR)],
|
|
779
|
+
[1492, KEEP(KEEP_GRAMMAR)],
|
|
780
|
+
[1493, KEEP(KEEP_GRAMMAR)],
|
|
781
|
+
[1494, KEEP(KEEP_GRAMMAR)],
|
|
782
|
+
[1514, KEEP(KEEP_GRAMMAR)],
|
|
783
|
+
[1532, KEEP(KEEP_GRAMMAR)],
|
|
784
|
+
[1533, KEEP(KEEP_GRAMMAR)],
|
|
785
|
+
[1534, KEEP(KEEP_GRAMMAR)],
|
|
786
|
+
[1536, KEEP(KEEP_GRAMMAR)],
|
|
787
|
+
[1539, KEEP(KEEP_GRAMMAR)],
|
|
788
|
+
[2300, KEEP(KEEP_EARLY_ERROR)],
|
|
789
|
+
[2335, KEEP(KEEP_GRAMMAR)],
|
|
790
|
+
[2337, KEEP(KEEP_GRAMMAR)],
|
|
791
|
+
[
|
|
792
|
+
2348,
|
|
793
|
+
REWRITE("calling a class constructor without 'new'", "Node throws the 'Class constructor ... cannot be invoked without new' TypeError at the call"),
|
|
794
|
+
],
|
|
795
|
+
[
|
|
796
|
+
2356,
|
|
797
|
+
REFUSE("arithmetic on an operand the checker types as non-numeric", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
|
|
798
|
+
],
|
|
799
|
+
[2357, KEEP(KEEP_GRAMMAR)],
|
|
800
|
+
[
|
|
801
|
+
2359,
|
|
802
|
+
REWRITE("an 'instanceof' right operand that is not callable", "Node throws the 'Right-hand side of instanceof is not callable' TypeError at the expression"),
|
|
803
|
+
],
|
|
804
|
+
[2364, KEEP(KEEP_EARLY_ERROR)],
|
|
805
|
+
[
|
|
806
|
+
2372,
|
|
807
|
+
REWRITE("a parameter default that references its own parameter", "Node throws a ReferenceError when the parameter is initialized (the parameter environment's temporal dead zone)"),
|
|
808
|
+
],
|
|
809
|
+
[
|
|
810
|
+
2373,
|
|
811
|
+
REWRITE("a parameter default that references a later parameter", "Node throws a ReferenceError when the parameter is initialized (the parameter environment's temporal dead zone)"),
|
|
812
|
+
],
|
|
813
|
+
[
|
|
814
|
+
2377,
|
|
815
|
+
REWRITE("a derived constructor that never calls 'super'", "Node throws a ReferenceError when the constructor returns; the lowering needs the uninitialized-this path"),
|
|
816
|
+
],
|
|
817
|
+
[2392, KEEP(KEEP_GRAMMAR)],
|
|
818
|
+
[2393, KEEP(KEEP_GRAMMAR)],
|
|
819
|
+
[
|
|
820
|
+
2403,
|
|
821
|
+
REWRITE("a 'var' redeclared with a value of a different type", "the lowering pins the first declaration's storage type; a redeclaration must widen it (sloppy Annex B semantics)"),
|
|
822
|
+
],
|
|
823
|
+
[2405, KEEP(KEEP_GRAMMAR)],
|
|
824
|
+
[2406, KEEP(KEEP_GRAMMAR)],
|
|
825
|
+
[
|
|
826
|
+
2407,
|
|
827
|
+
REFUSE("'for...in' over a value the checker types 'never'", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
|
|
828
|
+
],
|
|
829
|
+
[2408, KEEP(KEEP_GRAMMAR)],
|
|
830
|
+
[
|
|
831
|
+
2409,
|
|
832
|
+
REWRITE("a constructor signature whose return type is not the instance type", "a JSDoc @constructor signature has to describe the instance it builds"),
|
|
833
|
+
],
|
|
834
|
+
[
|
|
835
|
+
2416,
|
|
836
|
+
REFUSE("a subclass member whose type differs from its base's", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
|
|
837
|
+
],
|
|
838
|
+
[
|
|
839
|
+
2417,
|
|
840
|
+
REFUSE("a subclass static side whose type differs from its base's", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
|
|
841
|
+
],
|
|
842
|
+
[
|
|
843
|
+
2418,
|
|
844
|
+
REFUSE("a computed class member whose value type differs from the checker's expectation", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
|
|
845
|
+
],
|
|
846
|
+
[
|
|
847
|
+
2448,
|
|
848
|
+
REWRITE("a block-scoped variable read above its declaration", "Node throws a ReferenceError (the temporal dead zone); the lowering needs a TDZ-carrying binding"),
|
|
849
|
+
],
|
|
850
|
+
[2451, KEEP(KEEP_GRAMMAR)],
|
|
851
|
+
[
|
|
852
|
+
2454,
|
|
853
|
+
REFUSE("a 'var' read before its assignment", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
|
|
854
|
+
],
|
|
855
|
+
[
|
|
856
|
+
2469,
|
|
857
|
+
REWRITE("the '+' operator on a symbol operand", "Node throws a TypeError ('Cannot convert a Symbol value to a string') at the operator"),
|
|
858
|
+
],
|
|
859
|
+
[2481, KEEP(KEEP_GRAMMAR)],
|
|
860
|
+
[2487, KEEP(KEEP_GRAMMAR)],
|
|
861
|
+
[
|
|
862
|
+
2490,
|
|
863
|
+
REWRITE("an iterator whose 'next()' result the checker cannot prove carries a 'value' property", "the iteration protocols throw a TypeError when 'next()' returns a non-object"),
|
|
864
|
+
],
|
|
865
|
+
[2491, KEEP(KEEP_GRAMMAR)],
|
|
866
|
+
[2492, KEEP(KEEP_EARLY_ERROR)],
|
|
867
|
+
[
|
|
868
|
+
2493,
|
|
869
|
+
REWRITE("reading an element of an empty tuple-typed array", "the read answers undefined in JavaScript; the tuple lowering must not assume the element exists"),
|
|
870
|
+
],
|
|
871
|
+
[
|
|
872
|
+
2506,
|
|
873
|
+
REWRITE("a class whose 'extends' expression references the class itself", "Node throws a ReferenceError when the class is defined"),
|
|
874
|
+
],
|
|
875
|
+
// TS2511 (instantiating an abstract class) has LEFT this table: `new
|
|
876
|
+
// Iterator()` is a JS_OPINIONS `throw` row above, so no JavaScript site
|
|
877
|
+
// reaches this decision any more.
|
|
878
|
+
[2524, KEEP(KEEP_GRAMMAR)],
|
|
879
|
+
[
|
|
880
|
+
2537,
|
|
881
|
+
REFUSE("an index read over a type with no matching index signature", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
|
|
882
|
+
],
|
|
883
|
+
[
|
|
884
|
+
2539,
|
|
885
|
+
REWRITE("assigning to 'undefined'", "sloppy mode ignores the write and strict mode throws a TypeError; the lowering needs the mode-dependent path"),
|
|
886
|
+
],
|
|
887
|
+
[
|
|
888
|
+
2542,
|
|
889
|
+
REFUSE("a write through a readonly index signature", "readonly is an annotation: whether the write succeeds or throws depends on the object's frozen state at run time, which the lowering does not model"),
|
|
890
|
+
],
|
|
891
|
+
[
|
|
892
|
+
2547,
|
|
893
|
+
REWRITE("an async iterator whose 'next()' result the checker cannot prove is a promise for a 'value' object", "the async iteration protocol throws a TypeError when the promise resolves to a non-object"),
|
|
894
|
+
],
|
|
895
|
+
[
|
|
896
|
+
2565,
|
|
897
|
+
REFUSE("reading 'prototype' before its assignment", "the declaration's definite-assignment rule; assign 'prototype' before the read"),
|
|
898
|
+
],
|
|
899
|
+
[
|
|
900
|
+
2576,
|
|
901
|
+
REFUSE("an instance read of a member the checker knows only as static", "the instance read answers undefined in JavaScript; declare the member on the instance to read it, or reach the class object"),
|
|
902
|
+
],
|
|
903
|
+
[
|
|
904
|
+
2588,
|
|
905
|
+
REWRITE("assigning to a 'const' binding", "Node throws a TypeError at the assignment (strict mode, and always in modules)"),
|
|
906
|
+
],
|
|
907
|
+
[
|
|
908
|
+
2629,
|
|
909
|
+
REWRITE("assigning to a class name binding", "Node throws a TypeError at the assignment; the class binding is read-only"),
|
|
910
|
+
],
|
|
911
|
+
[
|
|
912
|
+
2630,
|
|
913
|
+
REWRITE("assigning to a function declaration name", "Node throws a TypeError at the assignment in strict mode and modules"),
|
|
914
|
+
],
|
|
915
|
+
[2660, KEEP(KEEP_GRAMMAR)],
|
|
916
|
+
[2662, KEEP(KEEP_GRAMMAR)],
|
|
917
|
+
[
|
|
918
|
+
2684,
|
|
919
|
+
REWRITE("a call whose 'this' type the checker rejects", "JavaScript passes whatever receiver the expression produces; the this-context lowering is the remaining gap (W6)"),
|
|
920
|
+
],
|
|
921
|
+
[
|
|
922
|
+
2699,
|
|
923
|
+
REFUSE("a static class member named 'prototype'", "Node throws a TypeError when the class is defined; rename the member"),
|
|
924
|
+
],
|
|
925
|
+
[
|
|
926
|
+
2700,
|
|
927
|
+
REWRITE("a rest element over a null or undefined value", "Node throws a TypeError when the pattern is assigned"),
|
|
928
|
+
],
|
|
929
|
+
[
|
|
930
|
+
2703,
|
|
931
|
+
REWRITE("the operand of 'delete' is not a property reference", "sloppy mode answers true and strict mode is a SyntaxError; the lowering needs the mode-dependent path"),
|
|
932
|
+
],
|
|
933
|
+
[
|
|
934
|
+
2723,
|
|
935
|
+
REFUSE("a call to a value the checker types as possibly null or undefined", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
|
|
936
|
+
],
|
|
937
|
+
[
|
|
938
|
+
2729,
|
|
939
|
+
REWRITE("a private field read before its initialization", "Node throws a TypeError at the read"),
|
|
940
|
+
],
|
|
941
|
+
[2736, REWRITE("unary '+' on a bigint", "Node throws a TypeError at the operator")],
|
|
942
|
+
[
|
|
943
|
+
2739,
|
|
944
|
+
REFUSE("a set-like argument the checker cannot prove implements 'has' and 'size'", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
|
|
945
|
+
],
|
|
946
|
+
[
|
|
947
|
+
2767,
|
|
948
|
+
REWRITE("an iterator whose 'throw' property is not a method", "the iteration protocol throws a TypeError at the call"),
|
|
949
|
+
],
|
|
950
|
+
[
|
|
951
|
+
2768,
|
|
952
|
+
REWRITE("an async iterator whose 'return' property is not a method", "the async iteration protocol throws a TypeError at the call"),
|
|
953
|
+
],
|
|
954
|
+
[2777, KEEP(KEEP_GRAMMAR)],
|
|
955
|
+
[
|
|
956
|
+
2803,
|
|
957
|
+
REWRITE("assigning to a private method", "Node throws a TypeError at the assignment; private methods are not writable"),
|
|
958
|
+
],
|
|
959
|
+
[2815, KEEP(KEEP_GRAMMAR)],
|
|
960
|
+
[
|
|
961
|
+
2839,
|
|
962
|
+
REFUSE("a comparison the checker proves constant (two object references)", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
|
|
963
|
+
],
|
|
964
|
+
[
|
|
965
|
+
2845,
|
|
966
|
+
REFUSE("a comparison the checker proves constant (a bigint against a non-finite number)", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
|
|
967
|
+
],
|
|
968
|
+
[
|
|
969
|
+
2850,
|
|
970
|
+
REWRITE("a 'using' initializer that is not disposable", "Node throws a TypeError when the declaration is initialized"),
|
|
971
|
+
],
|
|
972
|
+
[2855, KEEP(KEEP_GRAMMAR)],
|
|
973
|
+
[
|
|
974
|
+
2869,
|
|
975
|
+
REFUSE("the right operand of '??' the checker proves unreachable", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
|
|
976
|
+
],
|
|
977
|
+
[
|
|
978
|
+
2871,
|
|
979
|
+
REFUSE("an expression the checker proves always nullish", "the construct is legal JavaScript: admitting it needs a differential proof that the lowering is Node-exact — the checker's refusal stands until then"),
|
|
980
|
+
],
|
|
981
|
+
[
|
|
982
|
+
4104,
|
|
983
|
+
REFUSE("assigning to a readonly array type", "readonly is an annotation: whether the write succeeds or throws depends on the array's frozen state at run time, which the lowering does not model"),
|
|
984
|
+
],
|
|
985
|
+
[5076, KEEP(KEEP_GRAMMAR)],
|
|
986
|
+
[
|
|
987
|
+
7036,
|
|
988
|
+
REWRITE("a dynamic import specifier that is not statically a string", "Node converts the specifier with ToString at run time, and the import lowering must follow"),
|
|
989
|
+
],
|
|
990
|
+
[17005, KEEP(KEEP_EARLY_ERROR)],
|
|
991
|
+
[17009, KEEP(KEEP_EARLY_ERROR)],
|
|
992
|
+
[17011, KEEP(KEEP_EARLY_ERROR)],
|
|
993
|
+
[17013, KEEP(KEEP_EARLY_ERROR)],
|
|
994
|
+
[18013, KEEP(KEEP_EARLY_ERROR)],
|
|
995
|
+
[18014, KEEP(KEEP_EARLY_ERROR)],
|
|
996
|
+
[18016, KEEP(KEEP_GRAMMAR)],
|
|
997
|
+
[18030, KEEP(KEEP_EARLY_ERROR)],
|
|
998
|
+
[18037, KEEP(KEEP_EARLY_ERROR)],
|
|
999
|
+
[18041, KEEP(KEEP_EARLY_ERROR)],
|
|
1000
|
+
[18058, KEEP(KEEP_EARLY_ERROR)],
|
|
1001
|
+
[18059, KEEP(KEEP_EARLY_ERROR)],
|
|
1002
|
+
[18061, KEEP(KEEP_GRAMMAR)],
|
|
1003
|
+
];
|
|
1004
|
+
/** The triage of one TypeScript code that reaches SC0001 in a JavaScript
|
|
1005
|
+
* source, or null for a code this table does not cover (a code JS_OPINIONS
|
|
1006
|
+
* admits everywhere, and a code no journal has observed). */
|
|
1007
|
+
export const JS_TSC_CODE_TRIAGE = new Map(TRIAGE_ROWS);
|
|
1008
|
+
export function jsTscCodeTriage(code) {
|
|
1009
|
+
return JS_TSC_CODE_TRIAGE.get(code) ?? null;
|
|
1010
|
+
}
|
|
226
1011
|
/** True for JavaScript source file NAMES (.js/.mjs/.cjs/.jsx) — the files
|
|
227
1012
|
* whose types come entirely from inference (checkJs + JSDoc) and whose JS
|
|
228
|
-
*
|
|
1013
|
+
* opinion stance (JS_OPINIONS) applies. */
|
|
229
1014
|
export function isJsSourceFileName(fileName) {
|
|
230
1015
|
// The same classification as /\.(js|mjs|cjs|jsx)$/, without a regular
|
|
231
1016
|
// expression: this runs for most type queries.
|