@scriptc/compiler 0.0.34 → 0.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ambient/scriptc-node-fallback.d.ts +7 -6
- package/dist/backend/build-cache.d.ts +44 -0
- package/dist/backend/build-cache.js +241 -0
- package/dist/backend/build-cache.js.map +1 -0
- package/dist/backend/{emission/emit-async.d.ts → c/async.d.ts} +21 -30
- package/dist/backend/{emission/emit-async.js → c/async.js} +270 -286
- package/dist/backend/c/async.js.map +1 -0
- package/dist/backend/{emission/emitter.d.ts → c/c-emitter.d.ts} +6 -23
- package/dist/backend/{emission/emitter.js → c/c-emitter.js} +53 -107
- package/dist/backend/c/c-emitter.js.map +1 -0
- package/dist/backend/c/exprs.d.ts +8 -0
- package/dist/backend/c/exprs.js +7913 -0
- package/dist/backend/c/exprs.js.map +1 -0
- package/dist/backend/{emission/emit-island.d.ts → c/island.d.ts} +5 -5
- package/dist/backend/{emission/emit-island.js → c/island.js} +24 -22
- package/dist/backend/c/island.js.map +1 -0
- package/dist/backend/{emission → c}/may-throw.d.ts +1 -1
- package/dist/backend/{emission → c}/may-throw.js +1 -1
- package/dist/backend/c/may-throw.js.map +1 -0
- package/dist/backend/{emission/emit-shapes.d.ts → c/shapes.d.ts} +19 -19
- package/dist/backend/{emission/emit-shapes.js → c/shapes.js} +78 -87
- package/dist/backend/c/shapes.js.map +1 -0
- package/dist/backend/{emission/emit-stmts.d.ts → c/stmts.d.ts} +12 -12
- package/dist/backend/{emission/emit-stmts.js → c/stmts.js} +377 -343
- package/dist/backend/c/stmts.js.map +1 -0
- package/dist/backend/{emission/emit-types.d.ts → c/types.d.ts} +1 -1
- package/dist/backend/{emission/emit-types.js → c/types.js} +42 -286
- package/dist/backend/c/types.js.map +1 -0
- package/dist/backend/c/types.test.js +25 -0
- package/dist/backend/c/types.test.js.map +1 -0
- package/dist/backend/{emission/emit-walkers.d.ts → c/walkers.d.ts} +19 -41
- package/dist/backend/{emission/emit-walkers.js → c/walkers.js} +238 -298
- package/dist/backend/c/walkers.js.map +1 -0
- package/dist/backend/ffi-callbacks.d.ts +1 -1
- package/dist/backend/ffi-callbacks.js +4 -3
- package/dist/backend/ffi-callbacks.js.map +1 -1
- package/dist/backend/{library-identity.d.ts → library-identity-markers.d.ts} +0 -4
- package/dist/backend/{library-identity.js → library-identity-markers.js} +10 -9
- package/dist/backend/library-identity-markers.js.map +1 -0
- package/dist/backend/llvm/blocks.d.ts +4 -0
- package/dist/backend/llvm/blocks.js +29 -0
- package/dist/backend/llvm/blocks.js.map +1 -1
- package/dist/backend/llvm/classes.d.ts +2 -19
- package/dist/backend/llvm/classes.js +20 -52
- package/dist/backend/llvm/classes.js.map +1 -1
- package/dist/backend/llvm/common.d.ts +4 -0
- package/dist/backend/llvm/common.js +27 -0
- package/dist/backend/llvm/common.js.map +1 -0
- package/dist/backend/llvm/dyn.d.ts +3 -8
- package/dist/backend/llvm/dyn.js +152 -224
- package/dist/backend/llvm/dyn.js.map +1 -1
- package/dist/backend/llvm/emitter.d.ts +4 -1
- package/dist/backend/llvm/emitter.js +514 -9981
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/backend/llvm/expr-async.d.ts +4 -0
- package/dist/backend/llvm/expr-async.js +726 -0
- package/dist/backend/llvm/expr-async.js.map +1 -0
- package/dist/backend/llvm/expr-bytes.d.ts +13 -0
- package/dist/backend/llvm/expr-bytes.js +456 -0
- package/dist/backend/llvm/expr-bytes.js.map +1 -0
- package/dist/backend/llvm/expr-callbacks.d.ts +22 -0
- package/dist/backend/llvm/expr-callbacks.js +520 -0
- package/dist/backend/llvm/expr-callbacks.js.map +1 -0
- package/dist/backend/llvm/expr-calls.d.ts +2 -0
- package/dist/backend/llvm/expr-calls.js +618 -0
- package/dist/backend/llvm/expr-calls.js.map +1 -0
- package/dist/backend/llvm/expr-containers.d.ts +25 -0
- package/dist/backend/llvm/expr-containers.js +623 -0
- package/dist/backend/llvm/expr-containers.js.map +1 -0
- package/dist/backend/llvm/expr-context.d.ts +255 -0
- package/dist/backend/llvm/expr-context.js +2 -0
- package/dist/backend/llvm/expr-context.js.map +1 -0
- package/dist/backend/llvm/expr-control.d.ts +2 -0
- package/dist/backend/llvm/expr-control.js +473 -0
- package/dist/backend/llvm/expr-control.js.map +1 -0
- package/dist/backend/llvm/expr-dispatch.d.ts +4 -0
- package/dist/backend/llvm/expr-dispatch.js +151 -0
- package/dist/backend/llvm/expr-dispatch.js.map +1 -0
- package/dist/backend/llvm/expr-dynamic.d.ts +2 -0
- package/dist/backend/llvm/expr-dynamic.js +810 -0
- package/dist/backend/llvm/expr-dynamic.js.map +1 -0
- package/dist/backend/llvm/expr-island.d.ts +15 -0
- package/dist/backend/llvm/expr-island.js +690 -0
- package/dist/backend/llvm/expr-island.js.map +1 -0
- package/dist/backend/llvm/expr-primitives.d.ts +6 -0
- package/dist/backend/llvm/expr-primitives.js +622 -0
- package/dist/backend/llvm/expr-primitives.js.map +1 -0
- package/dist/backend/llvm/expr-records.d.ts +9 -0
- package/dist/backend/llvm/expr-records.js +299 -0
- package/dist/backend/llvm/expr-records.js.map +1 -0
- package/dist/backend/llvm/expr-stream-bridges.d.ts +13 -0
- package/dist/backend/llvm/expr-stream-bridges.js +396 -0
- package/dist/backend/llvm/expr-stream-bridges.js.map +1 -0
- package/dist/backend/llvm/expr-stream-callbacks.d.ts +12 -0
- package/dist/backend/llvm/expr-stream-callbacks.js +360 -0
- package/dist/backend/llvm/expr-stream-callbacks.js.map +1 -0
- package/dist/backend/llvm/lib-dispatch.d.ts +5 -0
- package/dist/backend/llvm/lib-dispatch.js +267 -0
- package/dist/backend/llvm/lib-dispatch.js.map +1 -0
- package/dist/backend/llvm/lib-filesystem.d.ts +6 -0
- package/dist/backend/llvm/lib-filesystem.js +594 -0
- package/dist/backend/llvm/lib-filesystem.js.map +1 -0
- package/dist/backend/llvm/lib-network.d.ts +2 -0
- package/dist/backend/llvm/lib-network.js +429 -0
- package/dist/backend/llvm/lib-network.js.map +1 -0
- package/dist/backend/llvm/lib-process.d.ts +5 -0
- package/dist/backend/llvm/lib-process.js +585 -0
- package/dist/backend/llvm/lib-process.js.map +1 -0
- package/dist/backend/llvm/lib-shared.d.ts +6 -0
- package/dist/backend/llvm/lib-shared.js +687 -0
- package/dist/backend/llvm/lib-shared.js.map +1 -0
- package/dist/backend/llvm/lib-stream.d.ts +2 -0
- package/dist/backend/llvm/lib-stream.js +470 -0
- package/dist/backend/llvm/lib-stream.js.map +1 -0
- package/dist/backend/llvm/shapes.d.ts +12 -2
- package/dist/backend/llvm/shapes.js +66 -307
- package/dist/backend/llvm/shapes.js.map +1 -1
- package/dist/backend/llvm/shapes.test.js +52 -0
- package/dist/backend/llvm/shapes.test.js.map +1 -0
- package/dist/backend/llvm/split.d.ts +43 -0
- package/dist/backend/llvm/split.js +227 -0
- package/dist/backend/llvm/split.js.map +1 -0
- package/dist/backend/llvm/split.test.d.ts +1 -0
- package/dist/backend/llvm/split.test.js +102 -0
- package/dist/backend/llvm/split.test.js.map +1 -0
- package/dist/backend/llvm/unsupported.d.ts +1 -1
- package/dist/backend/llvm/walkers.d.ts +2 -3
- package/dist/backend/llvm/walkers.js +164 -218
- package/dist/backend/llvm/walkers.js.map +1 -1
- package/dist/backend/native-codegen.d.ts +38 -0
- package/dist/backend/native-codegen.js +261 -0
- package/dist/backend/native-codegen.js.map +1 -0
- package/dist/backend/native-codegen.test.d.ts +1 -0
- package/dist/backend/native-codegen.test.js +188 -0
- package/dist/backend/native-codegen.test.js.map +1 -0
- package/dist/backend/native-link-info.d.ts +96 -0
- package/dist/backend/native-link-info.js +219 -0
- package/dist/backend/native-link-info.js.map +1 -0
- package/dist/backend/native-link-info.test.d.ts +1 -0
- package/dist/backend/native-link-info.test.js +134 -0
- package/dist/backend/native-link-info.test.js.map +1 -0
- package/dist/backend/{cc.d.ts → native-toolchain.d.ts} +139 -47
- package/dist/backend/{cc.js → native-toolchain.js} +1008 -910
- package/dist/backend/native-toolchain.js.map +1 -0
- package/dist/backend/native-toolchain.test.d.ts +1 -0
- package/dist/backend/{cc-cache.test.js → native-toolchain.test.js} +1297 -127
- package/dist/backend/native-toolchain.test.js.map +1 -0
- package/dist/backend/object-localize.js +1 -1
- package/dist/backend/object-localize.test.js +20 -0
- package/dist/backend/object-localize.test.js.map +1 -1
- package/dist/backend/runtime-abi.d.ts +10 -0
- package/dist/backend/runtime-abi.js +11 -0
- package/dist/backend/runtime-abi.js.map +1 -0
- package/dist/backend/runtime-pack.d.ts +137 -0
- package/dist/backend/runtime-pack.js +400 -0
- package/dist/backend/runtime-pack.js.map +1 -0
- package/dist/backend/runtime-pack.test.d.ts +1 -0
- package/dist/backend/runtime-pack.test.js +438 -0
- package/dist/backend/runtime-pack.test.js.map +1 -0
- package/dist/backend/targets.d.ts +30 -0
- package/dist/backend/targets.js +46 -0
- package/dist/backend/targets.js.map +1 -0
- package/dist/backend/targets.test.d.ts +1 -0
- package/dist/backend/targets.test.js +19 -0
- package/dist/backend/targets.test.js.map +1 -0
- package/dist/backend/vendor-archives.d.ts +41 -0
- package/dist/backend/vendor-archives.js +462 -0
- package/dist/backend/vendor-archives.js.map +1 -0
- package/dist/compat/fetch-profile.d.ts +0 -1
- package/dist/compat/fetch-profile.js +0 -1
- package/dist/compat/fetch-profile.js.map +1 -1
- package/dist/coverage/report.js +3 -3
- package/dist/coverage/report.js.map +1 -1
- package/dist/coverage/surface-manifest.js +25 -32
- package/dist/coverage/surface-manifest.js.map +1 -1
- package/dist/diagnostics/diagnostic.d.ts +11 -12
- package/dist/diagnostics/diagnostic.js +19 -17
- package/dist/diagnostics/diagnostic.js.map +1 -1
- package/dist/diagnostics/render.d.ts +1 -1
- package/dist/diagnostics/render.js +1 -1
- package/dist/diagnostics/render.js.map +1 -1
- package/dist/errors.d.ts +5 -0
- package/dist/errors.js +9 -0
- package/dist/errors.js.map +1 -0
- package/dist/executable/executable-cache.d.ts +86 -0
- package/dist/executable/executable-cache.js +398 -0
- package/dist/executable/executable-cache.js.map +1 -0
- package/dist/executable/executable-cache.test.d.ts +1 -0
- package/dist/executable/executable-cache.test.js +300 -0
- package/dist/executable/executable-cache.test.js.map +1 -0
- package/dist/ffi/{profile.d.ts → ffi-manifest.d.ts} +7 -2
- package/dist/ffi/{profile.js → ffi-manifest.js} +2 -1
- package/dist/ffi/ffi-manifest.js.map +1 -0
- package/dist/frontend/builtin-modules.d.ts +21 -0
- package/dist/frontend/builtin-modules.js +82 -0
- package/dist/frontend/builtin-modules.js.map +1 -0
- package/dist/frontend/cjs-lexer.d.ts +7 -0
- package/dist/frontend/cjs-lexer.js +15 -17
- package/dist/frontend/cjs-lexer.js.map +1 -1
- package/dist/frontend/dts-paths.d.ts +26 -0
- package/dist/frontend/dts-paths.js +41 -0
- package/dist/frontend/dts-paths.js.map +1 -0
- package/dist/frontend/input-tracker.d.ts +0 -2
- package/dist/frontend/input-tracker.js +1 -4
- package/dist/frontend/input-tracker.js.map +1 -1
- package/dist/frontend/lib-contract.d.ts +1 -5
- package/dist/frontend/lib-contract.js +1 -1
- package/dist/frontend/lib-contract.js.map +1 -1
- package/dist/frontend/lib-exports.d.ts +1 -1
- package/dist/frontend/lowering/call-position.d.ts +4 -0
- package/dist/frontend/lowering/call-position.js +7 -0
- package/dist/frontend/lowering/call-position.js.map +1 -0
- package/dist/frontend/lowering/callback-arg.d.ts +20 -0
- package/dist/frontend/lowering/callback-arg.js +44 -0
- package/dist/frontend/lowering/callback-arg.js.map +1 -0
- package/dist/frontend/lowering/lib-boundary.d.ts +1 -1
- package/dist/frontend/lowering/lib-boundary.js +34 -34
- package/dist/frontend/lowering/lib-boundary.js.map +1 -1
- package/dist/frontend/lowering/lower-assert.d.ts +3 -3
- package/dist/frontend/lowering/lower-assert.js +214 -241
- package/dist/frontend/lowering/lower-assert.js.map +1 -1
- package/dist/frontend/lowering/lower-builtins.d.ts +74 -146
- package/dist/frontend/lowering/lower-builtins.js +1126 -1234
- package/dist/frontend/lowering/lower-builtins.js.map +1 -1
- package/dist/frontend/lowering/lower-calls.d.ts +56 -188
- package/dist/frontend/lowering/lower-calls.js +1409 -1494
- package/dist/frontend/lowering/lower-calls.js.map +1 -1
- package/dist/frontend/lowering/lower-classes.d.ts +62 -125
- package/dist/frontend/lowering/lower-classes.js +832 -866
- package/dist/frontend/lowering/lower-classes.js.map +1 -1
- package/dist/frontend/lowering/lower-comptime.d.ts +5 -12
- package/dist/frontend/lowering/lower-comptime.js +32 -31
- package/dist/frontend/lowering/lower-comptime.js.map +1 -1
- package/dist/frontend/lowering/lower-containers.d.ts +35 -135
- package/dist/frontend/lowering/lower-containers.js +1394 -1715
- package/dist/frontend/lowering/lower-containers.js.map +1 -1
- package/dist/frontend/lowering/lower-dgram.d.ts +3 -7
- package/dist/frontend/lowering/lower-dgram.js +97 -111
- package/dist/frontend/lowering/lower-dgram.js.map +1 -1
- package/dist/frontend/lowering/lower-enums.d.ts +4 -4
- package/dist/frontend/lowering/lower-enums.js +30 -30
- package/dist/frontend/lowering/lower-enums.js.map +1 -1
- package/dist/frontend/lowering/{lower-emitter.d.ts → lower-event-emitter.d.ts} +7 -18
- package/dist/frontend/lowering/{lower-emitter.js → lower-event-emitter.js} +172 -174
- package/dist/frontend/lowering/lower-event-emitter.js.map +1 -0
- package/dist/frontend/lowering/lower-expando.d.ts +5 -5
- package/dist/frontend/lowering/lower-expando.js +40 -40
- package/dist/frontend/lowering/lower-expando.js.map +1 -1
- package/dist/frontend/lowering/lower-exprs.d.ts +56 -264
- package/dist/frontend/lowering/lower-exprs.js +1644 -1704
- package/dist/frontend/lowering/lower-exprs.js.map +1 -1
- package/dist/frontend/lowering/lower-generators.d.ts +6 -6
- package/dist/frontend/lowering/lower-generators.js +73 -72
- package/dist/frontend/lowering/lower-generators.js.map +1 -1
- package/dist/frontend/lowering/lower-inspect.d.ts +5 -17
- package/dist/frontend/lowering/lower-inspect.js +236 -238
- package/dist/frontend/lowering/lower-inspect.js.map +1 -1
- package/dist/frontend/lowering/lower-island.d.ts +34 -45
- package/dist/frontend/lowering/lower-island.js +440 -511
- package/dist/frontend/lowering/lower-island.js.map +1 -1
- package/dist/frontend/lowering/lower-mixins.d.ts +7 -10
- package/dist/frontend/lowering/lower-mixins.js +86 -86
- package/dist/frontend/lowering/lower-mixins.js.map +1 -1
- package/dist/frontend/lowering/lower-modules.d.ts +12 -18
- package/dist/frontend/lowering/lower-modules.js +284 -283
- package/dist/frontend/lowering/lower-modules.js.map +1 -1
- package/dist/frontend/lowering/lower-namespaces.d.ts +23 -49
- package/dist/frontend/lowering/lower-namespaces.js +123 -115
- package/dist/frontend/lowering/lower-namespaces.js.map +1 -1
- package/dist/frontend/lowering/lower-server.d.ts +18 -25
- package/dist/frontend/lowering/lower-server.js +899 -899
- package/dist/frontend/lowering/lower-server.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.d.ts +30 -149
- package/dist/frontend/lowering/lower-stmts.js +1176 -1229
- package/dist/frontend/lowering/lower-stmts.js.map +1 -1
- package/dist/frontend/lowering/lower-stream.d.ts +12 -12
- package/dist/frontend/lowering/lower-stream.js +300 -301
- package/dist/frontend/lowering/lower-stream.js.map +1 -1
- package/dist/frontend/lowering/lower-test.d.ts +5 -5
- package/dist/frontend/lowering/lower-test.js +82 -82
- package/dist/frontend/lowering/lower-test.js.map +1 -1
- package/dist/frontend/lowering/lowerer.d.ts +66 -20
- package/dist/frontend/lowering/lowerer.js +421 -198
- package/dist/frontend/lowering/lowerer.js.map +1 -1
- package/dist/frontend/lowering/pairs-snapshot.d.ts +11 -0
- package/dist/frontend/lowering/pairs-snapshot.js +85 -0
- package/dist/frontend/lowering/pairs-snapshot.js.map +1 -0
- package/dist/frontend/lowering/static-this.d.ts +6 -0
- package/dist/frontend/lowering/static-this.js +24 -0
- package/dist/frontend/lowering/static-this.js.map +1 -0
- package/dist/frontend/lowering/surfaces.d.ts +14 -33
- package/dist/frontend/lowering/surfaces.js +64 -64
- package/dist/frontend/lowering/surfaces.js.map +1 -1
- package/dist/frontend/npm-static-rewrite.js +6 -28
- package/dist/frontend/npm-static-rewrite.js.map +1 -1
- package/dist/frontend/npm-static.d.ts +0 -10
- package/dist/frontend/npm-static.js +4 -7
- package/dist/frontend/npm-static.js.map +1 -1
- package/dist/frontend/npm.d.ts +0 -24
- package/dist/frontend/npm.js +11 -85
- package/dist/frontend/npm.js.map +1 -1
- package/dist/frontend/program.d.ts +3 -1
- package/dist/frontend/program.js +51 -17
- package/dist/frontend/program.js.map +1 -1
- package/dist/frontend/provenance-registry.d.ts +0 -2
- package/dist/frontend/provenance-registry.js +0 -10
- package/dist/frontend/provenance-registry.js.map +1 -1
- package/dist/frontend/provenance.js +4 -7
- package/dist/frontend/provenance.js.map +1 -1
- package/dist/frontend/resolve.d.ts +7 -2
- package/dist/frontend/resolve.js +12 -17
- package/dist/frontend/resolve.js.map +1 -1
- package/dist/frontend/resolve.test.d.ts +1 -0
- package/dist/frontend/resolve.test.js +29 -0
- package/dist/frontend/resolve.test.js.map +1 -0
- package/dist/frontend/ts7/adapter.d.ts +2 -2
- package/dist/frontend/ts7/adapter.js +1 -1
- package/dist/frontend/ts7/adapter.js.map +1 -1
- package/dist/frontend/ts7/checker.d.ts +40 -2
- package/dist/frontend/ts7/checker.js +182 -54
- package/dist/frontend/ts7/checker.js.map +1 -1
- package/dist/frontend/ts7/enums.js +2 -1
- package/dist/frontend/ts7/enums.js.map +1 -1
- package/dist/frontend/ts7/{program.js → program-adapter.js} +7 -6
- package/dist/frontend/ts7/program-adapter.js.map +1 -0
- package/dist/frontend/ts7/world-check.d.ts +1 -3
- package/dist/frontend/ts7/world-check.js +3 -1
- package/dist/frontend/ts7/world-check.js.map +1 -1
- package/dist/frontend/tsc-codes.d.ts +8 -0
- package/dist/frontend/tsc-codes.js +109 -0
- package/dist/frontend/tsc-codes.js.map +1 -0
- package/dist/frontend/{types.d.ts → type-mapper.d.ts} +2 -25
- package/dist/frontend/{types.js → type-mapper.js} +31 -52
- package/dist/frontend/type-mapper.js.map +1 -0
- package/dist/frontend/workspace-registry.d.ts +26 -0
- package/dist/frontend/workspace-registry.js +71 -0
- package/dist/frontend/workspace-registry.js.map +1 -0
- package/dist/index.d.ts +115 -30
- package/dist/index.js +650 -146
- package/dist/index.js.map +1 -1
- package/dist/ir/analysis.d.ts +37 -0
- package/dist/ir/analysis.js +118 -0
- package/dist/ir/analysis.js.map +1 -0
- package/dist/ir/analysis.test.d.ts +1 -0
- package/dist/ir/analysis.test.js +21 -0
- package/dist/ir/analysis.test.js.map +1 -0
- package/dist/ir/build.d.ts +9 -0
- package/dist/ir/build.js +33 -0
- package/dist/ir/build.js.map +1 -0
- package/dist/ir/integer-loops.d.ts +1 -1
- package/dist/ir/{nodes.d.ts → ir.d.ts} +60 -26
- package/dist/ir/{nodes.js → ir.js} +173 -141
- package/dist/ir/ir.js.map +1 -0
- package/dist/ir/ir.test.d.ts +1 -0
- package/dist/ir/ir.test.js +17 -0
- package/dist/ir/ir.test.js.map +1 -0
- package/dist/ir/serialize.d.ts +1 -1
- package/dist/ir/serialize.js +2 -1
- package/dist/ir/serialize.js.map +1 -1
- package/dist/ir/validate.d.ts +1 -1
- package/dist/ir/validate.js +16 -5
- package/dist/ir/validate.js.map +1 -1
- package/dist/library/cache-primitives.d.ts +24 -0
- package/dist/library/cache-primitives.js +83 -0
- package/dist/library/cache-primitives.js.map +1 -0
- package/dist/library/cache-reset.test.d.ts +1 -0
- package/dist/library/cache-reset.test.js +47 -0
- package/dist/library/cache-reset.test.js.map +1 -0
- package/dist/library/compiler-self-identity.d.ts +23 -0
- package/dist/library/compiler-self-identity.js +84 -0
- package/dist/library/compiler-self-identity.js.map +1 -0
- package/dist/library/fence-eval.d.ts +3 -1
- package/dist/library/fence-eval.js +5 -1
- package/dist/library/fence-eval.js.map +1 -1
- package/dist/library/int-infer.d.ts +1 -36
- package/dist/library/int-infer.js +17 -17
- package/dist/library/int-infer.js.map +1 -1
- package/dist/library/{early-cache.d.ts → library-cache.d.ts} +1 -1
- package/dist/library/{early-cache.js → library-cache.js} +37 -111
- package/dist/library/library-cache.js.map +1 -0
- package/dist/library/library-cache.test.d.ts +1 -0
- package/dist/library/{early-cache.test.js → library-cache.test.js} +2 -2
- package/dist/library/library-cache.test.js.map +1 -0
- package/dist/library/{profile.d.ts → library-profile.d.ts} +4 -7
- package/dist/library/{profile.js → library-profile.js} +18 -11
- package/dist/library/library-profile.js.map +1 -0
- package/dist/library/semantic-source.js +2 -1
- package/dist/library/semantic-source.js.map +1 -1
- package/dist/library/sidecar.d.ts +5 -2
- package/dist/library/sidecar.js +11 -5
- package/dist/library/sidecar.js.map +1 -1
- package/dist/startup-cache.d.ts +6 -0
- package/dist/startup-cache.js +6 -0
- package/dist/startup-cache.js.map +1 -0
- package/package.json +7 -2
- package/surface-manifest.json +1 -1
- package/dist/backend/cc-cache.test.js.map +0 -1
- package/dist/backend/cc.js.map +0 -1
- package/dist/backend/emission/emit-async.js.map +0 -1
- package/dist/backend/emission/emit-exprs.d.ts +0 -13
- package/dist/backend/emission/emit-exprs.js +0 -7407
- package/dist/backend/emission/emit-exprs.js.map +0 -1
- package/dist/backend/emission/emit-island.js.map +0 -1
- package/dist/backend/emission/emit-shapes.js.map +0 -1
- package/dist/backend/emission/emit-stmts.js.map +0 -1
- package/dist/backend/emission/emit-types.js.map +0 -1
- package/dist/backend/emission/emit-walkers.js.map +0 -1
- package/dist/backend/emission/emitter.js.map +0 -1
- package/dist/backend/emission/may-throw.js.map +0 -1
- package/dist/backend/library-identity.js.map +0 -1
- package/dist/ffi/profile.js.map +0 -1
- package/dist/frontend/lowering/lower-emitter.js.map +0 -1
- package/dist/frontend/shared.d.ts +0 -82
- package/dist/frontend/shared.js +0 -308
- package/dist/frontend/shared.js.map +0 -1
- package/dist/frontend/ts7/program.js.map +0 -1
- package/dist/frontend/types.js.map +0 -1
- package/dist/ir/nodes.js.map +0 -1
- package/dist/library/early-cache.js.map +0 -1
- package/dist/library/early-cache.test.js.map +0 -1
- package/dist/library/profile.js.map +0 -1
- /package/dist/backend/{cc-cache.test.d.ts → c/types.test.d.ts} +0 -0
- /package/dist/{library/early-cache.test.d.ts → backend/llvm/shapes.test.d.ts} +0 -0
- /package/dist/frontend/ts7/{program.d.ts → program-adapter.d.ts} +0 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/** Compiler options adopted from the project during preflight. */
|
|
2
|
+
export const ADOPTED_OPTIONS = [
|
|
3
|
+
"strict",
|
|
4
|
+
"noImplicitAny",
|
|
5
|
+
"strictNullChecks",
|
|
6
|
+
"strictFunctionTypes",
|
|
7
|
+
"strictBindCallApply",
|
|
8
|
+
"strictPropertyInitialization",
|
|
9
|
+
"strictBuiltinIteratorReturn",
|
|
10
|
+
"noImplicitThis",
|
|
11
|
+
"alwaysStrict",
|
|
12
|
+
"useUnknownInCatchVariables",
|
|
13
|
+
"noUncheckedIndexedAccess",
|
|
14
|
+
"exactOptionalPropertyTypes",
|
|
15
|
+
"noImplicitOverride",
|
|
16
|
+
"noPropertyAccessFromIndexSignature",
|
|
17
|
+
"noImplicitReturns",
|
|
18
|
+
"noFallthroughCasesInSwitch",
|
|
19
|
+
"noUnusedLocals",
|
|
20
|
+
"noUnusedParameters",
|
|
21
|
+
"allowUnusedLabels",
|
|
22
|
+
"allowUnreachableCode",
|
|
23
|
+
"skipLibCheck",
|
|
24
|
+
// Import-form interop knobs: they only change which import FORMS
|
|
25
|
+
// typecheck (default imports of CJS-shaped types) — the import fence
|
|
26
|
+
// rejects unsupported forms with SC-diagnostics either way, and a
|
|
27
|
+
// SC1012 "not supported yet" beats a raw TS1259 at the same site.
|
|
28
|
+
"esModuleInterop",
|
|
29
|
+
"allowSyntheticDefaultImports",
|
|
30
|
+
];
|
|
31
|
+
/* The JAVASCRIPT strictness stance (the JS-input design made real):
|
|
32
|
+
* JavaScript sources carry no annotations, so tsc's strictness families
|
|
33
|
+
* that exist to demand annotations — or to reject dynamically-typed
|
|
34
|
+
* idioms that are ordinary, working JS — cannot be satisfied by the
|
|
35
|
+
* program's author at all. The design already says where inference gaps
|
|
36
|
+
* land: exactly where `any` lands in TS (island under --dynamic, honest
|
|
37
|
+
* fences without). So for JS FILES ONLY, these tsc families are not
|
|
38
|
+
* preflight gates; the values involved stay `any`/loose and every use
|
|
39
|
+
* meets the lowerer's per-site fences instead. TypeScript sources keep
|
|
40
|
+
* the full strict gate — nothing here weakens the default for annotated
|
|
41
|
+
* programs. */
|
|
42
|
+
export const JS_RELAXED_TSC_CODES = new Set([
|
|
43
|
+
// implicit any (params, variables, elements, this, returns, rest,
|
|
44
|
+
// construct signatures, index reads over shapes with no index
|
|
45
|
+
// signature — typeof globalThis)
|
|
46
|
+
2683, 7005, 7006, 7008, 7009, 7010, 7015, 7017, 7019, 7022, 7023, 7024, 7031, 7034, 7053,
|
|
47
|
+
// strict-null narrowing demands (possibly null/undefined receivers)
|
|
48
|
+
2531, 2532, 2533, 18047, 18048, 18049,
|
|
49
|
+
// assignability/arity/callability of dynamic call shapes (valid JS,
|
|
50
|
+
// checked at runtime by Node; the lowerer re-checks every lowered form
|
|
51
|
+
// per site) and member/existence probes over dynamic shapes (expando
|
|
52
|
+
// properties, capability probes — the lowerer fences unknown members
|
|
53
|
+
// per site with the SC2020 family)
|
|
54
|
+
2322, 2339, 2345, 2349, 2351, 2367, 2554, 2555, 2556, 2769,
|
|
55
|
+
2740, // 2322's elaborated "missing the following properties" form
|
|
56
|
+
2305, 2551, 2724, 2731,
|
|
57
|
+
// excess object-literal properties against a JSDoc-inferred contextual
|
|
58
|
+
// type (and the did-you-mean variant): ordinary, working JS — the extra
|
|
59
|
+
// key rides the object at runtime exactly as written (the formatter idiom's
|
|
60
|
+
// expand-patterns passes an ignoreUnknown member its own JSDoc type
|
|
61
|
+
// never declared)
|
|
62
|
+
2353, 2561,
|
|
63
|
+
// JSDoc TYPE-SPACE claims that fail to check: a value name in a type
|
|
64
|
+
// position (2749/2702), generic constraints and index types spelled in
|
|
65
|
+
// typedefs (2344/2536/2538), an async @returns that is not Promise
|
|
66
|
+
// (1064), and 2366's no-ending-return against a JSDoc-declared return
|
|
67
|
+
// type. The claims are documentation — Node never reads them; the
|
|
68
|
+
// values keep their runtime behavior and every use meets the per-site
|
|
69
|
+
// fences (the pattern's source carries dozens of each).
|
|
70
|
+
2749, 2702, 2344, 2536, 2538, 1064, 2366,
|
|
71
|
+
// strict-null demands on dynamic shapes, continued: iterating/invoking
|
|
72
|
+
// possibly-undefined values (runtime re-checks at the site)
|
|
73
|
+
2488, 2721, 2722,
|
|
74
|
+
// an UNUSED @ts-expect-error: the directive annotated an error visible
|
|
75
|
+
// under the project's OWN tsconfig world — scriptc's world deliberately
|
|
76
|
+
// differs (adopted options, hidden declaration twins), and an unused
|
|
77
|
+
// suppression changes nothing at runtime
|
|
78
|
+
2578,
|
|
79
|
+
// a lib-floor demand (es2024+ members under the es2023 lib): the member
|
|
80
|
+
// types as the error-any and its use fences per site with the honest
|
|
81
|
+
// no-lowering story instead of gating the whole program
|
|
82
|
+
2550,
|
|
83
|
+
// `export *` ambiguity (2308): Node DEFINES this case — ambiguous names
|
|
84
|
+
// are excluded from the star surface — where tsc asks for an explicit
|
|
85
|
+
// re-export; and 2305's did-you-mean sibling 2614 joins 2305
|
|
86
|
+
2308, 2614,
|
|
87
|
+
// 2740's sibling elaboration ("Property X is missing in type Y")
|
|
88
|
+
2741,
|
|
89
|
+
// unresolvable modules: Node throws WHEN the require executes — the
|
|
90
|
+
// binding types as any and reached uses fence (never a silent pass)
|
|
91
|
+
2307, 2792,
|
|
92
|
+
// useUnknownInCatchVariables' annotation demand ("'e' is of type
|
|
93
|
+
// 'unknown'", "Object is of type 'unknown'"): a JS catch clause CANNOT
|
|
94
|
+
// annotate its variable, so the demand is unsatisfiable in source —
|
|
95
|
+
// exactly the implicit-any story above. The values stay 'unknown' and
|
|
96
|
+
// every use meets the lowerer's per-site unknown fences (member reads
|
|
97
|
+
// ride the checked-dynamic tree; unsupported operations fence loudly).
|
|
98
|
+
18046, 2571,
|
|
99
|
+
]);
|
|
100
|
+
/* Arithmetic on an `any` operand (TS2362/2363/2365 fire when the other
|
|
101
|
+
* side is bigint-ish): plain JS — relaxed only when 'any' participates. */
|
|
102
|
+
export const JS_ANY_OPERATOR_CODES = new Set([2362, 2363, 2365]);
|
|
103
|
+
/** True for JavaScript source file NAMES (.js/.mjs/.cjs/.jsx) — the files
|
|
104
|
+
* whose types come entirely from inference (checkJs + JSDoc) and whose JS
|
|
105
|
+
* relaxation stance applies. */
|
|
106
|
+
export function isJsSourceFileName(fileName) {
|
|
107
|
+
return /\.(js|mjs|cjs|jsx)$/.test(fileName);
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=tsc-codes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tsc-codes.js","sourceRoot":"","sources":["../../src/frontend/tsc-codes.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,QAAQ;IACR,eAAe;IACf,kBAAkB;IAClB,qBAAqB;IACrB,qBAAqB;IACrB,8BAA8B;IAC9B,6BAA6B;IAC7B,gBAAgB;IAChB,cAAc;IACd,4BAA4B;IAC5B,0BAA0B;IAC1B,4BAA4B;IAC5B,oBAAoB;IACpB,oCAAoC;IACpC,mBAAmB;IACnB,4BAA4B;IAC5B,gBAAgB;IAChB,oBAAoB;IACpB,mBAAmB;IACnB,sBAAsB;IACtB,cAAc;IACd,iEAAiE;IACjE,qEAAqE;IACrE,kEAAkE;IAClE,kEAAkE;IAClE,iBAAiB;IACjB,8BAA8B;CACtB,CAAC;AAEX;;;;;;;;;;eAUe;AACf,MAAM,CAAC,MAAM,oBAAoB,GAAwB,IAAI,GAAG,CAAC;IAC/D,kEAAkE;IAClE,8DAA8D;IAC9D,iCAAiC;IACjC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IACxF,oEAAoE;IACpE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK;IACrC,oEAAoE;IACpE,uEAAuE;IACvE,qEAAqE;IACrE,qEAAqE;IACrE,mCAAmC;IACnC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAC1D,IAAI,EAAE,4DAA4D;IAClE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IACtB,uEAAuE;IACvE,wEAAwE;IACxE,4EAA4E;IAC5E,oEAAoE;IACpE,kBAAkB;IAClB,IAAI,EAAE,IAAI;IACV,qEAAqE;IACrE,uEAAuE;IACvE,mEAAmE;IACnE,sEAAsE;IACtE,kEAAkE;IAClE,sEAAsE;IACtE,wDAAwD;IACxD,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IACxC,uEAAuE;IACvE,4DAA4D;IAC5D,IAAI,EAAE,IAAI,EAAE,IAAI;IAChB,uEAAuE;IACvE,wEAAwE;IACxE,qEAAqE;IACrE,yCAAyC;IACzC,IAAI;IACJ,wEAAwE;IACxE,qEAAqE;IACrE,wDAAwD;IACxD,IAAI;IACJ,wEAAwE;IACxE,sEAAsE;IACtE,6DAA6D;IAC7D,IAAI,EAAE,IAAI;IACV,iEAAiE;IACjE,IAAI;IACJ,oEAAoE;IACpE,oEAAoE;IACpE,IAAI,EAAE,IAAI;IACV,iEAAiE;IACjE,uEAAuE;IACvE,oEAAoE;IACpE,sEAAsE;IACtE,sEAAsE;IACtE,uEAAuE;IACvE,KAAK,EAAE,IAAI;CACZ,CAAC,CAAC;AAEH;2EAC2E;AAC3E,MAAM,CAAC,MAAM,qBAAqB,GAAwB,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAEtF;;gCAEgC;AAChC,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IACjD,OAAO,qBAAqB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as ts from "./ts7/adapter.js";
|
|
2
|
-
import type { IrRecordShape, IrType, IrUnionDef } from "../ir/
|
|
3
|
-
import { typeKey } from "../ir/
|
|
2
|
+
import type { IrRecordShape, IrType, IrUnionDef } from "../ir/ir.js";
|
|
3
|
+
import { typeKey } from "../ir/ir.js";
|
|
4
4
|
export { typeKey };
|
|
5
5
|
/** The ambient TYPE names of the fetch slice. Under --dynamic their
|
|
6
6
|
* values live in the embedded engine and map to island handles (jsval).
|
|
@@ -158,16 +158,6 @@ export declare class UnionRegistry {
|
|
|
158
158
|
* can't — it never sees IR types). `seen` breaks recursive shapes/unions:
|
|
159
159
|
* a back-reference renders as "..." instead of expanding forever. */
|
|
160
160
|
export declare function formatIrType(t: IrType, shapes: ShapeRegistry, unions: UnionRegistry, seen?: Set<string>): string;
|
|
161
|
-
/** True when the declaration sits inside `declare module "<name>"` (or
|
|
162
|
-
* its node:-prefixed twin) — the disambiguator for builtin-module type
|
|
163
|
-
* names that repeat across modules (net.Server vs http.Server). Both
|
|
164
|
-
* @types/node and the shipped fallback declare builtins this way. */
|
|
165
|
-
/** ES OrdinaryOwnPropertyKeys order over string keys: canonical array
|
|
166
|
-
* indices (the exact string spelling of an integer in [0, 2^32-1)) come
|
|
167
|
-
* first in ascending numeric order, everything else follows in the given
|
|
168
|
-
* (insertion/declaration) order. This is JS's enumeration order for the
|
|
169
|
-
* objects records model — Object.keys, JSON.stringify, spread, inspect. */
|
|
170
|
-
export declare function esOwnKeyOrder(names: string[]): string[];
|
|
171
161
|
/** True when a type contains a record anywhere (the trigger for the
|
|
172
162
|
* shape-mismatch diagnostic SC2002 — non-record mismatches are tsc's or
|
|
173
163
|
* the validator's business). */
|
|
@@ -354,19 +344,6 @@ export declare function withUndefinedArm(t: IrType, unions: UnionRegistry): IrTy
|
|
|
354
344
|
* Object.keys over such a shape omits the member (a pin — every excluded
|
|
355
345
|
* member is a function the key walk would name). */
|
|
356
346
|
export declare function isGenericCallableMemberType(t: ts.Type, checker: ts.TypeChecker): boolean;
|
|
357
|
-
/** The `string | object`-family collapse domain (mapTypeInner's union
|
|
358
|
-
* rule): arms the checked-dynamic representation holds FAITHFULLY, so a
|
|
359
|
-
* union carrying a dyn arm beside only these maps to DYN wholesale.
|
|
360
|
-
* Scalars and units are the checked-dynamic tree's own kinds (value-exact ===/typeof);
|
|
361
|
-
* records and arrays qualify exactly when the dynFrom conversion can
|
|
362
|
-
* build them (canConvertToDyn — JSON-safe data plus bytes-bearing
|
|
363
|
-
* composites), entering as dyn data under the documented deep-copy
|
|
364
|
-
* stance. Everything else — class instances, Maps/Sets, functions
|
|
365
|
-
* (closure identity and `x === String` narrowing live in the typed union
|
|
366
|
-
* machinery), promises, regexes, generators, handles, nested unions —
|
|
367
|
-
* would DEGRADE (identity, methods, dispatch) riding dyn, so those arms
|
|
368
|
-
* keep their existing homes and fences. */
|
|
369
|
-
export declare function dynSubsumableUnionArm(arm: IrType, ctx: TypeMapperCtx): boolean;
|
|
370
347
|
/** When an unmapped type is a SUPPORTED container/composite whose failure
|
|
371
348
|
* lives in a component, answer a message tail naming the component (the
|
|
372
349
|
* SC2009 story); null when the shape itself is the blocker (the caller
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { InternalCompilerError } from "../errors.js";
|
|
1
2
|
import * as ts from "./ts7/adapter.js";
|
|
2
|
-
import { arrayOf, BOOL, bytesOf, canConvertToDyn, CHILD_T, DATE_T, DYN, F64, funcOf, isSupportedIndexValue, isSupportedMapKey, isSupportedMapValue, isSupportedSetElem, isUnitType, JSVAL, mapOf, NULL_T, PROCSTREAM_T, RUNTIME_EMITTER_CLASS, RUNTIME_ERROR_CLASSES, RUNTIME_STREAM_CLASSES, setOf, STRING, SYMBOL_T, typeEquals, typeKey, UNDEFINED_T, VOID } from "../ir/
|
|
3
|
+
import { arrayOf, BOOL, bytesOf, canConvertToDyn, CHILD_T, DATE_T, DYN, F64, funcOf, isSupportedArrayElem, isSupportedIndexValue, isSupportedMapKey, isSupportedMapValue, isSupportedSetElem, isUnitType, JSVAL, mapOf, NULL_T, PROCSTREAM_T, RUNTIME_EMITTER_CLASS, RUNTIME_ERROR_CLASSES, RUNTIME_STREAM_CLASSES, setOf, STRING, SYMBOL_T, typeEquals, typeKey, UNDEFINED_T, VOID } from "../ir/ir.js";
|
|
3
4
|
import { isJsSourceFile, isNodeTypesPath } from "./program.js";
|
|
4
|
-
import { accessorSlotProp } from "../ir/
|
|
5
|
-
// typeKey moved to ir/
|
|
5
|
+
import { accessorSlotProp } from "../ir/ir.js";
|
|
6
|
+
// typeKey moved to ir/ir.ts (the backend needs it too, for per-type
|
|
6
7
|
// helper interning); re-exported here so frontend call sites keep their
|
|
7
8
|
// import path.
|
|
8
9
|
export { typeKey };
|
|
@@ -226,7 +227,7 @@ export class ShapeRegistry {
|
|
|
226
227
|
finalizeRecursive(t, fields, indexValue, declaredOrder) {
|
|
227
228
|
const id = this.recIds.get(t);
|
|
228
229
|
if (id === undefined)
|
|
229
|
-
throw new
|
|
230
|
+
throw new InternalCompilerError("shape registry bug: finalizeRecursive without a placeholder");
|
|
230
231
|
if (this.pendingRec.has(id)) {
|
|
231
232
|
const shape = this.byId.get(id);
|
|
232
233
|
shape.fields = fields;
|
|
@@ -335,7 +336,7 @@ export class UnionRegistry {
|
|
|
335
336
|
finalizeRecursive(t, arms) {
|
|
336
337
|
const id = this.recIds.get(t);
|
|
337
338
|
if (id === undefined)
|
|
338
|
-
throw new
|
|
339
|
+
throw new InternalCompilerError("union registry bug: finalizeRecursive without a placeholder");
|
|
339
340
|
if (this.pendingRec.has(id)) {
|
|
340
341
|
const def = this.byId.get(id);
|
|
341
342
|
def.arms.push(...arms);
|
|
@@ -512,7 +513,7 @@ export function formatIrType(t, shapes, unions, seen = new Set()) {
|
|
|
512
513
|
default: {
|
|
513
514
|
const _exhaustive = t;
|
|
514
515
|
void _exhaustive;
|
|
515
|
-
throw new
|
|
516
|
+
throw new InternalCompilerError("unreachable");
|
|
516
517
|
}
|
|
517
518
|
}
|
|
518
519
|
}
|
|
@@ -525,7 +526,7 @@ export function formatIrType(t, shapes, unions, seen = new Set()) {
|
|
|
525
526
|
* first in ascending numeric order, everything else follows in the given
|
|
526
527
|
* (insertion/declaration) order. This is JS's enumeration order for the
|
|
527
528
|
* objects records model — Object.keys, JSON.stringify, spread, inspect. */
|
|
528
|
-
|
|
529
|
+
function esOwnKeyOrder(names) {
|
|
529
530
|
const isArrayIndex = (name) => {
|
|
530
531
|
const n = Number(name);
|
|
531
532
|
return Number.isInteger(n) && n >= 0 && n < 4294967295 && String(n) === name;
|
|
@@ -590,7 +591,7 @@ export function containsUnion(t) {
|
|
|
590
591
|
return false;
|
|
591
592
|
}
|
|
592
593
|
}
|
|
593
|
-
/** lower-calls.ts's bodyReadsArguments, duplicated here (
|
|
594
|
+
/** lower-calls.ts's bodyReadsArguments, duplicated here (type-mapper.ts must not
|
|
594
595
|
* import from lowering/ — that edge is a module cycle): does the function's
|
|
595
596
|
* OWN body read `arguments`? Nested plain functions/methods own theirs
|
|
596
597
|
* (skipped); arrows see the enclosing one (descended). */
|
|
@@ -886,7 +887,7 @@ function mapTypeInner(type, ctx) {
|
|
|
886
887
|
// falls through to the general union branch below, whose per-part
|
|
887
888
|
// recursion re-enters here with the pure enum parts.
|
|
888
889
|
if (flags & ts.TypeFlags.EnumLike) {
|
|
889
|
-
const parts = widened.isUnionType() ?
|
|
890
|
+
const parts = widened.isUnionType() ? ts.constituentTypes(widened) : [widened];
|
|
890
891
|
if (parts.every((p) => p.flags & ts.TypeFlags.EnumLike)) {
|
|
891
892
|
let hasNum = false;
|
|
892
893
|
let hasStr = false;
|
|
@@ -982,35 +983,8 @@ function mapTypeInner(type, ctx) {
|
|
|
982
983
|
// keeps its static array-of-handles representation.
|
|
983
984
|
if (elem?.kind === "jsval" && !(elemTs.flags & ts.TypeFlags.Any))
|
|
984
985
|
return JSVAL;
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
// idiom `[bases].map(ps => new RegExp(...))` builds real regex
|
|
988
|
-
// arrays, elements flow into the regex intrinsics unchanged, and
|
|
989
|
-
// indexOf/includes/=== are the REF kind's pointer identity — exactly
|
|
990
|
-
// JS object identity for RegExp values.
|
|
991
|
-
if (!elem ||
|
|
992
|
-
elem.kind === "void" ||
|
|
993
|
-
elem.kind === "date" ||
|
|
994
|
-
elem.kind === "map" ||
|
|
995
|
-
elem.kind === "set" ||
|
|
996
|
-
elem.kind === "url" ||
|
|
997
|
-
elem.kind === "searchParams" ||
|
|
998
|
-
elem.kind === "stats" ||
|
|
999
|
-
elem.kind === "fileHandle" ||
|
|
1000
|
-
elem.kind === "spawnRes" ||
|
|
1001
|
-
elem.kind === "netSocket" ||
|
|
1002
|
-
elem.kind === "dgramSocket" ||
|
|
1003
|
-
elem.kind === "testCtx" ||
|
|
1004
|
-
elem.kind === "httpReq" ||
|
|
1005
|
-
elem.kind === "httpRes" ||
|
|
1006
|
-
elem.kind === "httpClientReq" ||
|
|
1007
|
-
elem.kind === "secureCtx" ||
|
|
1008
|
-
elem.kind === "fsWatcher" ||
|
|
1009
|
-
elem.kind === "childStream" ||
|
|
1010
|
-
elem.kind === "procStream" ||
|
|
1011
|
-
elem.kind === "generator") {
|
|
1012
|
-
return null; // ScrArr has no closure/map/regex/url element kinds yet
|
|
1013
|
-
}
|
|
986
|
+
if (!elem)
|
|
987
|
+
return null;
|
|
1014
988
|
// A dyn ELEMENT makes the WHOLE array the checked-dynamic value:
|
|
1015
989
|
// `unknown[]`, `object[]`, and the collapsed `(string | object)[]`
|
|
1016
990
|
// (the plugins-slot shape) — the checked-dynamic tree has real arrays, so length/
|
|
@@ -1021,6 +995,11 @@ function mapTypeInner(type, ctx) {
|
|
|
1021
995
|
// array literal) and typed sources convert per element at the slot.
|
|
1022
996
|
if (elem.kind === "dyn")
|
|
1023
997
|
return DYN;
|
|
998
|
+
// The shared predicate is the runtime/backend storage contract. In
|
|
999
|
+
// particular, valid standalone values such as Map/Set/Date and opaque
|
|
1000
|
+
// handles do not automatically have an array element representation.
|
|
1001
|
+
if (!isSupportedArrayElem(elem))
|
|
1002
|
+
return null;
|
|
1024
1003
|
// ChildProcess[] (the running-apps list) and Server[] (the [...set]
|
|
1025
1004
|
// drain of the auxiliary-server registries): handles are ordinary
|
|
1026
1005
|
// refcounted REF elements (their `_v` adapters, no trace — both drop
|
|
@@ -1112,7 +1091,7 @@ function mapTypeInner(type, ctx) {
|
|
|
1112
1091
|
]);
|
|
1113
1092
|
let handle = null;
|
|
1114
1093
|
let refined = true;
|
|
1115
|
-
for (const part of
|
|
1094
|
+
for (const part of ts.constituentTypes(widened)) {
|
|
1116
1095
|
const mapped = mapType(part, ctx);
|
|
1117
1096
|
if (mapped && HANDLE_KINDS.has(mapped.kind)) {
|
|
1118
1097
|
if (handle !== null && handle.kind !== mapped.kind) {
|
|
@@ -2295,7 +2274,7 @@ function mapTypeInner(type, ctx) {
|
|
|
2295
2274
|
const sensitivityAtEntry = contextResolutions;
|
|
2296
2275
|
try {
|
|
2297
2276
|
const byKey = new Map();
|
|
2298
|
-
for (const part of
|
|
2277
|
+
for (const part of ts.constituentTypes(widened)) {
|
|
2299
2278
|
// A `void` PART is inhabited only by undefined (`Promise<void> |
|
|
2300
2279
|
// void` return types, `string | void`): it becomes the undefinedT
|
|
2301
2280
|
// unit arm, exactly like an undefined part — the value either
|
|
@@ -2324,7 +2303,7 @@ function mapTypeInner(type, ctx) {
|
|
|
2324
2303
|
return JSVAL;
|
|
2325
2304
|
if (!mapped) {
|
|
2326
2305
|
// Before failing the whole union, let a LATER jsval part absorb.
|
|
2327
|
-
for (const rest of
|
|
2306
|
+
for (const rest of ts.constituentTypes(widened)) {
|
|
2328
2307
|
if (mapType(rest, ctx)?.kind === "jsval")
|
|
2329
2308
|
return JSVAL;
|
|
2330
2309
|
}
|
|
@@ -2442,13 +2421,13 @@ function mapNarrowedTypeParam(type, ctx) {
|
|
|
2442
2421
|
return (allowNull = true);
|
|
2443
2422
|
// A companion UNION (`T & ({} | null)`): each part is an allowance.
|
|
2444
2423
|
if (c.isUnionType())
|
|
2445
|
-
return
|
|
2424
|
+
return ts.constituentTypes(c).every(visitCompanion);
|
|
2446
2425
|
return false;
|
|
2447
2426
|
};
|
|
2448
2427
|
const visitPart = (part) => {
|
|
2449
2428
|
if (!part.isIntersectionType())
|
|
2450
2429
|
return false;
|
|
2451
|
-
for (const p of
|
|
2430
|
+
for (const p of ts.constituentTypes(part)) {
|
|
2452
2431
|
if (p.flags & ts.TypeFlags.TypeParameter) {
|
|
2453
2432
|
if (tp && tp !== p)
|
|
2454
2433
|
return false; // two different parameters: not this pattern
|
|
@@ -2460,7 +2439,7 @@ function mapNarrowedTypeParam(type, ctx) {
|
|
|
2460
2439
|
}
|
|
2461
2440
|
return true;
|
|
2462
2441
|
};
|
|
2463
|
-
const parts = type.isUnionType() ?
|
|
2442
|
+
const parts = type.isUnionType() ? ts.constituentTypes(type) : [type];
|
|
2464
2443
|
if (!parts.every(visitPart) || !tp)
|
|
2465
2444
|
return undefined;
|
|
2466
2445
|
const bound = resolveTypeParam(tp);
|
|
@@ -2765,7 +2744,7 @@ export function genResultRecord(yieldT, retT, shapes, unions) {
|
|
|
2765
2744
|
* a value). */
|
|
2766
2745
|
export function isUnitOnlyTsType(t) {
|
|
2767
2746
|
const UNIT = ts.TypeFlags.Undefined | ts.TypeFlags.Void | ts.TypeFlags.Null;
|
|
2768
|
-
const parts = t.isUnionType() ?
|
|
2747
|
+
const parts = t.isUnionType() ? ts.constituentTypes(t) : [t];
|
|
2769
2748
|
return parts.every((p) => (p.flags & UNIT) !== 0);
|
|
2770
2749
|
}
|
|
2771
2750
|
/** IR-level `t | undefined`, canonicalized and fenced exactly like the
|
|
@@ -2814,7 +2793,7 @@ function mapHybridCallableIntersection(widened, ctx) {
|
|
|
2814
2793
|
if (checker.getCallSignatures(widened).length !== 1)
|
|
2815
2794
|
return null;
|
|
2816
2795
|
let funcPart = null;
|
|
2817
|
-
for (const part of
|
|
2796
|
+
for (const part of ts.constituentTypes(widened)) {
|
|
2818
2797
|
if (checker.getCallSignatures(part).length > 0) {
|
|
2819
2798
|
if (funcPart)
|
|
2820
2799
|
return null; // exactly one callable part
|
|
@@ -2872,7 +2851,7 @@ function isMappedShape(t) {
|
|
|
2872
2851
|
function recordProvenanceOk(t, ctx) {
|
|
2873
2852
|
const { checker } = ctx;
|
|
2874
2853
|
if (t.isIntersectionType()) {
|
|
2875
|
-
return
|
|
2854
|
+
return ts.constituentTypes(t).every((part) => {
|
|
2876
2855
|
const partSym = part.getSymbol();
|
|
2877
2856
|
return (part.flags & ts.TypeFlags.Object) !== 0 &&
|
|
2878
2857
|
!(partSym && partSym.flags & ts.SymbolFlags.Class) &&
|
|
@@ -2999,7 +2978,7 @@ function mapRecordTypeInner(widened, ctx) {
|
|
|
2999
2978
|
if (indexInfos.length > 0) {
|
|
3000
2979
|
const stringKey = (k) => (k.flags & ts.TypeFlags.String) !== 0 ||
|
|
3001
2980
|
(k.isIntersectionType() &&
|
|
3002
|
-
|
|
2981
|
+
ts.constituentTypes(k).every((p) => (p.flags & ts.TypeFlags.String) !== 0 ||
|
|
3003
2982
|
((p.flags & ts.TypeFlags.Object) !== 0 &&
|
|
3004
2983
|
checker.getPropertiesOfType(p).length === 0 &&
|
|
3005
2984
|
checker.getCallSignatures(p).length === 0 &&
|
|
@@ -3123,7 +3102,7 @@ function mapRecordTypeInner(widened, ctx) {
|
|
|
3123
3102
|
// OBJECT-LITERAL get/set accessors (TS sources): the property has
|
|
3124
3103
|
// no data slot — the shape carries reserved closure fields instead
|
|
3125
3104
|
// (`%get:x` invoked per read, `%set:x` per write; see
|
|
3126
|
-
// accessorSlotProp in ir/
|
|
3105
|
+
// accessorSlotProp in ir/ir.ts). Type-literal and interface
|
|
3127
3106
|
// accessor MEMBERS map the same way so accessor records cross
|
|
3128
3107
|
// annotated boundaries (`function f(p: { get x(): number })`) —
|
|
3129
3108
|
// tsc lets a plain DATA property satisfy such a member, but the
|
|
@@ -3283,7 +3262,7 @@ const STDLIB_CONTAINERS = {
|
|
|
3283
3262
|
* machinery), promises, regexes, generators, handles, nested unions —
|
|
3284
3263
|
* would DEGRADE (identity, methods, dispatch) riding dyn, so those arms
|
|
3285
3264
|
* keep their existing homes and fences. */
|
|
3286
|
-
|
|
3265
|
+
function dynSubsumableUnionArm(arm, ctx) {
|
|
3287
3266
|
switch (arm.kind) {
|
|
3288
3267
|
case "dyn":
|
|
3289
3268
|
case "f64":
|
|
@@ -3392,7 +3371,7 @@ export function describeComponentBlocker(widened, ctx) {
|
|
|
3392
3371
|
// arm kind with no union home. Unions have no symbol, so a null answer
|
|
3393
3372
|
// falls through to the residual fence, never to a false lib claim.
|
|
3394
3373
|
if (widened.isUnionType()) {
|
|
3395
|
-
const parts =
|
|
3374
|
+
const parts = ts.constituentTypes(widened);
|
|
3396
3375
|
const UNIT = ts.TypeFlags.Undefined | ts.TypeFlags.Void | ts.TypeFlags.Null;
|
|
3397
3376
|
const dataArms = parts.filter((p) => (p.flags & UNIT) === 0);
|
|
3398
3377
|
// A union carrying an 'object'/'unknown'-flavored arm rides the
|
|
@@ -3505,4 +3484,4 @@ export function describeRecordMemberBlocker(widened, ctx) {
|
|
|
3505
3484
|
}
|
|
3506
3485
|
return null;
|
|
3507
3486
|
}
|
|
3508
|
-
//# sourceMappingURL=
|
|
3487
|
+
//# sourceMappingURL=type-mapper.js.map
|