@geastack/compiler 1.0.15
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/LICENSE +202 -0
- package/README.md +149 -0
- package/dist/cli-analyze.d.ts +1 -0
- package/dist/cli-analyze.js +61 -0
- package/dist/cli-coverage.d.ts +1 -0
- package/dist/cli-coverage.js +329 -0
- package/dist/cli-emit.d.ts +10 -0
- package/dist/cli-emit.js +398 -0
- package/dist/cli-module-graph.d.ts +18 -0
- package/dist/cli-module-graph.js +123 -0
- package/dist/cli-package-source.d.ts +5 -0
- package/dist/cli-package-source.js +116 -0
- package/dist/cli-project.d.ts +2 -0
- package/dist/cli-project.js +60 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +199 -0
- package/dist/compiler.d.ts +228 -0
- package/dist/compiler.js +1029 -0
- package/dist/conversion/algebra.d.ts +218 -0
- package/dist/conversion/algebra.js +155 -0
- package/dist/conversion/build.d.ts +67 -0
- package/dist/conversion/build.js +1378 -0
- package/dist/conversion/derive.d.ts +37 -0
- package/dist/conversion/derive.js +260 -0
- package/dist/conversion/graph-validation.d.ts +8 -0
- package/dist/conversion/graph-validation.js +97 -0
- package/dist/conversion/native-callable-adapter.d.ts +13 -0
- package/dist/conversion/native-callable-adapter.js +53 -0
- package/dist/conversion/native-class-reference.d.ts +12 -0
- package/dist/conversion/native-class-reference.js +39 -0
- package/dist/conversion/native-payload-transport.d.ts +25 -0
- package/dist/conversion/native-payload-transport.js +33 -0
- package/dist/conversion/native-selection.d.ts +49 -0
- package/dist/conversion/native-selection.js +135 -0
- package/dist/conversion/native-sum.d.ts +42 -0
- package/dist/conversion/native-sum.js +115 -0
- package/dist/conversion/nodes.d.ts +55 -0
- package/dist/conversion/nodes.js +91 -0
- package/dist/conversion/operand-view.d.ts +14 -0
- package/dist/conversion/operand-view.js +20 -0
- package/dist/conversion/record-view.d.ts +157 -0
- package/dist/conversion/record-view.js +273 -0
- package/dist/conversion/registry.d.ts +217 -0
- package/dist/conversion/registry.js +1 -0
- package/dist/diagnostics/model.d.ts +76 -0
- package/dist/diagnostics/model.js +60 -0
- package/dist/diagnostics/sweep.d.ts +31 -0
- package/dist/diagnostics/sweep.js +112 -0
- package/dist/identity/ids.d.ts +179 -0
- package/dist/identity/ids.js +212 -0
- package/dist/ir/absent-class-arm.d.ts +48 -0
- package/dist/ir/absent-class-arm.js +157 -0
- package/dist/ir/borrow-effects.d.ts +23 -0
- package/dist/ir/borrow-effects.js +151 -0
- package/dist/ir/borrowed-call-arguments.d.ts +40 -0
- package/dist/ir/borrowed-call-arguments.js +117 -0
- package/dist/ir/build.d.ts +168 -0
- package/dist/ir/build.js +459 -0
- package/dist/ir/call-dispatch.d.ts +38 -0
- package/dist/ir/call-dispatch.js +502 -0
- package/dist/ir/call-entry.d.ts +142 -0
- package/dist/ir/call-entry.js +386 -0
- package/dist/ir/callable-class-flow.d.ts +27 -0
- package/dist/ir/callable-class-flow.js +1386 -0
- package/dist/ir/callable-field-slots.d.ts +22 -0
- package/dist/ir/callable-field-slots.js +166 -0
- package/dist/ir/callable-identity-demand.d.ts +52 -0
- package/dist/ir/callable-identity-demand.js +460 -0
- package/dist/ir/callable-member-candidates.d.ts +9 -0
- package/dist/ir/callable-member-candidates.js +39 -0
- package/dist/ir/callable-records.d.ts +21 -0
- package/dist/ir/callable-records.js +411 -0
- package/dist/ir/captures.d.ts +26 -0
- package/dist/ir/captures.js +335 -0
- package/dist/ir/certificate.d.ts +45 -0
- package/dist/ir/certificate.js +47 -0
- package/dist/ir/certify/carrier-keys.d.ts +73 -0
- package/dist/ir/certify/carrier-keys.js +221 -0
- package/dist/ir/certify/function-source.d.ts +4 -0
- package/dist/ir/certify/function-source.js +28 -0
- package/dist/ir/certify/has-property-key.d.ts +88 -0
- package/dist/ir/certify/has-property-key.js +116 -0
- package/dist/ir/certify/instanceof-key.d.ts +24 -0
- package/dist/ir/certify/instanceof-key.js +35 -0
- package/dist/ir/certify/property-access-keys.d.ts +172 -0
- package/dist/ir/certify/property-access-keys.js +291 -0
- package/dist/ir/certify/property-access.d.ts +3 -0
- package/dist/ir/certify/property-access.js +597 -0
- package/dist/ir/certify/runtime-helper.d.ts +3 -0
- package/dist/ir/certify/runtime-helper.js +326 -0
- package/dist/ir/certify/typeof-operand.d.ts +14 -0
- package/dist/ir/certify/typeof-operand.js +16 -0
- package/dist/ir/certify.d.ts +123 -0
- package/dist/ir/certify.js +481 -0
- package/dist/ir/class-evaluation.d.ts +26 -0
- package/dist/ir/class-evaluation.js +50 -0
- package/dist/ir/class-static-fields.d.ts +60 -0
- package/dist/ir/class-static-fields.js +108 -0
- package/dist/ir/construct-entry.d.ts +26 -0
- package/dist/ir/construct-entry.js +117 -0
- package/dist/ir/dead-values.d.ts +90 -0
- package/dist/ir/dead-values.js +184 -0
- package/dist/ir/deferral.d.ts +99 -0
- package/dist/ir/deferral.js +409 -0
- package/dist/ir/dense-loops.d.ts +230 -0
- package/dist/ir/dense-loops.js +697 -0
- package/dist/ir/dominance.d.ts +82 -0
- package/dist/ir/dominance.js +268 -0
- package/dist/ir/emission-representations.d.ts +71 -0
- package/dist/ir/emission-representations.js +350 -0
- package/dist/ir/facts.d.ts +218 -0
- package/dist/ir/facts.js +181 -0
- package/dist/ir/fixed-data-definition.d.ts +19 -0
- package/dist/ir/fixed-data-definition.js +49 -0
- package/dist/ir/generator-split.d.ts +38 -0
- package/dist/ir/generator-split.js +329 -0
- package/dist/ir/hoist.d.ts +55 -0
- package/dist/ir/hoist.js +375 -0
- package/dist/ir/instantiation.d.ts +61 -0
- package/dist/ir/instantiation.js +137 -0
- package/dist/ir/integer-storage.d.ts +170 -0
- package/dist/ir/integer-storage.js +822 -0
- package/dist/ir/integers.d.ts +161 -0
- package/dist/ir/integers.js +539 -0
- package/dist/ir/integrity-restrictions.d.ts +50 -0
- package/dist/ir/integrity-restrictions.js +118 -0
- package/dist/ir/local-iterators.d.ts +4 -0
- package/dist/ir/local-iterators.js +27 -0
- package/dist/ir/lower-allocation.d.ts +4 -0
- package/dist/ir/lower-allocation.js +325 -0
- package/dist/ir/lower-completion.d.ts +15 -0
- package/dist/ir/lower-completion.js +25 -0
- package/dist/ir/lower-destructuring.d.ts +5 -0
- package/dist/ir/lower-destructuring.js +693 -0
- package/dist/ir/lower-element.d.ts +29 -0
- package/dist/ir/lower-element.js +111 -0
- package/dist/ir/lower-exceptions.d.ts +47 -0
- package/dist/ir/lower-exceptions.js +92 -0
- package/dist/ir/lower-flow.d.ts +137 -0
- package/dist/ir/lower-flow.js +600 -0
- package/dist/ir/lower-graph.d.ts +218 -0
- package/dist/ir/lower-graph.js +687 -0
- package/dist/ir/lower-invocation.d.ts +4 -0
- package/dist/ir/lower-invocation.js +514 -0
- package/dist/ir/lower-narrow.d.ts +53 -0
- package/dist/ir/lower-narrow.js +320 -0
- package/dist/ir/lower-operands.d.ts +272 -0
- package/dist/ir/lower-operands.js +461 -0
- package/dist/ir/lower-property.d.ts +21 -0
- package/dist/ir/lower-property.js +132 -0
- package/dist/ir/lower-protocol.d.ts +11 -0
- package/dist/ir/lower-protocol.js +118 -0
- package/dist/ir/lower-short-circuit.d.ts +41 -0
- package/dist/ir/lower-short-circuit.js +63 -0
- package/dist/ir/lower.d.ts +82 -0
- package/dist/ir/lower.js +1346 -0
- package/dist/ir/model.d.ts +1474 -0
- package/dist/ir/model.js +6 -0
- package/dist/ir/native-absent-property.d.ts +3 -0
- package/dist/ir/native-absent-property.js +13 -0
- package/dist/ir/native-array-transport.d.ts +7 -0
- package/dist/ir/native-array-transport.js +46 -0
- package/dist/ir/native-callable-bind.d.ts +9 -0
- package/dist/ir/native-callable-bind.js +30 -0
- package/dist/ir/native-carrier-predicate.d.ts +34 -0
- package/dist/ir/native-carrier-predicate.js +49 -0
- package/dist/ir/native-class-accessor.d.ts +18 -0
- package/dist/ir/native-class-accessor.js +52 -0
- package/dist/ir/native-class-construction.d.ts +16 -0
- package/dist/ir/native-class-construction.js +71 -0
- package/dist/ir/native-class-initialization.d.ts +15 -0
- package/dist/ir/native-class-initialization.js +56 -0
- package/dist/ir/native-class-origins.d.ts +13 -0
- package/dist/ir/native-class-origins.js +237 -0
- package/dist/ir/native-dictionary-transport.d.ts +6 -0
- package/dist/ir/native-dictionary-transport.js +37 -0
- package/dist/ir/native-enumeration.d.ts +14 -0
- package/dist/ir/native-enumeration.js +26 -0
- package/dist/ir/native-equality.d.ts +10 -0
- package/dist/ir/native-equality.js +18 -0
- package/dist/ir/native-field-owner.d.ts +37 -0
- package/dist/ir/native-field-owner.js +183 -0
- package/dist/ir/native-fixed-layout.d.ts +41 -0
- package/dist/ir/native-fixed-layout.js +232 -0
- package/dist/ir/native-host-construction.d.ts +53 -0
- package/dist/ir/native-host-construction.js +62 -0
- package/dist/ir/native-key-query.d.ts +4 -0
- package/dist/ir/native-key-query.js +38 -0
- package/dist/ir/native-merge-transport.d.ts +25 -0
- package/dist/ir/native-merge-transport.js +71 -0
- package/dist/ir/native-record-index-transport.d.ts +11 -0
- package/dist/ir/native-record-index-transport.js +34 -0
- package/dist/ir/native-record-index.d.ts +12 -0
- package/dist/ir/native-record-index.js +27 -0
- package/dist/ir/native-reflect-field.d.ts +5 -0
- package/dist/ir/native-reflect-field.js +33 -0
- package/dist/ir/native-sequence-transport.d.ts +7 -0
- package/dist/ir/native-sequence-transport.js +53 -0
- package/dist/ir/numeric-intrinsics.d.ts +13 -0
- package/dist/ir/numeric-intrinsics.js +57 -0
- package/dist/ir/object-value-conversions.d.ts +20 -0
- package/dist/ir/object-value-conversions.js +50 -0
- package/dist/ir/physical-class-reflection.d.ts +9 -0
- package/dist/ir/physical-class-reflection.js +57 -0
- package/dist/ir/presence-proof.d.ts +42 -0
- package/dist/ir/presence-proof.js +490 -0
- package/dist/ir/program-facts.d.ts +106 -0
- package/dist/ir/program-facts.js +319 -0
- package/dist/ir/proven-branches.d.ts +16 -0
- package/dist/ir/proven-branches.js +219 -0
- package/dist/ir/queries.d.ts +41 -0
- package/dist/ir/queries.js +213 -0
- package/dist/ir/reflection-demand.d.ts +64 -0
- package/dist/ir/reflection-demand.js +1394 -0
- package/dist/ir/refusal.d.ts +43 -0
- package/dist/ir/refusal.js +28 -0
- package/dist/ir/shake.d.ts +37 -0
- package/dist/ir/shake.js +1078 -0
- package/dist/ir/static-callables.d.ts +11 -0
- package/dist/ir/static-callables.js +163 -0
- package/dist/ir/string-layout-reuse.d.ts +13 -0
- package/dist/ir/string-layout-reuse.js +39 -0
- package/dist/ir/string-length-reuse.d.ts +8 -0
- package/dist/ir/string-length-reuse.js +47 -0
- package/dist/ir/transfer.d.ts +78 -0
- package/dist/ir/transfer.js +270 -0
- package/dist/ir/type-query-results.d.ts +25 -0
- package/dist/ir/type-query-results.js +96 -0
- package/dist/ir/typed-property-access.d.ts +100 -0
- package/dist/ir/typed-property-access.js +161 -0
- package/dist/ir/verify.d.ts +19 -0
- package/dist/ir/verify.js +355 -0
- package/dist/plugins/apple/constructors.d.ts +112 -0
- package/dist/plugins/apple/constructors.js +217 -0
- package/dist/plugins/apple/host.d.ts +181 -0
- package/dist/plugins/apple/host.js +262 -0
- package/dist/plugins/apple/jsx.d.ts +2 -0
- package/dist/plugins/apple/jsx.js +293 -0
- package/dist/plugins/apple/members.d.ts +16 -0
- package/dist/plugins/apple/members.js +190 -0
- package/dist/plugins/apple/plugin.d.ts +2 -0
- package/dist/plugins/apple/plugin.js +156 -0
- package/dist/plugins/gea/component-classes.d.ts +25 -0
- package/dist/plugins/gea/component-classes.js +162 -0
- package/dist/plugins/gea/component-inline.d.ts +13 -0
- package/dist/plugins/gea/component-inline.js +532 -0
- package/dist/plugins/gea/constructors.d.ts +23 -0
- package/dist/plugins/gea/constructors.js +100 -0
- package/dist/plugins/gea/contract.d.ts +150 -0
- package/dist/plugins/gea/contract.js +195 -0
- package/dist/plugins/gea/element-ref.d.ts +31 -0
- package/dist/plugins/gea/element-ref.js +45 -0
- package/dist/plugins/gea/host.d.ts +520 -0
- package/dist/plugins/gea/host.js +762 -0
- package/dist/plugins/gea/lower.d.ts +6 -0
- package/dist/plugins/gea/lower.js +195 -0
- package/dist/plugins/gea/members.d.ts +22 -0
- package/dist/plugins/gea/members.js +221 -0
- package/dist/plugins/gea/plugin.d.ts +22 -0
- package/dist/plugins/gea/plugin.js +307 -0
- package/dist/plugins/gea/prelude.d.ts +78 -0
- package/dist/plugins/gea/prelude.js +153 -0
- package/dist/plugins/gea/producer.d.ts +5 -0
- package/dist/plugins/gea/producer.js +52 -0
- package/dist/plugins/gea/reactive-slots.d.ts +49 -0
- package/dist/plugins/gea/reactive-slots.js +578 -0
- package/dist/plugins/gea/render-bridge.d.ts +6 -0
- package/dist/plugins/gea/render-bridge.js +281 -0
- package/dist/plugins/gea/slots.d.ts +15 -0
- package/dist/plugins/gea/slots.js +36 -0
- package/dist/plugins/gea/template-analysis.d.ts +151 -0
- package/dist/plugins/gea/template-analysis.js +346 -0
- package/dist/plugins/gea/user-agent-styles.d.ts +9 -0
- package/dist/plugins/gea/user-agent-styles.js +94 -0
- package/dist/plugins/installed.d.ts +19 -0
- package/dist/plugins/installed.js +21 -0
- package/dist/plugins/load.d.ts +7 -0
- package/dist/plugins/load.js +207 -0
- package/dist/plugins/model.d.ts +735 -0
- package/dist/plugins/model.js +47 -0
- package/dist/plugins/webgl/host.d.ts +77 -0
- package/dist/plugins/webgl/host.js +162 -0
- package/dist/plugins/webgl/plugin.d.ts +40 -0
- package/dist/plugins/webgl/plugin.js +99 -0
- package/dist/preflight/obligations.d.ts +206 -0
- package/dist/preflight/obligations.js +36 -0
- package/dist/preflight/report.d.ts +20 -0
- package/dist/preflight/report.js +61 -0
- package/dist/preflight/run.d.ts +39 -0
- package/dist/preflight/run.js +403 -0
- package/dist/project-preparation.d.ts +33 -0
- package/dist/project-preparation.js +314 -0
- package/dist/projection/abi.d.ts +82 -0
- package/dist/projection/abi.js +349 -0
- package/dist/projection/apply-arguments.d.ts +12 -0
- package/dist/projection/apply-arguments.js +20 -0
- package/dist/projection/bindings.d.ts +250 -0
- package/dist/projection/bindings.js +340 -0
- package/dist/projection/callee.d.ts +196 -0
- package/dist/projection/callee.js +444 -0
- package/dist/projection/class-property-presence.d.ts +28 -0
- package/dist/projection/class-property-presence.js +58 -0
- package/dist/projection/class-prototype.d.ts +5 -0
- package/dist/projection/class-prototype.js +23 -0
- package/dist/projection/class-storage.d.ts +26 -0
- package/dist/projection/class-storage.js +236 -0
- package/dist/projection/classes.d.ts +283 -0
- package/dist/projection/classes.js +944 -0
- package/dist/projection/coercions.d.ts +20 -0
- package/dist/projection/coercions.js +33 -0
- package/dist/projection/dispatch.d.ts +167 -0
- package/dist/projection/dispatch.js +379 -0
- package/dist/projection/fields.d.ts +123 -0
- package/dist/projection/fields.js +383 -0
- package/dist/projection/instance-test.d.ts +78 -0
- package/dist/projection/instance-test.js +156 -0
- package/dist/projection/slots.d.ts +146 -0
- package/dist/projection/slots.js +663 -0
- package/dist/projection/synthesized-abi.d.ts +61 -0
- package/dist/projection/synthesized-abi.js +94 -0
- package/dist/representation/array-index.d.ts +14 -0
- package/dist/representation/array-index.js +17 -0
- package/dist/representation/callable-object.d.ts +3 -0
- package/dist/representation/callable-object.js +6 -0
- package/dist/representation/collections.d.ts +84 -0
- package/dist/representation/collections.js +139 -0
- package/dist/representation/derive.d.ts +159 -0
- package/dist/representation/derive.js +2546 -0
- package/dist/representation/difference.d.ts +30 -0
- package/dist/representation/difference.js +240 -0
- package/dist/representation/field-descriptor-policy.d.ts +19 -0
- package/dist/representation/field-descriptor-policy.js +39 -0
- package/dist/representation/function-constructor.d.ts +13 -0
- package/dist/representation/function-constructor.js +9 -0
- package/dist/representation/host-abi.d.ts +32 -0
- package/dist/representation/host-abi.js +97 -0
- package/dist/representation/host-templates.d.ts +67 -0
- package/dist/representation/host-templates.js +94 -0
- package/dist/representation/intersection.d.ts +84 -0
- package/dist/representation/intersection.js +149 -0
- package/dist/representation/literal-destination.d.ts +43 -0
- package/dist/representation/literal-destination.js +133 -0
- package/dist/representation/merge.d.ts +18 -0
- package/dist/representation/merge.js +83 -0
- package/dist/representation/model.d.ts +1160 -0
- package/dist/representation/model.js +1019 -0
- package/dist/representation/numeric-index.d.ts +13 -0
- package/dist/representation/numeric-index.js +29 -0
- package/dist/representation/object-shape.d.ts +109 -0
- package/dist/representation/object-shape.js +123 -0
- package/dist/representation/optional.d.ts +12 -0
- package/dist/representation/optional.js +87 -0
- package/dist/representation/plan.d.ts +60 -0
- package/dist/representation/plan.js +78 -0
- package/dist/representation/policies.d.ts +589 -0
- package/dist/representation/policies.js +107 -0
- package/dist/representation/primitive-domain.d.ts +1 -0
- package/dist/representation/primitive-domain.js +1 -0
- package/dist/representation/primitives.d.ts +44 -0
- package/dist/representation/primitives.js +78 -0
- package/dist/representation/publish.d.ts +49 -0
- package/dist/representation/publish.js +648 -0
- package/dist/representation/record-fields.d.ts +96 -0
- package/dist/representation/record-fields.js +116 -0
- package/dist/representation/template-object.d.ts +11 -0
- package/dist/representation/template-object.js +26 -0
- package/dist/representation/union.d.ts +30 -0
- package/dist/representation/union.js +324 -0
- package/dist/representation/value-records.d.ts +3 -0
- package/dist/representation/value-records.js +307 -0
- package/dist/representation/verify.d.ts +17 -0
- package/dist/representation/verify.js +221 -0
- package/dist/semantics/alias-this-field-declaration-transform.d.ts +4 -0
- package/dist/semantics/alias-this-field-declaration-transform.js +207 -0
- package/dist/semantics/ambient-type-realization-transform.d.ts +62 -0
- package/dist/semantics/ambient-type-realization-transform.js +168 -0
- package/dist/semantics/ambient.d.ts +24 -0
- package/dist/semantics/ambient.js +119 -0
- package/dist/semantics/borrowed-builtin-call-bind-source-transform.d.ts +4 -0
- package/dist/semantics/borrowed-builtin-call-bind-source-transform.js +341 -0
- package/dist/semantics/callable-origins.d.ts +46 -0
- package/dist/semantics/callable-origins.js +354 -0
- package/dist/semantics/class-alias.d.ts +7 -0
- package/dist/semantics/class-alias.js +37 -0
- package/dist/semantics/class-heritage.d.ts +34 -0
- package/dist/semantics/class-heritage.js +104 -0
- package/dist/semantics/commonjs-wrapper.d.ts +69 -0
- package/dist/semantics/commonjs-wrapper.js +231 -0
- package/dist/semantics/constructor-slot-subclasses.d.ts +28 -0
- package/dist/semantics/constructor-slot-subclasses.js +112 -0
- package/dist/semantics/declaration-overlay-transform.d.ts +35 -0
- package/dist/semantics/declaration-overlay-transform.js +2157 -0
- package/dist/semantics/define-property-source-transform.d.ts +4 -0
- package/dist/semantics/define-property-source-transform.js +437 -0
- package/dist/semantics/diagnostic-source-preparation.d.ts +24 -0
- package/dist/semantics/diagnostic-source-preparation.js +82 -0
- package/dist/semantics/documentation-ranges.d.ts +22 -0
- package/dist/semantics/documentation-ranges.js +36 -0
- package/dist/semantics/dynamic-fallback.d.ts +86 -0
- package/dist/semantics/dynamic-fallback.js +249 -0
- package/dist/semantics/frontend-timing.d.ts +6 -0
- package/dist/semantics/frontend-timing.js +35 -0
- package/dist/semantics/frontend.d.ts +504 -0
- package/dist/semantics/frontend.js +1157 -0
- package/dist/semantics/host-declaration-provenance.d.ts +11 -0
- package/dist/semantics/host-declaration-provenance.js +18 -0
- package/dist/semantics/host-methods.d.ts +24 -0
- package/dist/semantics/host-methods.js +74 -0
- package/dist/semantics/host-protocols.d.ts +429 -0
- package/dist/semantics/host-protocols.js +1501 -0
- package/dist/semantics/inherited-accessor.d.ts +7 -0
- package/dist/semantics/inherited-accessor.js +48 -0
- package/dist/semantics/interface-families.d.ts +70 -0
- package/dist/semantics/interface-families.js +180 -0
- package/dist/semantics/interface-implementors.d.ts +53 -0
- package/dist/semantics/interface-implementors.js +87 -0
- package/dist/semantics/jsdoc-namepath-transform.d.ts +4 -0
- package/dist/semantics/jsdoc-namepath-transform.js +85 -0
- package/dist/semantics/model/coverage.d.ts +68 -0
- package/dist/semantics/model/coverage.js +73 -0
- package/dist/semantics/model/edges.d.ts +103 -0
- package/dist/semantics/model/edges.js +20 -0
- package/dist/semantics/model/graph.d.ts +55 -0
- package/dist/semantics/model/graph.js +129 -0
- package/dist/semantics/model/operands.d.ts +159 -0
- package/dist/semantics/model/operands.js +26 -0
- package/dist/semantics/model/operations.d.ts +496 -0
- package/dist/semantics/model/operations.js +2 -0
- package/dist/semantics/model/primitive-domain.d.ts +26 -0
- package/dist/semantics/model/primitive-domain.js +38 -0
- package/dist/semantics/model/selected-signature.d.ts +261 -0
- package/dist/semantics/model/selected-signature.js +55 -0
- package/dist/semantics/model/structural-type-table.d.ts +93 -0
- package/dist/semantics/model/structural-type-table.js +237 -0
- package/dist/semantics/model/structural-types.d.ts +367 -0
- package/dist/semantics/model/structural-types.js +200 -0
- package/dist/semantics/module-resolution.d.ts +23 -0
- package/dist/semantics/module-resolution.js +227 -0
- package/dist/semantics/new-callee-class-tag-source-transform.d.ts +4 -0
- package/dist/semantics/new-callee-class-tag-source-transform.js +64 -0
- package/dist/semantics/node-project.d.ts +13 -0
- package/dist/semantics/node-project.js +107 -0
- package/dist/semantics/node-source-hooks.d.ts +1 -0
- package/dist/semantics/node-source-hooks.js +63 -0
- package/dist/semantics/normalize/absent-globals.d.ts +143 -0
- package/dist/semantics/normalize/absent-globals.js +191 -0
- package/dist/semantics/normalize/arguments-objects.d.ts +43 -0
- package/dist/semantics/normalize/arguments-objects.js +60 -0
- package/dist/semantics/normalize/asserted-arm-absence.d.ts +28 -0
- package/dist/semantics/normalize/asserted-arm-absence.js +61 -0
- package/dist/semantics/normalize/assignment-patterns.d.ts +70 -0
- package/dist/semantics/normalize/assignment-patterns.js +147 -0
- package/dist/semantics/normalize/bag-absence.d.ts +8 -0
- package/dist/semantics/normalize/bag-absence.js +42 -0
- package/dist/semantics/normalize/binding-fixpoint.d.ts +36 -0
- package/dist/semantics/normalize/binding-fixpoint.js +140 -0
- package/dist/semantics/normalize/callback-parameter-contracts.d.ts +16 -0
- package/dist/semantics/normalize/callback-parameter-contracts.js +91 -0
- package/dist/semantics/normalize/cells/agreement.d.ts +46 -0
- package/dist/semantics/normalize/cells/agreement.js +34 -0
- package/dist/semantics/normalize/cells/candidates.d.ts +17 -0
- package/dist/semantics/normalize/cells/candidates.js +35 -0
- package/dist/semantics/normalize/cells/facts.d.ts +19 -0
- package/dist/semantics/normalize/cells/facts.js +90 -0
- package/dist/semantics/normalize/cells/index.d.ts +10 -0
- package/dist/semantics/normalize/cells/index.js +6 -0
- package/dist/semantics/normalize/cells/model.d.ts +98 -0
- package/dist/semantics/normalize/cells/model.js +2 -0
- package/dist/semantics/normalize/cells/policies/bag.d.ts +44 -0
- package/dist/semantics/normalize/cells/policies/bag.js +114 -0
- package/dist/semantics/normalize/cells/policies/collection.d.ts +42 -0
- package/dist/semantics/normalize/cells/policies/collection.js +218 -0
- package/dist/semantics/normalize/cells/policies/field.d.ts +28 -0
- package/dist/semantics/normalize/cells/policies/field.js +40 -0
- package/dist/semantics/normalize/cells/policies/index.d.ts +49 -0
- package/dist/semantics/normalize/cells/policies/index.js +58 -0
- package/dist/semantics/normalize/cells/policies/local.d.ts +18 -0
- package/dist/semantics/normalize/cells/policies/local.js +37 -0
- package/dist/semantics/normalize/cells/policies/parameter.d.ts +28 -0
- package/dist/semantics/normalize/cells/policies/parameter.js +39 -0
- package/dist/semantics/normalize/cells/policies/return.d.ts +26 -0
- package/dist/semantics/normalize/cells/policies/return.js +45 -0
- package/dist/semantics/normalize/cells/policies/shared.d.ts +33 -0
- package/dist/semantics/normalize/cells/policies/shared.js +45 -0
- package/dist/semantics/normalize/cells/policy.d.ts +72 -0
- package/dist/semantics/normalize/cells/policy.js +18 -0
- package/dist/semantics/normalize/cells/registry.d.ts +14 -0
- package/dist/semantics/normalize/cells/registry.js +17 -0
- package/dist/semantics/normalize/census-refusal.d.ts +62 -0
- package/dist/semantics/normalize/census-refusal.js +27 -0
- package/dist/semantics/normalize/census.d.ts +109 -0
- package/dist/semantics/normalize/census.js +667 -0
- package/dist/semantics/normalize/collection-bindings.d.ts +278 -0
- package/dist/semantics/normalize/collection-bindings.js +677 -0
- package/dist/semantics/normalize/commonjs-module-record.d.ts +21 -0
- package/dist/semantics/normalize/commonjs-module-record.js +289 -0
- package/dist/semantics/normalize/commonjs-require.d.ts +13 -0
- package/dist/semantics/normalize/commonjs-require.js +1527 -0
- package/dist/semantics/normalize/contribution.d.ts +63 -0
- package/dist/semantics/normalize/contribution.js +172 -0
- package/dist/semantics/normalize/dead-typeof-guards.d.ts +64 -0
- package/dist/semantics/normalize/dead-typeof-guards.js +152 -0
- package/dist/semantics/normalize/deferred-intrinsic-protocols.d.ts +57 -0
- package/dist/semantics/normalize/deferred-intrinsic-protocols.js +109 -0
- package/dist/semantics/normalize/derived-expression-type.d.ts +1070 -0
- package/dist/semantics/normalize/derived-expression-type.js +3463 -0
- package/dist/semantics/normalize/evaluation-order.d.ts +16 -0
- package/dist/semantics/normalize/evaluation-order.js +37 -0
- package/dist/semantics/normalize/field-bindings.d.ts +167 -0
- package/dist/semantics/normalize/field-bindings.js +1125 -0
- package/dist/semantics/normalize/flow/array-element-continuation.d.ts +27 -0
- package/dist/semantics/normalize/flow/array-element-continuation.js +1452 -0
- package/dist/semantics/normalize/flow/callable-array-origins.d.ts +42 -0
- package/dist/semantics/normalize/flow/callable-array-origins.js +318 -0
- package/dist/semantics/normalize/flow/callable-completions.d.ts +45 -0
- package/dist/semantics/normalize/flow/callable-completions.js +82 -0
- package/dist/semantics/normalize/flow/callable-reach.d.ts +237 -0
- package/dist/semantics/normalize/flow/callable-reach.js +7174 -0
- package/dist/semantics/normalize/flow/class-family-member-read.d.ts +16 -0
- package/dist/semantics/normalize/flow/class-family-member-read.js +992 -0
- package/dist/semantics/normalize/flow/collection-value-continuation.d.ts +21 -0
- package/dist/semantics/normalize/flow/collection-value-continuation.js +192 -0
- package/dist/semantics/normalize/flow/component-solver.d.ts +199 -0
- package/dist/semantics/normalize/flow/component-solver.js +587 -0
- package/dist/semantics/normalize/flow/computed-key-set.d.ts +84 -0
- package/dist/semantics/normalize/flow/computed-key-set.js +660 -0
- package/dist/semantics/normalize/flow/export-importers.d.ts +24 -0
- package/dist/semantics/normalize/flow/export-importers.js +269 -0
- package/dist/semantics/normalize/flow/host-text-sink.d.ts +25 -0
- package/dist/semantics/normalize/flow/host-text-sink.js +87 -0
- package/dist/semantics/normalize/flow/intrinsic-array-callback-frames.d.ts +84 -0
- package/dist/semantics/normalize/flow/intrinsic-array-callback-frames.js +180 -0
- package/dist/semantics/normalize/flow/intrinsic-data-definition.d.ts +35 -0
- package/dist/semantics/normalize/flow/intrinsic-data-definition.js +140 -0
- package/dist/semantics/normalize/flow/invocation-facts.d.ts +98 -0
- package/dist/semantics/normalize/flow/invocation-facts.js +257 -0
- package/dist/semantics/normalize/flow/member-call-forwarding.d.ts +122 -0
- package/dist/semantics/normalize/flow/member-call-forwarding.js +835 -0
- package/dist/semantics/normalize/flow/model.d.ts +357 -0
- package/dist/semantics/normalize/flow/model.js +177 -0
- package/dist/semantics/normalize/flow/native-collection-protocol.d.ts +24 -0
- package/dist/semantics/normalize/flow/native-collection-protocol.js +252 -0
- package/dist/semantics/normalize/flow/node-path-token.d.ts +3 -0
- package/dist/semantics/normalize/flow/node-path-token.js +53 -0
- package/dist/semantics/normalize/flow/object-binding-continuation.d.ts +11 -0
- package/dist/semantics/normalize/flow/object-binding-continuation.js +42 -0
- package/dist/semantics/normalize/flow/origin-authority.d.ts +56 -0
- package/dist/semantics/normalize/flow/origin-authority.js +2 -0
- package/dist/semantics/normalize/flow/owned-class-receivers.d.ts +35 -0
- package/dist/semantics/normalize/flow/owned-class-receivers.js +191 -0
- package/dist/semantics/normalize/flow/parameter-values.d.ts +27 -0
- package/dist/semantics/normalize/flow/parameter-values.js +251 -0
- package/dist/semantics/normalize/flow/proof-hypotheses.d.ts +66 -0
- package/dist/semantics/normalize/flow/proof-hypotheses.js +162 -0
- package/dist/semantics/normalize/flow/record-alias-closure.d.ts +27 -0
- package/dist/semantics/normalize/flow/record-alias-closure.js +298 -0
- package/dist/semantics/normalize/flow/seeded-origins.d.ts +43 -0
- package/dist/semantics/normalize/flow/seeded-origins.js +54 -0
- package/dist/semantics/normalize/flow/source-class-data.d.ts +132 -0
- package/dist/semantics/normalize/flow/source-class-data.js +838 -0
- package/dist/semantics/normalize/flow/source-class-instanceof.d.ts +13 -0
- package/dist/semantics/normalize/flow/source-class-instanceof.js +37 -0
- package/dist/semantics/normalize/flow/source-class-static-data.d.ts +16 -0
- package/dist/semantics/normalize/flow/source-class-static-data.js +47 -0
- package/dist/semantics/normalize/flow/source-construction-frames.d.ts +12 -0
- package/dist/semantics/normalize/flow/source-construction-frames.js +118 -0
- package/dist/semantics/normalize/flow/source-invocation-frame-layout.d.ts +34 -0
- package/dist/semantics/normalize/flow/source-invocation-frame-layout.js +78 -0
- package/dist/semantics/normalize/flow/source-invocation-receiver.d.ts +37 -0
- package/dist/semantics/normalize/flow/source-invocation-receiver.js +95 -0
- package/dist/semantics/normalize/flow/source-prototype-method-identity.d.ts +23 -0
- package/dist/semantics/normalize/flow/source-prototype-method-identity.js +81 -0
- package/dist/semantics/normalize/flow/source-record-data.d.ts +29 -0
- package/dist/semantics/normalize/flow/source-record-data.js +626 -0
- package/dist/semantics/normalize/flow/source-value-session.d.ts +77 -0
- package/dist/semantics/normalize/flow/source-value-session.js +3089 -0
- package/dist/semantics/normalize/flow/targets.d.ts +118 -0
- package/dist/semantics/normalize/flow/targets.js +405 -0
- package/dist/semantics/normalize/flow/value-flow.d.ts +36 -0
- package/dist/semantics/normalize/flow/value-flow.js +823 -0
- package/dist/semantics/normalize/flow/value-provenance.d.ts +31 -0
- package/dist/semantics/normalize/flow/value-provenance.js +112 -0
- package/dist/semantics/normalize/gating.d.ts +51 -0
- package/dist/semantics/normalize/gating.js +560 -0
- package/dist/semantics/normalize/generic-function-choice.d.ts +31 -0
- package/dist/semantics/normalize/generic-function-choice.js +115 -0
- package/dist/semantics/normalize/global-host-mutations.d.ts +51 -0
- package/dist/semantics/normalize/global-host-mutations.js +5989 -0
- package/dist/semantics/normalize/host-effect-contracts.d.ts +77 -0
- package/dist/semantics/normalize/host-effect-contracts.js +143 -0
- package/dist/semantics/normalize/host-mutation-computed-keys.d.ts +38 -0
- package/dist/semantics/normalize/host-mutation-computed-keys.js +26 -0
- package/dist/semantics/normalize/host-mutation-key-reader.d.ts +66 -0
- package/dist/semantics/normalize/host-mutation-key-reader.js +192 -0
- package/dist/semantics/normalize/host-mutation-keys.d.ts +114 -0
- package/dist/semantics/normalize/host-mutation-keys.js +183 -0
- package/dist/semantics/normalize/identities.d.ts +172 -0
- package/dist/semantics/normalize/identities.js +426 -0
- package/dist/semantics/normalize/implicit-arguments-tuple.d.ts +97 -0
- package/dist/semantics/normalize/implicit-arguments-tuple.js +197 -0
- package/dist/semantics/normalize/implicit-arguments.d.ts +11 -0
- package/dist/semantics/normalize/implicit-arguments.js +39 -0
- package/dist/semantics/normalize/instantiation.d.ts +73 -0
- package/dist/semantics/normalize/instantiation.js +399 -0
- package/dist/semantics/normalize/intrinsic-property-call.d.ts +18 -0
- package/dist/semantics/normalize/intrinsic-property-call.js +69 -0
- package/dist/semantics/normalize/intrinsic-prototype.d.ts +41 -0
- package/dist/semantics/normalize/intrinsic-prototype.js +87 -0
- package/dist/semantics/normalize/intrinsic-static-member.d.ts +14 -0
- package/dist/semantics/normalize/intrinsic-static-member.js +23 -0
- package/dist/semantics/normalize/jsdoc-type-names.d.ts +32 -0
- package/dist/semantics/normalize/jsdoc-type-names.js +512 -0
- package/dist/semantics/normalize/keyof.d.ts +32 -0
- package/dist/semantics/normalize/keyof.js +110 -0
- package/dist/semantics/normalize/local-bindings.d.ts +176 -0
- package/dist/semantics/normalize/local-bindings.js +1826 -0
- package/dist/semantics/normalize/logical-result-type.d.ts +16 -0
- package/dist/semantics/normalize/logical-result-type.js +102 -0
- package/dist/semantics/normalize/namespace-paths.d.ts +57 -0
- package/dist/semantics/normalize/namespace-paths.js +108 -0
- package/dist/semantics/normalize/normalize.d.ts +57 -0
- package/dist/semantics/normalize/normalize.js +68 -0
- package/dist/semantics/normalize/object-bag-bindings.d.ts +305 -0
- package/dist/semantics/normalize/object-bag-bindings.js +1290 -0
- package/dist/semantics/normalize/omitted-stated-parameter.d.ts +53 -0
- package/dist/semantics/normalize/omitted-stated-parameter.js +59 -0
- package/dist/semantics/normalize/open-type-form.d.ts +10 -0
- package/dist/semantics/normalize/open-type-form.js +32 -0
- package/dist/semantics/normalize/parameter-bindings.d.ts +361 -0
- package/dist/semantics/normalize/parameter-bindings.js +3339 -0
- package/dist/semantics/normalize/parameter-slot.d.ts +264 -0
- package/dist/semantics/normalize/parameter-slot.js +491 -0
- package/dist/semantics/normalize/physical-overload-result.d.ts +77 -0
- package/dist/semantics/normalize/physical-overload-result.js +99 -0
- package/dist/semantics/normalize/primitive-property-absence.d.ts +12 -0
- package/dist/semantics/normalize/primitive-property-absence.js +60 -0
- package/dist/semantics/normalize/producer-context.d.ts +376 -0
- package/dist/semantics/normalize/producer-context.js +1 -0
- package/dist/semantics/normalize/producers/allocations.d.ts +3 -0
- package/dist/semantics/normalize/producers/allocations.js +863 -0
- package/dist/semantics/normalize/producers/binding-kind.d.ts +37 -0
- package/dist/semantics/normalize/producers/binding-kind.js +36 -0
- package/dist/semantics/normalize/producers/bindings.d.ts +85 -0
- package/dist/semantics/normalize/producers/bindings.js +710 -0
- package/dist/semantics/normalize/producers/boundary.d.ts +34 -0
- package/dist/semantics/normalize/producers/boundary.js +123 -0
- package/dist/semantics/normalize/producers/class-lifecycle.d.ts +3 -0
- package/dist/semantics/normalize/producers/class-lifecycle.js +902 -0
- package/dist/semantics/normalize/producers/computations.d.ts +3 -0
- package/dist/semantics/normalize/producers/computations.js +613 -0
- package/dist/semantics/normalize/producers/control-loops.d.ts +30 -0
- package/dist/semantics/normalize/producers/control-loops.js +91 -0
- package/dist/semantics/normalize/producers/control.d.ts +30 -0
- package/dist/semantics/normalize/producers/control.js +923 -0
- package/dist/semantics/normalize/producers/declaration-lifecycle.d.ts +3 -0
- package/dist/semantics/normalize/producers/declaration-lifecycle.js +390 -0
- package/dist/semantics/normalize/producers/destructuring.d.ts +45 -0
- package/dist/semantics/normalize/producers/destructuring.js +1180 -0
- package/dist/semantics/normalize/producers/dynamic-language.d.ts +3 -0
- package/dist/semantics/normalize/producers/dynamic-language.js +70 -0
- package/dist/semantics/normalize/producers/erasure.d.ts +51 -0
- package/dist/semantics/normalize/producers/erasure.js +90 -0
- package/dist/semantics/normalize/producers/installed.d.ts +3 -0
- package/dist/semantics/normalize/producers/installed.js +55 -0
- package/dist/semantics/normalize/producers/invocations.d.ts +35 -0
- package/dist/semantics/normalize/producers/invocations.js +1796 -0
- package/dist/semantics/normalize/producers/iteration-yield.d.ts +59 -0
- package/dist/semantics/normalize/producers/iteration-yield.js +235 -0
- package/dist/semantics/normalize/producers/jsx.d.ts +3 -0
- package/dist/semantics/normalize/producers/jsx.js +360 -0
- package/dist/semantics/normalize/producers/mint.d.ts +39 -0
- package/dist/semantics/normalize/producers/mint.js +44 -0
- package/dist/semantics/normalize/producers/nullish.d.ts +16 -0
- package/dist/semantics/normalize/producers/nullish.js +27 -0
- package/dist/semantics/normalize/producers/object-assignment.d.ts +8 -0
- package/dist/semantics/normalize/producers/object-assignment.js +204 -0
- package/dist/semantics/normalize/producers/object-tag.d.ts +9 -0
- package/dist/semantics/normalize/producers/object-tag.js +119 -0
- package/dist/semantics/normalize/producers/optional-chain.d.ts +44 -0
- package/dist/semantics/normalize/producers/optional-chain.js +75 -0
- package/dist/semantics/normalize/producers/properties.d.ts +21 -0
- package/dist/semantics/normalize/producers/properties.js +1053 -0
- package/dist/semantics/normalize/producers/protocol.d.ts +67 -0
- package/dist/semantics/normalize/producers/protocol.js +695 -0
- package/dist/semantics/normalize/producers/references.d.ts +53 -0
- package/dist/semantics/normalize/producers/references.js +1027 -0
- package/dist/semantics/normalize/producers/shared.d.ts +561 -0
- package/dist/semantics/normalize/producers/shared.js +1683 -0
- package/dist/semantics/normalize/producers/spread-arguments.d.ts +72 -0
- package/dist/semantics/normalize/producers/spread-arguments.js +375 -0
- package/dist/semantics/normalize/producers/tagged-template.d.ts +5 -0
- package/dist/semantics/normalize/producers/tagged-template.js +307 -0
- package/dist/semantics/normalize/producers/tuple-spread.d.ts +189 -0
- package/dist/semantics/normalize/producers/tuple-spread.js +279 -0
- package/dist/semantics/normalize/property-key-domain.d.ts +36 -0
- package/dist/semantics/normalize/property-key-domain.js +150 -0
- package/dist/semantics/normalize/reachability.d.ts +189 -0
- package/dist/semantics/normalize/reachability.js +1057 -0
- package/dist/semantics/normalize/reassigned-bindings.d.ts +13 -0
- package/dist/semantics/normalize/reassigned-bindings.js +41 -0
- package/dist/semantics/normalize/record-storage-families.d.ts +11 -0
- package/dist/semantics/normalize/record-storage-families.js +109 -0
- package/dist/semantics/normalize/return-bindings.d.ts +260 -0
- package/dist/semantics/normalize/return-bindings.js +1311 -0
- package/dist/semantics/normalize/return-paths.d.ts +2 -0
- package/dist/semantics/normalize/return-paths.js +28 -0
- package/dist/semantics/normalize/script-global-redefinition.d.ts +44 -0
- package/dist/semantics/normalize/script-global-redefinition.js +75 -0
- package/dist/semantics/normalize/specialization.d.ts +201 -0
- package/dist/semantics/normalize/specialization.js +1824 -0
- package/dist/semantics/normalize/structural-array-element.d.ts +176 -0
- package/dist/semantics/normalize/structural-array-element.js +700 -0
- package/dist/semantics/normalize/structural-array-read.d.ts +13 -0
- package/dist/semantics/normalize/structural-array-read.js +124 -0
- package/dist/semantics/normalize/structural-callable.d.ts +12 -0
- package/dist/semantics/normalize/structural-callable.js +82 -0
- package/dist/semantics/normalize/structural-creation-order.d.ts +32 -0
- package/dist/semantics/normalize/structural-creation-order.js +111 -0
- package/dist/semantics/normalize/structural-declarations.d.ts +395 -0
- package/dist/semantics/normalize/structural-declarations.js +968 -0
- package/dist/semantics/normalize/structural-declared-body.d.ts +25 -0
- package/dist/semantics/normalize/structural-declared-body.js +147 -0
- package/dist/semantics/normalize/structural-generics.d.ts +56 -0
- package/dist/semantics/normalize/structural-generics.js +120 -0
- package/dist/semantics/normalize/structural-indexed-access.d.ts +11 -0
- package/dist/semantics/normalize/structural-indexed-access.js +126 -0
- package/dist/semantics/normalize/structural-instantiated-member.d.ts +64 -0
- package/dist/semantics/normalize/structural-instantiated-member.js +407 -0
- package/dist/semantics/normalize/structural-joins.d.ts +44 -0
- package/dist/semantics/normalize/structural-joins.js +143 -0
- package/dist/semantics/normalize/structural-layout-relevance.d.ts +29 -0
- package/dist/semantics/normalize/structural-layout-relevance.js +391 -0
- package/dist/semantics/normalize/structural-layout-type.d.ts +11 -0
- package/dist/semantics/normalize/structural-layout-type.js +1468 -0
- package/dist/semantics/normalize/structural-leaves.d.ts +49 -0
- package/dist/semantics/normalize/structural-leaves.js +125 -0
- package/dist/semantics/normalize/structural-local-union.d.ts +13 -0
- package/dist/semantics/normalize/structural-local-union.js +133 -0
- package/dist/semantics/normalize/structural-members.d.ts +26 -0
- package/dist/semantics/normalize/structural-members.js +84 -0
- package/dist/semantics/normalize/structural-mutable-method.d.ts +15 -0
- package/dist/semantics/normalize/structural-mutable-method.js +109 -0
- package/dist/semantics/normalize/structural-parts.d.ts +131 -0
- package/dist/semantics/normalize/structural-parts.js +737 -0
- package/dist/semantics/normalize/structural-receiver.d.ts +66 -0
- package/dist/semantics/normalize/structural-receiver.js +551 -0
- package/dist/semantics/normalize/structural-rules.d.ts +112 -0
- package/dist/semantics/normalize/structural-rules.js +93 -0
- package/dist/semantics/normalize/structural-self-reference.d.ts +150 -0
- package/dist/semantics/normalize/structural-self-reference.js +494 -0
- package/dist/semantics/normalize/structural.d.ts +202 -0
- package/dist/semantics/normalize/structural.js +4218 -0
- package/dist/semantics/normalize/unreduced-type-form.d.ts +41 -0
- package/dist/semantics/normalize/unreduced-type-form.js +53 -0
- package/dist/semantics/normalize/unresolvable-names.d.ts +56 -0
- package/dist/semantics/normalize/unresolvable-names.js +140 -0
- package/dist/semantics/package-sources.d.ts +16 -0
- package/dist/semantics/package-sources.js +365 -0
- package/dist/semantics/program.d.ts +151 -0
- package/dist/semantics/program.js +667 -0
- package/dist/semantics/prototype-install-source-transform.d.ts +4 -0
- package/dist/semantics/prototype-install-source-transform.js +341 -0
- package/dist/semantics/prototype-object-class-source-transform.d.ts +4 -0
- package/dist/semantics/prototype-object-class-source-transform.js +525 -0
- package/dist/semantics/prototype-reparenting.d.ts +50 -0
- package/dist/semantics/prototype-reparenting.js +317 -0
- package/dist/semantics/stable-checker.d.ts +10 -0
- package/dist/semantics/stable-checker.js +148 -0
- package/dist/semantics/subclass-member-overlay-transform.d.ts +35 -0
- package/dist/semantics/subclass-member-overlay-transform.js +1418 -0
- package/dist/semantics/symbol-keyed-expando-source-transform.d.ts +4 -0
- package/dist/semantics/symbol-keyed-expando-source-transform.js +66 -0
- package/dist/semantics/this-constructor-source-transform.d.ts +4 -0
- package/dist/semantics/this-constructor-source-transform.js +122 -0
- package/dist/semantics/uninstantiable-classes.d.ts +22 -0
- package/dist/semantics/uninstantiable-classes.js +75 -0
- package/dist/targets/cpp/balanced-units.d.ts +3 -0
- package/dist/targets/cpp/balanced-units.js +58 -0
- package/dist/targets/cpp/borrowed-call-entry.d.ts +30 -0
- package/dist/targets/cpp/borrowed-call-entry.js +68 -0
- package/dist/targets/cpp/captures.d.ts +68 -0
- package/dist/targets/cpp/captures.js +269 -0
- package/dist/targets/cpp/class-layout.d.ts +313 -0
- package/dist/targets/cpp/class-layout.js +483 -0
- package/dist/targets/cpp/class-properties/computed-method-value.d.ts +25 -0
- package/dist/targets/cpp/class-properties/computed-method-value.js +22 -0
- package/dist/targets/cpp/class-properties/emit-class-properties.d.ts +216 -0
- package/dist/targets/cpp/class-properties/emit-class-properties.js +917 -0
- package/dist/targets/cpp/class-properties/native-prototype.d.ts +11 -0
- package/dist/targets/cpp/class-properties/native-prototype.js +101 -0
- package/dist/targets/cpp/class-ref-transport.d.ts +12 -0
- package/dist/targets/cpp/class-ref-transport.js +32 -0
- package/dist/targets/cpp/conversions.d.ts +3 -0
- package/dist/targets/cpp/conversions.js +2027 -0
- package/dist/targets/cpp/deferral-safety.d.ts +82 -0
- package/dist/targets/cpp/deferral-safety.js +86 -0
- package/dist/targets/cpp/direct-call-receivers.d.ts +37 -0
- package/dist/targets/cpp/direct-call-receivers.js +79 -0
- package/dist/targets/cpp/document.d.ts +74 -0
- package/dist/targets/cpp/document.js +106 -0
- package/dist/targets/cpp/emit-allocation.d.ts +60 -0
- package/dist/targets/cpp/emit-allocation.js +573 -0
- package/dist/targets/cpp/emit-arrays.d.ts +119 -0
- package/dist/targets/cpp/emit-arrays.js +1047 -0
- package/dist/targets/cpp/emit-binding-reference.d.ts +17 -0
- package/dist/targets/cpp/emit-binding-reference.js +120 -0
- package/dist/targets/cpp/emit-bindings.d.ts +158 -0
- package/dist/targets/cpp/emit-bindings.js +769 -0
- package/dist/targets/cpp/emit-buffers.d.ts +156 -0
- package/dist/targets/cpp/emit-buffers.js +573 -0
- package/dist/targets/cpp/emit-callable.d.ts +230 -0
- package/dist/targets/cpp/emit-callable.js +2154 -0
- package/dist/targets/cpp/emit-carrier-members.d.ts +406 -0
- package/dist/targets/cpp/emit-carrier-members.js +1224 -0
- package/dist/targets/cpp/emit-coercion.d.ts +26 -0
- package/dist/targets/cpp/emit-coercion.js +39 -0
- package/dist/targets/cpp/emit-context.d.ts +1882 -0
- package/dist/targets/cpp/emit-context.js +904 -0
- package/dist/targets/cpp/emit-dynamic-properties.d.ts +174 -0
- package/dist/targets/cpp/emit-dynamic-properties.js +1249 -0
- package/dist/targets/cpp/emit-equality.d.ts +39 -0
- package/dist/targets/cpp/emit-equality.js +472 -0
- package/dist/targets/cpp/emit-exceptions.d.ts +104 -0
- package/dist/targets/cpp/emit-exceptions.js +513 -0
- package/dist/targets/cpp/emit-field-owner.d.ts +4 -0
- package/dist/targets/cpp/emit-field-owner.js +27 -0
- package/dist/targets/cpp/emit-in.d.ts +31 -0
- package/dist/targets/cpp/emit-in.js +426 -0
- package/dist/targets/cpp/emit-instanceof.d.ts +19 -0
- package/dist/targets/cpp/emit-instanceof.js +601 -0
- package/dist/targets/cpp/emit-integers.d.ts +68 -0
- package/dist/targets/cpp/emit-integers.js +184 -0
- package/dist/targets/cpp/emit-iterator.d.ts +100 -0
- package/dist/targets/cpp/emit-iterator.js +1137 -0
- package/dist/targets/cpp/emit-json.d.ts +73 -0
- package/dist/targets/cpp/emit-json.js +823 -0
- package/dist/targets/cpp/emit-jsx.d.ts +74 -0
- package/dist/targets/cpp/emit-jsx.js +806 -0
- package/dist/targets/cpp/emit-mixed-binary.d.ts +51 -0
- package/dist/targets/cpp/emit-mixed-binary.js +60 -0
- package/dist/targets/cpp/emit-namespaces.d.ts +101 -0
- package/dist/targets/cpp/emit-namespaces.js +133 -0
- package/dist/targets/cpp/emit-narrowing.d.ts +738 -0
- package/dist/targets/cpp/emit-narrowing.js +3967 -0
- package/dist/targets/cpp/emit-native-equality.d.ts +3 -0
- package/dist/targets/cpp/emit-native-equality.js +14 -0
- package/dist/targets/cpp/emit-native-selection.d.ts +5 -0
- package/dist/targets/cpp/emit-native-selection.js +37 -0
- package/dist/targets/cpp/emit-object-tag.d.ts +4 -0
- package/dist/targets/cpp/emit-object-tag.js +108 -0
- package/dist/targets/cpp/emit-owned-record.d.ts +2 -0
- package/dist/targets/cpp/emit-owned-record.js +15 -0
- package/dist/targets/cpp/emit-presence.d.ts +78 -0
- package/dist/targets/cpp/emit-presence.js +376 -0
- package/dist/targets/cpp/emit-properties.d.ts +105 -0
- package/dist/targets/cpp/emit-properties.js +1640 -0
- package/dist/targets/cpp/emit-record-view.d.ts +20 -0
- package/dist/targets/cpp/emit-record-view.js +354 -0
- package/dist/targets/cpp/emit-return.d.ts +5 -0
- package/dist/targets/cpp/emit-return.js +237 -0
- package/dist/targets/cpp/emit-sum-widening.d.ts +10 -0
- package/dist/targets/cpp/emit-sum-widening.js +69 -0
- package/dist/targets/cpp/emit-tonumber.d.ts +38 -0
- package/dist/targets/cpp/emit-tonumber.js +177 -0
- package/dist/targets/cpp/emit-tostring.d.ts +92 -0
- package/dist/targets/cpp/emit-tostring.js +556 -0
- package/dist/targets/cpp/emit-typeof.d.ts +49 -0
- package/dist/targets/cpp/emit-typeof.js +317 -0
- package/dist/targets/cpp/emit-union-properties.d.ts +181 -0
- package/dist/targets/cpp/emit-union-properties.js +1281 -0
- package/dist/targets/cpp/emit.d.ts +45 -0
- package/dist/targets/cpp/emit.js +2225 -0
- package/dist/targets/cpp/error-types.d.ts +4 -0
- package/dist/targets/cpp/error-types.js +11 -0
- package/dist/targets/cpp/function-source-reads.d.ts +72 -0
- package/dist/targets/cpp/function-source-reads.js +148 -0
- package/dist/targets/cpp/host/atomics.d.ts +25 -0
- package/dist/targets/cpp/host/atomics.js +63 -0
- package/dist/targets/cpp/host/core-globals.d.ts +108 -0
- package/dist/targets/cpp/host/core-globals.js +158 -0
- package/dist/targets/cpp/host/dynamic-argument-members.d.ts +42 -0
- package/dist/targets/cpp/host/dynamic-argument-members.js +61 -0
- package/dist/targets/cpp/host/emit-host-arity.d.ts +139 -0
- package/dist/targets/cpp/host/emit-host-arity.js +232 -0
- package/dist/targets/cpp/host/emit-host-invoke.d.ts +91 -0
- package/dist/targets/cpp/host/emit-host-invoke.js +1105 -0
- package/dist/targets/cpp/host/emit-host-object.d.ts +55 -0
- package/dist/targets/cpp/host/emit-host-object.js +2206 -0
- package/dist/targets/cpp/host/emit-host-properties.d.ts +69 -0
- package/dist/targets/cpp/host/emit-host-properties.js +533 -0
- package/dist/targets/cpp/host/emit-host-reflect.d.ts +4 -0
- package/dist/targets/cpp/host/emit-host-reflect.js +180 -0
- package/dist/targets/cpp/host/emit-host-value.d.ts +120 -0
- package/dist/targets/cpp/host/emit-host-value.js +392 -0
- package/dist/targets/cpp/host/host-members.d.ts +505 -0
- package/dist/targets/cpp/host/host-members.js +819 -0
- package/dist/targets/cpp/host/host-method-aliases.d.ts +30 -0
- package/dist/targets/cpp/host/host-method-aliases.js +76 -0
- package/dist/targets/cpp/host/native-protocols.d.ts +47 -0
- package/dist/targets/cpp/host/native-protocols.js +183 -0
- package/dist/targets/cpp/host/object-protocol.d.ts +351 -0
- package/dist/targets/cpp/host/object-protocol.js +671 -0
- package/dist/targets/cpp/host-namespace-reads.d.ts +83 -0
- package/dist/targets/cpp/host-namespace-reads.js +113 -0
- package/dist/targets/cpp/manifest/capabilities.d.ts +39 -0
- package/dist/targets/cpp/manifest/capabilities.js +1484 -0
- package/dist/targets/cpp/manifest.d.ts +23 -0
- package/dist/targets/cpp/manifest.js +113 -0
- package/dist/targets/cpp/native-error-base.d.ts +38 -0
- package/dist/targets/cpp/native-error-base.js +74 -0
- package/dist/targets/cpp/native-narrowing-transport.d.ts +12 -0
- package/dist/targets/cpp/native-narrowing-transport.js +151 -0
- package/dist/targets/cpp/native-selection-helpers.d.ts +11 -0
- package/dist/targets/cpp/native-selection-helpers.js +46 -0
- package/dist/targets/cpp/native-symbol-keys.d.ts +8 -0
- package/dist/targets/cpp/native-symbol-keys.js +34 -0
- package/dist/targets/cpp/ownership.d.ts +43 -0
- package/dist/targets/cpp/ownership.js +38 -0
- package/dist/targets/cpp/owning-conversion-input.d.ts +14 -0
- package/dist/targets/cpp/owning-conversion-input.js +12 -0
- package/dist/targets/cpp/property-read-claims.d.ts +62 -0
- package/dist/targets/cpp/property-read-claims.js +23 -0
- package/dist/targets/cpp/property-store-claims.d.ts +62 -0
- package/dist/targets/cpp/property-store-claims.js +26 -0
- package/dist/targets/cpp/prototype/emit-prototype-array.d.ts +111 -0
- package/dist/targets/cpp/prototype/emit-prototype-array.js +602 -0
- package/dist/targets/cpp/prototype/emit-prototype-date.d.ts +133 -0
- package/dist/targets/cpp/prototype/emit-prototype-date.js +515 -0
- package/dist/targets/cpp/prototype/emit-prototype-error.d.ts +13 -0
- package/dist/targets/cpp/prototype/emit-prototype-error.js +54 -0
- package/dist/targets/cpp/prototype/emit-prototype-invoke.d.ts +34 -0
- package/dist/targets/cpp/prototype/emit-prototype-invoke.js +1003 -0
- package/dist/targets/cpp/prototype/emit-prototype-iterator.d.ts +47 -0
- package/dist/targets/cpp/prototype/emit-prototype-iterator.js +250 -0
- package/dist/targets/cpp/prototype/emit-prototype-promise.d.ts +46 -0
- package/dist/targets/cpp/prototype/emit-prototype-promise.js +143 -0
- package/dist/targets/cpp/prototype/emit-prototype-regexp.d.ts +335 -0
- package/dist/targets/cpp/prototype/emit-prototype-regexp.js +853 -0
- package/dist/targets/cpp/prototype/emit-prototype-string.d.ts +42 -0
- package/dist/targets/cpp/prototype/emit-prototype-string.js +252 -0
- package/dist/targets/cpp/prototype/prototype-method-reads.d.ts +25 -0
- package/dist/targets/cpp/prototype/prototype-method-reads.js +182 -0
- package/dist/targets/cpp/reactive-dependencies.d.ts +140 -0
- package/dist/targets/cpp/reactive-dependencies.js +432 -0
- package/dist/targets/cpp/reactive-origins.d.ts +44 -0
- package/dist/targets/cpp/reactive-origins.js +82 -0
- package/dist/targets/cpp/records.d.ts +277 -0
- package/dist/targets/cpp/records.js +2427 -0
- package/dist/targets/cpp/recursive-containers.d.ts +43 -0
- package/dist/targets/cpp/recursive-containers.js +144 -0
- package/dist/targets/cpp/regexp-types.d.ts +56 -0
- package/dist/targets/cpp/regexp-types.js +59 -0
- package/dist/targets/cpp/substrate.d.ts +125 -0
- package/dist/targets/cpp/substrate.js +12 -0
- package/dist/targets/cpp/translation-unit.d.ts +219 -0
- package/dist/targets/cpp/translation-unit.js +2063 -0
- package/dist/targets/cpp/types.d.ts +280 -0
- package/dist/targets/cpp/types.js +1135 -0
- package/dist/targets/cpp/virtual-methods.d.ts +95 -0
- package/dist/targets/cpp/virtual-methods.js +264 -0
- package/package.json +95 -0
- package/src/targets/cpp/runtime/gea_dynamic_proxy.h +824 -0
- package/src/targets/cpp/runtime/gea_eval.h +1376 -0
- package/src/targets/cpp/runtime/gea_native_class_prototype.h +44 -0
- package/src/targets/cpp/runtime/gea_runtime.h +29222 -0
- package/src/targets/cpp/runtime/gea_runtime_builtins.cpp +55 -0
|
@@ -0,0 +1,1070 @@
|
|
|
1
|
+
import ts from 'typescript';
|
|
2
|
+
export { isOpenTypeForm } from './open-type-form.js';
|
|
3
|
+
import { type ProgramReachability } from './reachability.js';
|
|
4
|
+
import { type ExplicitThisCallFrame, type FlowInvocationOperands, type ValueFlowIndex } from './flow/model.js';
|
|
5
|
+
/**
|
|
6
|
+
* Whether a type says nothing about STORAGE, and so is not evidence.
|
|
7
|
+
*
|
|
8
|
+
* The ONE copy. `parameter-bindings.ts` and `return-bindings.ts` each carried
|
|
9
|
+
* their own before this, with `parameter-bindings.ts`'s adding bare
|
|
10
|
+
* `Function` on top -- it still does, by composing with this rather than
|
|
11
|
+
* restating it, so the base three flags cannot drift between the three
|
|
12
|
+
* modules that ask this question. That module's own `isUnusableEvidence`
|
|
13
|
+
* carries the long-form reasoning for `any`, `void` and `never`.
|
|
14
|
+
*
|
|
15
|
+
* `annotationStatesNothing` is the fourth member and the reason this became
|
|
16
|
+
* shared: a value typed `object` or `{}` is not `any`, so every one of these
|
|
17
|
+
* copies read it as real evidence and published it -- and the parameter
|
|
18
|
+
* census's answer SHADOWS the return census's in the composed view
|
|
19
|
+
* (`composeReturnBindings`), so `function makesBag(): object { return { a: 1,
|
|
20
|
+
* b: 2 } }` had its call answered `object` by one census while the other had
|
|
21
|
+
* already derived the real record. Two authorities, one call, and
|
|
22
|
+
* `model/selected-signature.ts`'s fail-closed guard caught it as a withheld
|
|
23
|
+
* producer. A type that states nothing is not evidence here for exactly the
|
|
24
|
+
* reason `any` is not.
|
|
25
|
+
*/
|
|
26
|
+
/**
|
|
27
|
+
* The destructuring TARGET an object or array literal is written against,
|
|
28
|
+
* when that target is a binding pattern whose type TypeScript merely IMPLIED
|
|
29
|
+
* from the pattern's shape: `const [a, b] = [1, 2]`, `[a, b] = [1, 2]`,
|
|
30
|
+
* `f([1, 2])` for `function f([x, y])`, `function g({ x } = { x: 1 })`. The
|
|
31
|
+
* checker contextually types such a literal from the pattern -- a tuple, or
|
|
32
|
+
* a record of `any` fields -- while the value is exactly what was written:
|
|
33
|
+
* nothing in the program stated a type, and the language binds the pattern
|
|
34
|
+
* off whatever arrives. `null` for a literal in any other position,
|
|
35
|
+
* including one whose target DECLARES its type, which stays what it states.
|
|
36
|
+
* The returned parameter is the census's cell for the value when the target
|
|
37
|
+
* is a parameter, so an empty literal can take its element from what the
|
|
38
|
+
* other call sites pass rather than from nothing. `element` names the nested
|
|
39
|
+
* binding element whose DEFAULT the literal is: that literal is stored in
|
|
40
|
+
* the element's own slot, never in the root parameter's.
|
|
41
|
+
*/
|
|
42
|
+
export declare const impliedPatternTargetOf: (checker: ts.TypeChecker, node: ts.ArrayLiteralExpression | ts.ObjectLiteralExpression) => {
|
|
43
|
+
readonly parameter: ts.ParameterDeclaration | null;
|
|
44
|
+
readonly element?: ts.BindingElement;
|
|
45
|
+
} | null;
|
|
46
|
+
/**
|
|
47
|
+
* The parameter whose DESTRUCTURING PATTERN `node` is or names, when the
|
|
48
|
+
* pattern's type is one TypeScript merely IMPLIED from the pattern's shape --
|
|
49
|
+
* `function f([x, y])`, `function g({ a, b })` -- with no annotation and no
|
|
50
|
+
* JSDoc tag. That implied type (`[any, any]`, `{ a: any; b: any }`) is a
|
|
51
|
+
* statement about the binding's SYNTAX, not about any value a caller passes:
|
|
52
|
+
* the language binds an array pattern off any iterable of any length, and an
|
|
53
|
+
* object pattern off any object. So for every question this compiler asks --
|
|
54
|
+
* does the parameter state a type (no: the census binds it from the call
|
|
55
|
+
* sites), is the pattern's own type real (no: it is its source's) -- the
|
|
56
|
+
* pattern is "unannotated", and this one predicate is what every site asks so
|
|
57
|
+
* the census, the layout resolver and the ABI projection agree by
|
|
58
|
+
* construction. `null` for a named parameter, an annotated pattern, or a
|
|
59
|
+
* pattern that is not a parameter's own name.
|
|
60
|
+
*/
|
|
61
|
+
export declare const impliedPatternParameterOf: (checker: ts.TypeChecker, node: ts.Node) => ts.ParameterDeclaration | null;
|
|
62
|
+
/**
|
|
63
|
+
* The implied-pattern parameter a binding element belongs to, or `null`. The
|
|
64
|
+
* checker types every name in `function f([w = c()])` from the pattern's own
|
|
65
|
+
* silhouette -- `void` here, because the default is the only evidence it has
|
|
66
|
+
* -- and that silhouette is the thing `impliedPatternParameterOf` exists to
|
|
67
|
+
* see through: a layout consult that trusts it skips the census that holds
|
|
68
|
+
* the callers' actual writes. An identifier declared by such an element is
|
|
69
|
+
* the same question asked at a read.
|
|
70
|
+
*/
|
|
71
|
+
export declare const impliedPatternElementRootOf: (checker: ts.TypeChecker, node: ts.Node) => ts.ParameterDeclaration | null;
|
|
72
|
+
export declare const isUnusableEvidence: (type: ts.Type) => boolean;
|
|
73
|
+
/**
|
|
74
|
+
* The one type among these that every other fits into, or `null` when no
|
|
75
|
+
* single member holds them all.
|
|
76
|
+
*
|
|
77
|
+
* The ONE join every census in this compiler uses -- `parameter-bindings.ts`
|
|
78
|
+
* (call-site arguments, write-sets, return expressions), `return-bindings.ts`
|
|
79
|
+
* and `local-bindings.ts` (both by way of `derivedExpressionType`, below).
|
|
80
|
+
* Kept to one copy deliberately: two joins answering the same "do these
|
|
81
|
+
* agree" question two ways is the defect class this compiler keeps
|
|
82
|
+
* rediscovering (see this file's own header comment on `derivedExpressionType`).
|
|
83
|
+
*
|
|
84
|
+
* Two writes to one cell, two calls to one parameter, two `return`s from one
|
|
85
|
+
* function: each has to settle on a single carrier, and requiring the observed
|
|
86
|
+
* types to be IDENTICAL refuses a case the program answers itself. In three's
|
|
87
|
+
* renderer `let _gl = context;` is followed by
|
|
88
|
+
* `if ( _gl === null ) _gl = getContext( ... );` -- the writes are
|
|
89
|
+
* `NativeWebGL2RenderingContext` and `NativeWebGL2RenderingContext | null`, and
|
|
90
|
+
* the null check on the very next line says which one the cell is.
|
|
91
|
+
*
|
|
92
|
+
* Nothing is invented here. The answer is always one of the types the program
|
|
93
|
+
* itself produced, admitted only because the checker says every other observed
|
|
94
|
+
* type is assignable to it -- so the storage provably holds all of them. Two
|
|
95
|
+
* unrelated types stay refused, because there the honest answer is neither, and
|
|
96
|
+
* a union of this compiler's own making would be a source-shaped guess at a
|
|
97
|
+
* carrier rather than a reading of one.
|
|
98
|
+
*
|
|
99
|
+
* A CALLING CONVENTION is the one case plain assignability gets wrong. A
|
|
100
|
+
* function declaring FEWER parameters is assignable wherever one declaring
|
|
101
|
+
* more is expected -- TypeScript lets a callee ignore an argument it never
|
|
102
|
+
* named -- so joining `(event) => void` and `() => void` by assignability
|
|
103
|
+
* alone picks `() => void`: the least informative signature, with the
|
|
104
|
+
* parameter every real call site actually passes silently dropped.
|
|
105
|
+
* `EventDispatcher.addEventListener`'s `listener` parameter, bound once bare
|
|
106
|
+
* `Function` stopped being usable evidence (`parameter-bindings.ts`'s
|
|
107
|
+
* `isUnusableEvidence`), is exactly this: joined by assignability it
|
|
108
|
+
* collapsed to `() => void` while `dispatchEvent` calls every listener with
|
|
109
|
+
* one argument, and that reached the emitter as a real ABI mismatch. Requiring
|
|
110
|
+
* the SAME arity when either side is a single-signature callable is the
|
|
111
|
+
* narrow fix -- compatible same-arity callables still agree exactly as
|
|
112
|
+
* `isTypeAssignableTo` already decided; only arity itself stops being
|
|
113
|
+
* something a join can widen away.
|
|
114
|
+
*/
|
|
115
|
+
/**
|
|
116
|
+
* Whether a JSDoc type node states nothing this compiler can read -- it
|
|
117
|
+
* resolves to `any`, `unknown`, or the checker's internal error type (which
|
|
118
|
+
* carries the `Any` flag).
|
|
119
|
+
*
|
|
120
|
+
* `checker.getTypeFromTypeNode` degrades to this when the node NAMES something
|
|
121
|
+
* the checker cannot bind at that site, and three.js's source does it
|
|
122
|
+
* constantly: `Box3.js` JSDoc-references `Sphere`/`Object3D`/`Triangle`/
|
|
123
|
+
* `Line3`/`Plane`/`Matrix3`/`Matrix4`/`Raycaster`/`Sprite` while its only
|
|
124
|
+
* import is `Vector3`, and every one of those resolves to `any` here.
|
|
125
|
+
*
|
|
126
|
+
* The distinction this draws is the whole point: a tag the checker CAN read is
|
|
127
|
+
* the program stating a type, and stops a census exactly as a TS annotation
|
|
128
|
+
* does. A tag that resolves to nothing is the program stating a type this
|
|
129
|
+
* compiler failed to resolve -- refusing the declaration for it is refusing it
|
|
130
|
+
* for a fact that is not there. `parameter-bindings.ts` has drawn this
|
|
131
|
+
* distinction since the call-site census landed; `return-bindings.ts` and
|
|
132
|
+
* `local-bindings.ts` did not, and bailed on the mere PRESENCE of a tag, which
|
|
133
|
+
* is why 48 of the app's three.js returns stayed `any` while the identical
|
|
134
|
+
* shape on a parameter was rescued. One predicate, three censuses.
|
|
135
|
+
*/
|
|
136
|
+
/**
|
|
137
|
+
* The type one member of `receiver` produces, or `null` when nothing usable
|
|
138
|
+
* comes back.
|
|
139
|
+
*
|
|
140
|
+
* ONE copy, shared by all three censuses. `parameter-bindings.ts`,
|
|
141
|
+
* `local-bindings.ts` and `field-bindings.ts` each carried a private,
|
|
142
|
+
* byte-identical version of this -- three authorities on one question, which
|
|
143
|
+
* is the defect class this compiler keeps rediscovering. The bug below lived
|
|
144
|
+
* in all three at once precisely because fixing it in one would not have been
|
|
145
|
+
* visible in the others.
|
|
146
|
+
*
|
|
147
|
+
* ## The receiver's own null is not part of the question
|
|
148
|
+
*
|
|
149
|
+
* `getPropertyOfType` on a UNION answers only with properties every member
|
|
150
|
+
* has, and `null` has none -- so `_gl.R32F`, where `_gl` is
|
|
151
|
+
* `NativeWebGL2RenderingContext | null`, came back with no property at all and
|
|
152
|
+
* the whole chain below it refused. That is not the program being unreadable;
|
|
153
|
+
* it is the question being asked of the wrong type. A member read either runs
|
|
154
|
+
* with a non-null receiver or does not run, so what the read PRODUCES is the
|
|
155
|
+
* member of the non-null receiver -- exactly what TypeScript itself answers
|
|
156
|
+
* once flow narrowing has done its work, and `structural-layout-type.ts`
|
|
157
|
+
* already asks it this way.
|
|
158
|
+
*
|
|
159
|
+
* Stripping the null cannot make an answer worse: where the receiver has no
|
|
160
|
+
* null, `getNonNullableType` is the identity, and where it does, the
|
|
161
|
+
* alternative was `null` -- the boxed carrier -- rather than some other type.
|
|
162
|
+
*
|
|
163
|
+
* Measured on the three.js app: 52 boxed identifier reads hang off `WebGLTextures.js`'s
|
|
164
|
+
* `internalFormat` cell alone, whose every write is a `_gl.<CONSTANT>` read.
|
|
165
|
+
*/
|
|
166
|
+
/**
|
|
167
|
+
* `resolved` when it names ONE calling convention, the convention this call
|
|
168
|
+
* site actually selected when it does not, and `null` when neither.
|
|
169
|
+
*
|
|
170
|
+
* A member can land on a method declaring more than one signature, and there is
|
|
171
|
+
* no primitive joining two overloads into one: substituting the overloaded type
|
|
172
|
+
* trades a `dynamic` carrier for an `unresolved` one -- lattice BOTTOM -- which
|
|
173
|
+
* trips `representation/verify.ts`'s `unresolved-reaches-materialization`
|
|
174
|
+
* guard. That guard is right; the defect is asking the question of the wrong
|
|
175
|
+
* node.
|
|
176
|
+
*
|
|
177
|
+
* A member read that IS a call's callee does not need its overloads joined: the
|
|
178
|
+
* program picked one, with its arguments, and TypeScript resolves exactly that
|
|
179
|
+
* with `getResolvedSignature`. Reading the type back off the selected
|
|
180
|
+
* signature's own declaration yields a single-signature function type -- the
|
|
181
|
+
* real convention this call uses. `string.split( '\n' )` in `WebGLProgram.js`
|
|
182
|
+
* is the whole of it: two `String.prototype.split` overloads, one call.
|
|
183
|
+
*
|
|
184
|
+
* NOT the refuted overload-selector. That one lived inside
|
|
185
|
+
* `resolvedCalleeSignatureType`, where the receiver had collapsed to `never` --
|
|
186
|
+
* so the overload set was a phantom and joining its arms answered a question
|
|
187
|
+
* the program never asked. Here the receiver is a real type a census bound, the
|
|
188
|
+
* overloads are real, and the SELECTION is TypeScript's own rather than one
|
|
189
|
+
* reimplemented here.
|
|
190
|
+
*
|
|
191
|
+
* An overloaded member NOT in callee position keeps its box: nothing at that
|
|
192
|
+
* site says which signature the value stands for, and guessing would give it a
|
|
193
|
+
* convention the program never chose.
|
|
194
|
+
*/
|
|
195
|
+
/**
|
|
196
|
+
* The type an ELEMENT read produces, when the key is not a name.
|
|
197
|
+
*
|
|
198
|
+
* `lights[ i ]`, `state.probe[ j ]`, `array[ i ]` -- the census resolvers
|
|
199
|
+
* handled only a STRING-LITERAL key, which is a named member spelled with
|
|
200
|
+
* brackets. Every other key was refused, and on the three.js app that is 470 boxed
|
|
201
|
+
* identifier reads at the root of the chain plus everything downstream of
|
|
202
|
+
* them: `const light = lights[ i ]` is the single largest one.
|
|
203
|
+
*
|
|
204
|
+
* A key not known until runtime is answered by the receiver's INDEX signature,
|
|
205
|
+
* which is the only thing that CAN answer it -- and an array's element type is
|
|
206
|
+
* exactly its numeric index signature, so `Light[]` indexed by a `number`
|
|
207
|
+
* yields `Light` with no array special-case. Which signature to ask is decided
|
|
208
|
+
* by the key's own type, resolved by the caller's own operand resolver so each
|
|
209
|
+
* census keeps its own view of what a key expression holds.
|
|
210
|
+
*
|
|
211
|
+
* A receiver with no index signature for that key comes back `null` and stays
|
|
212
|
+
* boxed: the read is then something this cannot describe, and an array whose
|
|
213
|
+
* element type TypeScript inferred as `any` is `any` again by the
|
|
214
|
+
* `isUnusableEvidence` test below rather than an improvement -- except where
|
|
215
|
+
* the caller hands over the program's value-flow index and that index proves
|
|
216
|
+
* a NUMBER key can name nothing any instance of the receiver's class family
|
|
217
|
+
* will ever hold (`absentNumericIndexTypeOf`): the read is then `undefined`.
|
|
218
|
+
*/
|
|
219
|
+
export declare const indexedTypeOf: (checker: ts.TypeChecker, receiver: ts.Type, key: ts.Type, at: ts.Node, flow?: ValueFlowIndex, census?: SettledReceiverCensus | null) => ts.Type | null;
|
|
220
|
+
/**
|
|
221
|
+
* A settled binding census, asked for the value set of a keyed-write receiver
|
|
222
|
+
* the checker types `any` -- the same question `flow/class-family-member-read.ts`
|
|
223
|
+
* asks its `FamilyReceiverCensus`, stated here structurally so the import
|
|
224
|
+
* direction stays one way.
|
|
225
|
+
*/
|
|
226
|
+
export interface SettledReceiverCensus {
|
|
227
|
+
readonly typeAt: (node: ts.Node) => ts.Type | null;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Whether a numeric element read is proven to miss every owned class-family
|
|
231
|
+
* instance. This is deliberately separate from `indexedTypeOf`: an
|
|
232
|
+
* `undefined` result can also come from an ordinary index signature or a
|
|
233
|
+
* checker-derived type, neither of which licenses bypassing the runtime
|
|
234
|
+
* property lookup.
|
|
235
|
+
*/
|
|
236
|
+
export declare const numericIndexAbsenceProven: (checker: ts.TypeChecker, flow: ValueFlowIndex, receiver: ts.Type, key: ts.Type, census?: SettledReceiverCensus | null) => boolean;
|
|
237
|
+
/**
|
|
238
|
+
* Whether a NAMED property read is proven to miss every instance of a closed
|
|
239
|
+
* object-literal record -- `numericIndexAbsenceProven`'s counterpart for a
|
|
240
|
+
* named key instead of a numeric one. Deliberately separate from
|
|
241
|
+
* `memberTypeOf`: an `undefined` answer there can also come from an ordinary
|
|
242
|
+
* declared member or an array index signature, neither of which licenses a
|
|
243
|
+
* PRODUCER skipping the runtime property lookup and constant-folding the read
|
|
244
|
+
* -- only THIS proof does, which is why `producers/properties.ts` asks it
|
|
245
|
+
* directly rather than re-deriving "was it the absence arm" from
|
|
246
|
+
* `memberTypeOf`'s result.
|
|
247
|
+
*/
|
|
248
|
+
export declare const closedLiteralMemberAbsenceProven: (checker: ts.TypeChecker, flow: ValueFlowIndex, receiver: ts.Type, name: string, at: ts.Node) => boolean;
|
|
249
|
+
/**
|
|
250
|
+
* The literal member NAME an element access spells, or `null` when its key is
|
|
251
|
+
* not a literal. `x[ 'name' ]` and `x[ 0 ]` are named reads written with
|
|
252
|
+
* brackets and resolve exactly as `x.name` does.
|
|
253
|
+
*/
|
|
254
|
+
export declare const literalMemberNameOf: (node: ts.ElementAccessExpression) => string | null;
|
|
255
|
+
/**
|
|
256
|
+
* The one overload of `resolved` whose declared parameter count admits this
|
|
257
|
+
* call's argument count, or `null` when none or several do.
|
|
258
|
+
*
|
|
259
|
+
* Asked only when the checker resolved the call to a signature with NO
|
|
260
|
+
* declaration -- its fabricated any-call, which is what a call through an
|
|
261
|
+
* `any` receiver gets. The RECEIVER here is census-typed (`memberTypeOf` was
|
|
262
|
+
* handed it), so the member's overload set is real and only the checker's own
|
|
263
|
+
* choice among its members is missing. Counting arguments is the checker's own
|
|
264
|
+
* first step (`chooseOverload` discards every candidate the count rules out
|
|
265
|
+
* before comparing one type), so it is the step that can be repeated without
|
|
266
|
+
* the receiver the checker refused to type; a tie keeps the set whole. Three's
|
|
267
|
+
* `LOD.addLevel` is the measured case: `levels` is a descriptor-defined field
|
|
268
|
+
* the checker declares nothing for, and `levels.splice( l, 0, level )` chose
|
|
269
|
+
* the two-parameter overload by joining, so the item reached the emitter
|
|
270
|
+
* unpacked -- `Array.prototype.splice`'s renderer refused it by name.
|
|
271
|
+
*/
|
|
272
|
+
export declare const arityAdmittedSignature: (resolved: ts.Type, call: ts.CallExpression) => ts.Signature | null;
|
|
273
|
+
export declare const singleConventionAt: (checker: ts.TypeChecker, resolved: ts.Type, node: ts.Node) => ts.Type | null;
|
|
274
|
+
/** The result of an authenticated `.call`/`.apply`, read from its already-resolved underlying callable. */
|
|
275
|
+
export declare const explicitThisCallReturnType: (fallback: ts.Signature, underlying: ts.Type | null) => ts.Type;
|
|
276
|
+
/**
|
|
277
|
+
* An overload-independent result is knowable even when its physical call
|
|
278
|
+
* convention is not. Read every declared return through the same recovered
|
|
279
|
+
* receiver type; no overload is selected and no callable carrier is changed.
|
|
280
|
+
* Generic signatures remain the checker's instantiation question.
|
|
281
|
+
*/
|
|
282
|
+
export declare const overloadInvariantReturnTypeAt: (checker: ts.TypeChecker, call: ts.CallExpression | ts.NewExpression, read: (node: ts.Expression) => ts.Type | null) => ts.Type | null;
|
|
283
|
+
export declare const memberTypeOf: (checker: ts.TypeChecker, receiver: ts.Type, name: string, at: ts.Node, flow?: ValueFlowIndex) => ts.Type | null;
|
|
284
|
+
/**
|
|
285
|
+
* Whether a JSDoc tag resolved to nothing AT ALL -- `any` or `unknown`.
|
|
286
|
+
*
|
|
287
|
+
* Not the whole question a cell has; see `jsDocTypeStatesNothing`, which is
|
|
288
|
+
* what every cell should ask. This is only the arm that is specific to a TAG:
|
|
289
|
+
* a tag naming a type this module cannot import degrades to `any`. A tag
|
|
290
|
+
* that SPELLS `unknown` (`{unknown}`, `{?}`) is not that degradation -- it is
|
|
291
|
+
* the author's own statement, exactly as a real `unknown` annotation is
|
|
292
|
+
* (`annotationStatesNothing`), and is answered `false` below so the two
|
|
293
|
+
* spellings of one statement get one census answer.
|
|
294
|
+
*/
|
|
295
|
+
export declare const jsDocTypeIsUninformative: (checker: ts.TypeChecker, typeNode: ts.TypeNode) => boolean;
|
|
296
|
+
/**
|
|
297
|
+
* Whether a JSDoc tag states nothing about storage -- the ONE test every cell
|
|
298
|
+
* asks of a tag, tag-specific degradation plus the identical vacuity rule a
|
|
299
|
+
* real annotation gets.
|
|
300
|
+
*
|
|
301
|
+
* Four cells asked this and each asked it differently:
|
|
302
|
+
* `parameter-bindings.ts` had a private copy that added `isEmptyObjectType`,
|
|
303
|
+
* while `return-bindings.ts`, `field-bindings.ts` and `local-bindings.ts`
|
|
304
|
+
* asked `jsDocTypeIsUninformative` alone -- so a `@param {{}}` tag was
|
|
305
|
+
* non-evidence at one cell and a stated type at the other three. Ordinary
|
|
306
|
+
* drift, of the shape this compiler keeps finding.
|
|
307
|
+
*
|
|
308
|
+
* The measured hole all four shared is `{Object}`. Three separate comments in
|
|
309
|
+
* this file asserted that TypeScript's JSDoc parser maps a capitalized
|
|
310
|
+
* `{Object}` tag to `any`, so `jsDocTypeIsUninformative` would catch it and
|
|
311
|
+
* `isGlobalObjectInterface` was documented as "not reachable from JSDoc".
|
|
312
|
+
* That is false, measured on three's `UniformsUtils.js`:
|
|
313
|
+
*
|
|
314
|
+
* @return {Object} The cloned uniforms.
|
|
315
|
+
* export function cloneUniforms( src ) { const dst = {}; ... return dst }
|
|
316
|
+
*
|
|
317
|
+
* `getReturnTypeOfSignature` answers the REAL `lib.es5.d.ts` `Object`
|
|
318
|
+
* interface -- 7 properties, `TypeFlags.Object`, not `any` and not empty. So
|
|
319
|
+
* it passed every vacuity test, became the return cell's stated answer, and
|
|
320
|
+
* the honest `dictionary` the body builds had to convert to a named record
|
|
321
|
+
* with zero members (every one of `Object`'s members is an ambient method
|
|
322
|
+
* `structural.ts` drops). No backend can render that pair, and the whole
|
|
323
|
+
* uniforms chain downstream of it -- `parameters.uniforms`,
|
|
324
|
+
* `materialProperties.uniforms`, and the 338 boxed carriers of
|
|
325
|
+
* `WebGLMaterials.js`'s `refreshUniforms*( uniforms, material )` -- was
|
|
326
|
+
* dynamic because of one tag.
|
|
327
|
+
*
|
|
328
|
+
* Recording that premise as false is the finding; making the tag path REFUSE
|
|
329
|
+
* an `{Object}` is not the cure, and the inline comment below carries the
|
|
330
|
+
* measurement that rules it out.
|
|
331
|
+
*/
|
|
332
|
+
export declare const jsDocTypeStatesNothing: (checker: ts.TypeChecker, typeNode: ts.TypeNode) => boolean;
|
|
333
|
+
/**
|
|
334
|
+
* Whether a resolved type is a structural object type with ZERO evidence in
|
|
335
|
+
* it: no properties, no call signature, no construct signature, no index
|
|
336
|
+
* signature.
|
|
337
|
+
*
|
|
338
|
+
* Lived in `parameter-bindings.ts` until `return-bindings.ts` needed the same
|
|
339
|
+
* question; moved here -- the module both already share for
|
|
340
|
+
* `jsDocTypeIsUninformative` and `widestOf` -- rather than copied, so the two
|
|
341
|
+
* cannot drift.
|
|
342
|
+
*
|
|
343
|
+
* `jsDocTypeIsUninformative` above catches a tag that resolves to
|
|
344
|
+
* `any`/`unknown` -- an unimported cross-module name, or the JSDoc-special
|
|
345
|
+
* `Object`/`object`. It does NOT catch this: three writes `@param {Object}
|
|
346
|
+
* data` for `InterleavedBuffer.clone( data )`, and
|
|
347
|
+
* `declaration-overlay-transform.ts`'s `replaceVagueParamTags` correctly
|
|
348
|
+
* prefers the SHIPPED declaration's answer over that vague tag -- but the
|
|
349
|
+
* shipped declaration (`@types/three`) states `clone(data: {}): ...`, and
|
|
350
|
+
* `{}` is itself a type with nothing IN it. The overlay's replacement is a
|
|
351
|
+
* real improvement in the general case (`Material.fromJSON`'s `json` gets a
|
|
352
|
+
* real `MaterialJSON`); here it swaps one uninformative spelling for another,
|
|
353
|
+
* and without this check the resolved `{}` reads as "the program stated a
|
|
354
|
+
* real type" and stays excluded from the call-site census forever, even
|
|
355
|
+
* though it states precisely as much as `any` does about what the parameter
|
|
356
|
+
* holds.
|
|
357
|
+
*
|
|
358
|
+
* The same non-evidence `parameter-bindings.ts`'s `isBareFunctionType`
|
|
359
|
+
* already is for a type with zero CALLING convention, generalized to zero
|
|
360
|
+
* MEMBER convention.
|
|
361
|
+
*/
|
|
362
|
+
export declare const isEmptyObjectType: (type: ts.Type) => boolean;
|
|
363
|
+
/**
|
|
364
|
+
* Whether `type` IS the standard library's `name` interface -- by declaration
|
|
365
|
+
* identity, never by the symbol's own spelling. See `standardInterfaceSymbol`.
|
|
366
|
+
*/
|
|
367
|
+
export declare const isStandardInterfaceType: (checker: ts.TypeChecker, anchor: ts.Node, name: string, type: ts.Type) => boolean;
|
|
368
|
+
/**
|
|
369
|
+
* Whether a type is the global `Object` INTERFACE -- `x: Object`, spelled as a
|
|
370
|
+
* real TypeScript annotation.
|
|
371
|
+
*
|
|
372
|
+
* The exact argument `parameter-bindings.ts`'s `isBareFunctionType` makes for
|
|
373
|
+
* bare `Function`, one level up: `Object` declares only what every value
|
|
374
|
+
* already has (`toString`, `valueOf`, `hasOwnProperty`), every non-null value
|
|
375
|
+
* is assignable to it, and it therefore states nothing about what this
|
|
376
|
+
* particular value holds. Resolved by DECLARATION IDENTITY (`isStandardInterfaceType`),
|
|
377
|
+
* so a user interface that merely declares those members -- and would once
|
|
378
|
+
* have matched on the bare spelling `'Object'` -- is not swept in beside it;
|
|
379
|
+
* only the library's own `Object` is.
|
|
380
|
+
*
|
|
381
|
+
* Reachable from JSDoc TOO, contrary to what this comment said for a long
|
|
382
|
+
* time. A capitalized `{Object}` tag does NOT degrade to `any`: measured on
|
|
383
|
+
* three's `@return {Object}`, the checker answers this very interface. See
|
|
384
|
+
* `jsDocTypeStatesNothing`, which is what makes the tag path ask.
|
|
385
|
+
*
|
|
386
|
+
* `normalize/structural.ts` interns exactly THIS interface as `any`, and the
|
|
387
|
+
* two obvious companions to it are measured DEAD LEVERS, recorded here so the
|
|
388
|
+
* next session does not re-derive them:
|
|
389
|
+
*
|
|
390
|
+
* - an anonymous `{}` (empty, no signatures, no index, excluding fresh object
|
|
391
|
+
* literals, which share the identical type and are real values whose shape
|
|
392
|
+
* the object-bag and collection censuses discover): the three.js app's unmet
|
|
393
|
+
* obligations went 33 UP to 34 and `boxed` 17190 -> 17568. `{}` is the
|
|
394
|
+
* checker's answer for a great many things that are not "unstated" at all --
|
|
395
|
+
* an intersection reduced to nothing, a mapped type over no keys, a bag
|
|
396
|
+
* before its census runs -- and boxing all of them costs more pairings than
|
|
397
|
+
* it closes.
|
|
398
|
+
* - the lowercase `object` KEYWORD (`TypeFlags.NonPrimitive`), which really is
|
|
399
|
+
* one unambiguous spelling and really does state nothing: exactly NEUTRAL on
|
|
400
|
+
* unmet obligations (33 -> 33) at `boxed` +103. A cost with no return.
|
|
401
|
+
*
|
|
402
|
+
* Both remain correct as statements about what those types SAY. Neither is
|
|
403
|
+
* worth what it costs as a carrier decision.
|
|
404
|
+
*/
|
|
405
|
+
export declare const isGlobalObjectInterface: (checker: ts.TypeChecker, anchor: ts.Node, type: ts.Type) => boolean;
|
|
406
|
+
/**
|
|
407
|
+
* Whether `type` is the standard library's `ObjectConstructor` interface --
|
|
408
|
+
* the type the global `Object` VALUE has, as opposed to `isGlobalObjectInterface`'s
|
|
409
|
+
* `Object` INSTANCE interface immediately above.
|
|
410
|
+
*
|
|
411
|
+
* Exported so the two call sites that ask "is this call really `Object.assign`
|
|
412
|
+
* on the real global" (`flow/value-flow.ts`'s `isGlobalObjectAssign`,
|
|
413
|
+
* `object-bag-bindings.ts`'s `isGlobalObjectAssignCall`) ask one shared
|
|
414
|
+
* question instead of two byte-for-byte-identical copies of it, each
|
|
415
|
+
* comparing `checker.getTypeAtLocation(callee.expression).getSymbol()?.getName()`
|
|
416
|
+
* against the literal string `'ObjectConstructor'`.
|
|
417
|
+
*/
|
|
418
|
+
export declare const isGlobalObjectConstructor: (checker: ts.TypeChecker, anchor: ts.Node, type: ts.Type) => boolean;
|
|
419
|
+
/** The standard global Function constructor value, by ambient declaration identity. */
|
|
420
|
+
export declare const isGlobalFunctionConstructor: (checker: ts.TypeChecker, anchor: ts.Node, type: ts.Type) => boolean;
|
|
421
|
+
/** The standard global Array constructor value, by ambient declaration identity. */
|
|
422
|
+
export declare const isGlobalArrayConstructor: (checker: ts.TypeChecker, anchor: ts.Node, type: ts.Type) => boolean;
|
|
423
|
+
/** A standard global namespace value, resolved by symbol identity rather than spelling. */
|
|
424
|
+
export declare const isStandardGlobalValue: (checker: ts.TypeChecker, expression: ts.Expression, name: string) => boolean;
|
|
425
|
+
/**
|
|
426
|
+
* The target type of an authenticated `Object.assign` call with at least one source.
|
|
427
|
+
*
|
|
428
|
+
* The ambient signature's `T & U` result describes which properties source
|
|
429
|
+
* code may read after the copy. The runtime value is still `T`: ECMA-262
|
|
430
|
+
* mutates and returns the first argument. Every binding census has to read
|
|
431
|
+
* that identity the same way, or one census publishes the intersection while
|
|
432
|
+
* the invocation producer publishes the target and creates a conversion
|
|
433
|
+
* between two carriers for one object. The extra keys live in the native
|
|
434
|
+
* target's dynamic-property sidecar; changing the value's carrier is neither
|
|
435
|
+
* necessary nor correct.
|
|
436
|
+
*
|
|
437
|
+
* A primitive target is excluded because Object.assign first boxes it, and
|
|
438
|
+
* this backend does not implement wrapper-object carriers.
|
|
439
|
+
*/
|
|
440
|
+
export declare const objectAssignTargetType: (checker: ts.TypeChecker, node: ts.Node) => ts.Type | null;
|
|
441
|
+
/**
|
|
442
|
+
* The object `Object.assign( {}, ...sources )` builds, when `literal` is that
|
|
443
|
+
* bare `{}`.
|
|
444
|
+
*
|
|
445
|
+
* `objectAssignTargetType`'s identity argument holds for a target that exists
|
|
446
|
+
* before the call: the value returned IS that object, so its carrier is that
|
|
447
|
+
* object's own, extra keys in the sidecar. A bare empty literal written in the
|
|
448
|
+
* target position has no carrier of its own to keep. It is allocated for this
|
|
449
|
+
* call, observed nowhere else, and the one statement anywhere of what it holds
|
|
450
|
+
* afterwards is the call's own `T & U` -- which the checker has already
|
|
451
|
+
* reduced, dropping the empty member (`{} & Record<string, number[]>` reports
|
|
452
|
+
* as `Record<string, number[]>`). Publishing the literal's own `{}` in its
|
|
453
|
+
* place put an empty record on one side of the copy and a dictionary on the
|
|
454
|
+
* other: three's `Object.assign( {}, source.defines )` then refused for want of
|
|
455
|
+
* a record<-dictionary arm, and no such arm can exist, since an empty struct
|
|
456
|
+
* has nowhere to put a key.
|
|
457
|
+
*
|
|
458
|
+
* Read by BOTH the call's result (`objectAssignTargetType`) and the literal's
|
|
459
|
+
* own layout (`structural-layout-type.ts`), so the target and the value it
|
|
460
|
+
* becomes are one carrier by construction. A literal with properties keeps its
|
|
461
|
+
* own shape -- it states one -- and so does a literal under an assertion.
|
|
462
|
+
*/
|
|
463
|
+
export declare const objectAssignFreshTargetType: (checker: ts.TypeChecker, literal: ts.ObjectLiteralExpression) => ts.Type | null;
|
|
464
|
+
/**
|
|
465
|
+
* `type` with every vacuous member dropped, or `null` when nothing is left.
|
|
466
|
+
*
|
|
467
|
+
* `annotationStatesNothing` answers "is this type ENTIRELY a non-statement",
|
|
468
|
+
* which is the right question for evidence: a type that says nothing must not
|
|
469
|
+
* become the answer. It is the wrong question for a JOIN with a vacuous
|
|
470
|
+
* member ALONGSIDE a real one -- `{} | E['Bindings'] | undefined`, the first
|
|
471
|
+
* element of the tuple TypeScript gives hono's `fetch(request, ...rest)`.
|
|
472
|
+
* That type is not entirely vacuous (the indexed access is a statement), yet
|
|
473
|
+
* the `{}` inside it still makes EVERY object type assignable to the whole,
|
|
474
|
+
* so a `widestOf` join hands it back as "the" type and the other elements --
|
|
475
|
+
* `ExecutionContext` -- vanish without a trace.
|
|
476
|
+
*
|
|
477
|
+
* The caller's use is a re-test, never an answer: strip the vacuous parts and
|
|
478
|
+
* ask whether the coverage survives. If it does, the join was real; if it
|
|
479
|
+
* does not, the coverage was `{}`'s alone and the join has to state the union
|
|
480
|
+
* instead. Nothing published to representation is ever the stripped type --
|
|
481
|
+
* that would be the opposite error, narrowing a slot below what the program
|
|
482
|
+
* annotated.
|
|
483
|
+
*/
|
|
484
|
+
export declare const withoutVacuousMembers: (checker: ts.TypeChecker, anchor: ts.Node | null, type: ts.Type) => ts.Type | null;
|
|
485
|
+
export declare const annotationStatesNothing: (checker: ts.TypeChecker, anchor: ts.Node, type: ts.Type) => boolean;
|
|
486
|
+
/**
|
|
487
|
+
* The exact type of an EMPTY object literal the program wrote as a value --
|
|
488
|
+
* `{}` in `const { fn = function () {} } = {}` -- or `null` for any other node.
|
|
489
|
+
*
|
|
490
|
+
* `annotationStatesNothing` above is right to treat the vacuous type `{}` as
|
|
491
|
+
* a non-statement when it arrives as an ANNOTATION or as a join member: every
|
|
492
|
+
* type is assignable to it, so it dominates. The same type on a literal the
|
|
493
|
+
* program EVALUATES is the opposite: a fresh object with exactly zero members,
|
|
494
|
+
* the most precise statement there is, and the one a destructuring pattern
|
|
495
|
+
* reads out of. Filtering it out there left every pattern over `{}` with no
|
|
496
|
+
* holder at all, so each leaf fell back to the checker's own `any` (the JS
|
|
497
|
+
* checker's answer for a key the literal lacks) and boxed the default it was
|
|
498
|
+
* meant to bind. A literal with spreads or properties is not this case: the
|
|
499
|
+
* ordinary literal type is already non-vacuous and needs no exception.
|
|
500
|
+
*/
|
|
501
|
+
export declare const exactEmptyObjectLiteralType: (checker: ts.TypeChecker, node: ts.Node) => ts.Type | null;
|
|
502
|
+
/**
|
|
503
|
+
* Whether a stated type has an unstated position ANYWHERE inside it, and so
|
|
504
|
+
* could be an upper bound rather than the last word.
|
|
505
|
+
*
|
|
506
|
+
* A pre-filter, not a judgement: `narrowsOnlyUnstatedPositions` below decides
|
|
507
|
+
* whether a particular value may narrow a particular statement. This only
|
|
508
|
+
* keeps a census from carrying every annotated declaration in the program as
|
|
509
|
+
* a candidate when almost none of them state nothing anywhere.
|
|
510
|
+
*/
|
|
511
|
+
export declare const containsUnstatedPosition: (checker: ts.TypeChecker, anchor: ts.Node, declared: ts.Type, depth?: number) => boolean;
|
|
512
|
+
/**
|
|
513
|
+
* WHETHER A STATED TYPE AND THE TYPE THAT ACTUALLY FLOWS INTO IT DIFFER ONLY
|
|
514
|
+
* WHERE THE STATEMENT SAID NOTHING.
|
|
515
|
+
*
|
|
516
|
+
* `annotationStatesNothing` is all-or-nothing about one annotation, which is
|
|
517
|
+
* the right question for a parameter written `: {}` and the wrong one for
|
|
518
|
+
* hono's `matchResult: Result<[unknown, RouterRoute]>`. That annotation states
|
|
519
|
+
* plenty -- a two-armed union of tuples of arrays of tuples -- and states
|
|
520
|
+
* NOTHING at exactly one leaf, the `unknown` where the handler goes. The
|
|
521
|
+
* program's only writer hands it `Result<[H, RouterRoute]>`, identical
|
|
522
|
+
* everywhere the annotation spoke and concrete at the one place it did not.
|
|
523
|
+
*
|
|
524
|
+
* Reading the annotation as the last word there is what forces a value that is
|
|
525
|
+
* already exactly right to be rebuilt into a boxed copy of itself -- through
|
|
526
|
+
* two arrays and three records, which is not a conversion any backend can
|
|
527
|
+
* render soundly (an array rebuild is a COPY, and a copy is not the array the
|
|
528
|
+
* caller passed). Reading it as an upper bound instead, satisfied at every
|
|
529
|
+
* position it constrains, is what lets the value stay itself.
|
|
530
|
+
*
|
|
531
|
+
* This is deliberately NOT "the actual type is assignable to the declared
|
|
532
|
+
* one". Assignability admits a narrowing at a position the program DID state
|
|
533
|
+
* -- `x: string | number` fed only strings -- and honoring the statement is
|
|
534
|
+
* this compiler's rule everywhere else. `checker.isTypeAssignableTo` is still
|
|
535
|
+
* required (the caller asks it), but it is the floor, not the test.
|
|
536
|
+
*/
|
|
537
|
+
export declare const narrowsOnlyUnstatedPositions: (checker: ts.TypeChecker, anchor: ts.Node, declared: ts.Type, actual: ts.Type, depth?: number) => boolean;
|
|
538
|
+
/**
|
|
539
|
+
* `T | undefined` -> `T`, and ONLY the `undefined` member: a `null` member is
|
|
540
|
+
* a different absence value and stays.
|
|
541
|
+
*
|
|
542
|
+
* Needed where a cell's contents and a READ of that cell disagree about an
|
|
543
|
+
* absence the language already resolved -- a DEFAULTED parameter, whose slot
|
|
544
|
+
* carries `undefined` (that is what the default exists to answer) and whose
|
|
545
|
+
* body binding cannot: `producers/bindings.ts`'s `contributeDefaultedParameter`
|
|
546
|
+
* strips it there from the compiler's own type table, and this is the same
|
|
547
|
+
* strip asked of a `ts.Type`, for the censuses that answer a body read.
|
|
548
|
+
*
|
|
549
|
+
* `getNonNullableType` is the wrong instrument -- it strips `null` too, and
|
|
550
|
+
* `p: T | null = null` is ordinary TypeScript whose body really does observe
|
|
551
|
+
* the `null`.
|
|
552
|
+
*/
|
|
553
|
+
export declare const withoutUndefinedMember: (checker: ts.TypeChecker, type: ts.Type) => ts.Type;
|
|
554
|
+
/** Whether `a` and `b` are the constructor objects of two different classes -- nominally distinct, whatever their shapes. */
|
|
555
|
+
export declare const isDistinctClassConstructorPair: (a: ts.Type, b: ts.Type) => boolean;
|
|
556
|
+
/** Shape subtyping cannot discard the identity of a class constructor selected at runtime. */
|
|
557
|
+
export declare const nominalConstructorChoiceTypeAt: (checker: ts.TypeChecker, node: ts.Node, read: (operand: ts.Expression) => ts.Type) => ts.Type | null;
|
|
558
|
+
export declare const widestOf: (checker: ts.TypeChecker, types: readonly ts.Type[]) => ts.Type | null;
|
|
559
|
+
/**
|
|
560
|
+
* The array carrier selected by the normalizing idiom
|
|
561
|
+
*
|
|
562
|
+
* Array.isArray(values[i]) ? values[i] : [values[i]]
|
|
563
|
+
* Array.isArray(data) ? data : [data]
|
|
564
|
+
*
|
|
565
|
+
* or `null` when the expression does not prove that one carrier.
|
|
566
|
+
*
|
|
567
|
+
* A binding census can know more about `values[i]` than TypeScript's checker
|
|
568
|
+
* does. Three's `UniformsGroup.copy` is the measured case: the census has
|
|
569
|
+
* `Uniform | Uniform[]`, while the JSDoc-backed array literal still has
|
|
570
|
+
* `Uniform[]`. The generic conditional join sees `Uniform | Uniform[]` and
|
|
571
|
+
* republishes that union, losing the fact the condition just established;
|
|
572
|
+
* the subsequent numeric read then correctly refuses a union whose scalar arm
|
|
573
|
+
* is not indexable.
|
|
574
|
+
*
|
|
575
|
+
* The rule is tied to the real global `Array.isArray`, to a repeated stable
|
|
576
|
+
* PURE READ -- a bare identifier, or one slot of one proven native Array --
|
|
577
|
+
* and to a one-element alternate containing that same read. The IDENTIFIER
|
|
578
|
+
* form is what a one-or-many parameter is normally written over -- hono's
|
|
579
|
+
* `node-server` websocket bridge is `const datas = Array.isArray(data) ?
|
|
580
|
+
* data : [data]` over `data: WebSocketData` -- and without it the join
|
|
581
|
+
* republished the whole union, so the `for (const data of datas)` that
|
|
582
|
+
* follows read an element off a carrier whose scalar arms are not indexable
|
|
583
|
+
* at all. Every array arm already discovered for the slot must fit the
|
|
584
|
+
* alternate's array type. Thus the answer is the carrier both reachable arms
|
|
585
|
+
* share; this does not turn a general predicate or a mutable/accessor read
|
|
586
|
+
* into a narrowing.
|
|
587
|
+
*/
|
|
588
|
+
export declare const normalizedArrayConditionalType: (checker: ts.TypeChecker, node: ts.ConditionalExpression, read: (operand: ts.Expression) => ts.Type | null) => ts.Type | null;
|
|
589
|
+
/**
|
|
590
|
+
* The type an `arg is any[]` predicate REALLY establishes, when the checker
|
|
591
|
+
* answered with the intersection it falls back to.
|
|
592
|
+
*
|
|
593
|
+
* `Array.isArray`'s `lib.es5.d.ts` signature is `isArray(arg: any): arg is
|
|
594
|
+
* any[]`, and TypeScript narrows a union by a predicate by KEEPING the
|
|
595
|
+
* constituents assignable to the predicate's type. Where none is, it does not
|
|
596
|
+
* answer `never` -- it answers the INTERSECTION `T & any[]`, distributed over
|
|
597
|
+
* `T`'s arms, and every read through it is typed `any`:
|
|
598
|
+
*
|
|
599
|
+
* Array.isArray(value) ? value[0] : value // value: string
|
|
600
|
+
* Array.isArray(pattern) ? pattern[0] : p // readonly [...] | '*'
|
|
601
|
+
*
|
|
602
|
+
* (`@hono/node-server`'s `createUpgradeRequest` and hono's trie router; a
|
|
603
|
+
* `readonly` tuple is not assignable to the mutable `any[]` either, so the
|
|
604
|
+
* fallback fires for a type that IS an array.) That `any` is an artifact of a
|
|
605
|
+
* failed narrowing, not a boundary the program declared: the value is a
|
|
606
|
+
* `std::string` or a fixed tuple and the read has a stated answer either way.
|
|
607
|
+
* Carried as `dynamic` it reached the backend as a result with no absence
|
|
608
|
+
* materialization, and boxing the read to make it compile is the shortcut this
|
|
609
|
+
* compiler does not take.
|
|
610
|
+
*
|
|
611
|
+
* `any[]` states no carrier at all (`isUnusableEvidence`), so intersecting
|
|
612
|
+
* with it adds nothing physical; what it adds is the assertion that the value
|
|
613
|
+
* is an array HERE. So the answer is the array/tuple constituents of the rest
|
|
614
|
+
* -- and with none of those the predicate is statically false for a value that
|
|
615
|
+
* has a carrier, the arm is dead, and the honest type is the one the value
|
|
616
|
+
* already had. Only a SINGLE surviving subject is answered: two array arms
|
|
617
|
+
* would need a join this is not the place to take.
|
|
618
|
+
*/
|
|
619
|
+
export declare const arrayPredicateNarrowedTypeOf: (checker: ts.TypeChecker, type: ts.Type) => ts.Type | null;
|
|
620
|
+
/**
|
|
621
|
+
* The element an `x[k]` read produces when the checker typed it `any` only
|
|
622
|
+
* because `x` is standing in an `arg is any[]` narrowing's intersection.
|
|
623
|
+
*
|
|
624
|
+
* The key is answered off the narrowed subject exactly as any other read is:
|
|
625
|
+
* a literal key names a member (a tuple's `[0]` is its first element type,
|
|
626
|
+
* not the join of all of them), and anything else takes the receiver's own
|
|
627
|
+
* index signature -- `String`'s is `readonly [index: number]: string`, which
|
|
628
|
+
* is the carrier `stringIndexText`'s `charAt` already renders.
|
|
629
|
+
*/
|
|
630
|
+
export declare const arrayPredicateNarrowedElementTypeOf: (checker: ts.TypeChecker, node: ts.ElementAccessExpression) => ts.Type | null;
|
|
631
|
+
/**
|
|
632
|
+
* `node`'s own type, derived from its immediate operands via `read`.
|
|
633
|
+
*
|
|
634
|
+
* Handles exactly the composite shapes described in this file's header
|
|
635
|
+
* comment, and nothing else: this is a LEAF function, not a walker -- it
|
|
636
|
+
* asks `read` for each operand's type and combines the answers by the
|
|
637
|
+
* operator's own fixed rule, doing no traversal of its own beyond that one
|
|
638
|
+
* level. Every caller supplies its own `read` (its `known ?? resolve`), so
|
|
639
|
+
* this function's own recursion depth is always exactly one.
|
|
640
|
+
*/
|
|
641
|
+
export declare const derivedExpressionType: (checker: ts.TypeChecker, node: ts.Expression, read: (operand: ts.Expression) => ts.Type | null) => ts.Type | null;
|
|
642
|
+
export declare const isNullishType: (type: ts.Type) => boolean;
|
|
643
|
+
/**
|
|
644
|
+
* The join of a WRITE SET -- every value the program stores into one storage
|
|
645
|
+
* location -- once the two things `widestOf` reads as a disagreement but
|
|
646
|
+
* which are not one have been accounted for; or `null` when the writes
|
|
647
|
+
* genuinely do not agree.
|
|
648
|
+
*
|
|
649
|
+
* `widestOf` answers FIRST and unchanged, so every location bound today binds
|
|
650
|
+
* to exactly the same type; only a set it has already refused reaches the
|
|
651
|
+
* rest of this.
|
|
652
|
+
*
|
|
653
|
+
* ## A nullish write states ABSENCE, not a rival type
|
|
654
|
+
*
|
|
655
|
+
* `widestOf` asks whether one OBSERVED type covers every other, and under
|
|
656
|
+
* `strictNullChecks` no object type covers `null`. So the single commonest
|
|
657
|
+
* shape a write-set census exists for -- `let currentProgram = null;` filled
|
|
658
|
+
* in later with a real value and set back to `null` on teardown, or
|
|
659
|
+
* `this.view = null` in a constructor and a real object in a setter --
|
|
660
|
+
* refuses, attributed `writes-disagree`: the join read the location's own
|
|
661
|
+
* emptiness as a type competing for the slot. It is not one. Storage that is
|
|
662
|
+
* sometimes empty and otherwise holds `T` is exactly `T | null` -- the
|
|
663
|
+
* `optional(T, null)` carrier this compiler already has, not a union of its
|
|
664
|
+
* own making. Every constituent is still a type the program itself wrote.
|
|
665
|
+
*
|
|
666
|
+
* `getNullableType` is the checker's own constructor for that union, the
|
|
667
|
+
* same one `return-bindings.ts` uses for a `Map.get` result and
|
|
668
|
+
* `parameter-slot.ts` for a defaulted parameter, and it flattens -- so a
|
|
669
|
+
* write already typed `T | null` re-joins to `T | null` rather than nesting.
|
|
670
|
+
*
|
|
671
|
+
* The observed nullish FLAGS are carried through rather than fixed: writes
|
|
672
|
+
* holding `null` yield `T | null`, `undefined` yields `T | undefined`, both
|
|
673
|
+
* yield both. Answering `null` where the program only ever wrote `undefined`
|
|
674
|
+
* (or the reverse) would be inventing an inhabitant no census here may
|
|
675
|
+
* invent. And a set that is ENTIRELY nullish is left to `widestOf`, which
|
|
676
|
+
* already answers it on its own.
|
|
677
|
+
*
|
|
678
|
+
* ## A literal FORM is not a disagreement either
|
|
679
|
+
*
|
|
680
|
+
* The other shape is storage whose every write is a different LITERAL of one
|
|
681
|
+
* primitive: `let type;` in three's `WebGLAttributes.js` is written `5126`,
|
|
682
|
+
* `5131`, `5123`, `5122`, `5125`, `5124`, `5120`, `5121` -- eight writes,
|
|
683
|
+
* eight literal types, none covering another, refused. The storage question
|
|
684
|
+
* has an answer nobody has to invent: `number`. It is TypeScript's own
|
|
685
|
+
* answer too -- a `let` initialized with `5126` is widened to `number` by
|
|
686
|
+
* the language's mutable-binding rule, and the literal type survives here
|
|
687
|
+
* only because these censuses read the RIGHT-HAND SIDE expression rather
|
|
688
|
+
* than the declaration. `widenLiteral` above states the same rule for the
|
|
689
|
+
* same reason (`"a" + "b"` is `string`, not the literal `"ab"` nobody
|
|
690
|
+
* wrote). Tried only after the unwidened join has refused, so storage whose
|
|
691
|
+
* writes DO agree on a literal keeps it.
|
|
692
|
+
*
|
|
693
|
+
* ## Why this is shared rather than copied
|
|
694
|
+
*
|
|
695
|
+
* `local-bindings.ts` (a `let`/`var` cell) and `field-bindings.ts` (a class
|
|
696
|
+
* field) ask the identical question of two different declaration kinds, and
|
|
697
|
+
* a field written `null` in the constructor and filled in later is the same
|
|
698
|
+
* shape as the cell this landed for. Two copies of a join rule is the
|
|
699
|
+
* "two authorities" defect this compiler keeps paying for -- the same
|
|
700
|
+
* reasoning that made `annotationStatesNothing` shared. One rule, one file,
|
|
701
|
+
* asked by both.
|
|
702
|
+
*/
|
|
703
|
+
export declare const joinOfWrites: (checker: ts.TypeChecker, types: readonly ts.Type[]) => ts.Type | null;
|
|
704
|
+
/**
|
|
705
|
+
* A member with no evidence at all -- vetoes the whole set (see
|
|
706
|
+
* `disjointArmsOf`). Deliberately wider than `isUnusableEvidence` above:
|
|
707
|
+
* `unknown` is a genuine dynamic boundary here too, not merely a case that
|
|
708
|
+
* other join rules leave alone.
|
|
709
|
+
*
|
|
710
|
+
* Exported for `parameter-bindings.ts`'s `restElementTypeAt`: a rest
|
|
711
|
+
* parameter's own binding can be REASSIGNED in the body (`params =
|
|
712
|
+
* enhanceLogMessage(params)`), and that write is evidence about the SAME
|
|
713
|
+
* cell the call-site tail is joined into -- an `Array<any>`-returning
|
|
714
|
+
* reassignment is exactly the "genuine dynamic boundary" this test already
|
|
715
|
+
* names, not a second question needing its own copy of the flag set.
|
|
716
|
+
*/
|
|
717
|
+
export declare const carriesNoEvidence: (type: ts.Type) => boolean;
|
|
718
|
+
/**
|
|
719
|
+
* The DISTINCT, pairwise-disjoint members of `types` -- every one a real
|
|
720
|
+
* type, none of them subsuming another -- or `null` when the set cannot
|
|
721
|
+
* safely become one union.
|
|
722
|
+
*
|
|
723
|
+
* `joinOfWrites` above answers "is there ONE type every write agrees on".
|
|
724
|
+
* This is the question that only gets asked once that has already failed:
|
|
725
|
+
* is the DISAGREEMENT ITSELF the answer? `A | B | C`, where `A`, `B`, `C` are
|
|
726
|
+
* exactly the types the program's own write sites used, is not a guess when
|
|
727
|
+
* every one of them is real and none of them overlaps another -- it is
|
|
728
|
+
* precisely what the program does. This compiler's `tagged-union`
|
|
729
|
+
* representation (`representation/model.ts`) exists for it.
|
|
730
|
+
*
|
|
731
|
+
* Two members overlap when either is assignable to the other -- the SAME
|
|
732
|
+
* `checker.isTypeAssignableTo` `widestOf`'s own `agree` reads a single
|
|
733
|
+
* covering candidate from above, applied PAIRWISE instead of one-to-all.
|
|
734
|
+
* Assignable in one direction only is a subsumption (a literal `5` inside
|
|
735
|
+
* `number`, or one record type's fields a strict subset of another's) --
|
|
736
|
+
* accepting it would let a value that is honestly a `B` also match arm `A`,
|
|
737
|
+
* which is a mis-selection, not a conservative one, so the WHOLE set
|
|
738
|
+
* refuses rather than dropping the overlapping member. Assignable both ways
|
|
739
|
+
* is the same member spelled twice (two structurally-identical types, or
|
|
740
|
+
* two references to one declaration) and collapses to one arm silently,
|
|
741
|
+
* the same reduction `representation/union.ts`'s own `canonicalMembersOf`
|
|
742
|
+
* performs one layer down. Neither direction is exactly ECMAScript's own
|
|
743
|
+
* "no runtime value can satisfy both", which is the fact a tagged union's
|
|
744
|
+
* arms need to be told apart at all -- see that file's own module comment.
|
|
745
|
+
*
|
|
746
|
+
* A member that states no evidence at all (`any`/`unknown`/`void`/`never`)
|
|
747
|
+
* vetoes the whole set outright: unioning a real type with "nothing was
|
|
748
|
+
* declared" would launder the missing statement as if it were one more arm,
|
|
749
|
+
* and `void`/`never` are refusals about the STORAGE, not values competing
|
|
750
|
+
* for the slot.
|
|
751
|
+
*
|
|
752
|
+
* Cardinality is not missing evidence. Preserve every admitted member of a
|
|
753
|
+
* finite write set; representation planning owns its storage and dispatch
|
|
754
|
+
* costs. An earlier four-arm cutoff erased complete five-way inputs and
|
|
755
|
+
* made downstream forwarding indistinguishable from an unknown caller.
|
|
756
|
+
*/
|
|
757
|
+
export declare const disjointArmsOf: (checker: ts.TypeChecker, types: readonly ts.Type[]) => readonly ts.Type[] | null;
|
|
758
|
+
/**
|
|
759
|
+
* The full member list for a SYNTHESIZED union carrier, once `joinOfWrites`
|
|
760
|
+
* has already refused -- every present (non-nullish) write partitioned the
|
|
761
|
+
* identical way `joinOfWrites` partitions them, checked for disjointness via
|
|
762
|
+
* `disjointArmsOf`, with the observed absence values (`null`/`undefined`)
|
|
763
|
+
* carried through UNCHANGED as members rather than folded into a flag here.
|
|
764
|
+
*
|
|
765
|
+
* That last point is deliberate, not an oversight: this function answers a
|
|
766
|
+
* STRUCTURAL question ("what are this union's members"), not a `ts.Type`
|
|
767
|
+
* one -- `ts.TypeChecker.getUnionType` is not on the public surface (see
|
|
768
|
+
* `absent-globals.ts` and `producers/bindings.ts`'s own comments on the same
|
|
769
|
+
* wall), so unlike `joinOfWrites` this cannot hand back one `ts.Type` a
|
|
770
|
+
* caller re-derives structurally. It hands back the member LIST instead, for
|
|
771
|
+
* a caller that is about to `table.intern({ kind: 'union', members:
|
|
772
|
+
* list.map(typeOf) })` directly -- and `representation/union.ts`'s own
|
|
773
|
+
* `deriveUnion` already partitions absent members from present ones and
|
|
774
|
+
* wraps the result in `optional` exactly as `joinOfWrites` would have, so
|
|
775
|
+
* passing the nullish members through as ordinary list entries here, rather
|
|
776
|
+
* than pre-collapsing them, is asking that ONE authority to do it once
|
|
777
|
+
* instead of a second copy of the same partition living here too.
|
|
778
|
+
*/
|
|
779
|
+
export declare const disjointUnionMembersOf: (checker: ts.TypeChecker, types: readonly ts.Type[]) => readonly ts.Type[] | null;
|
|
780
|
+
/**
|
|
781
|
+
* `disjointUnionMembersOf`, answered as ONE `ts.Type` -- for a census whose
|
|
782
|
+
* contract is a `ts.Type` and whose every consumer reads one.
|
|
783
|
+
*
|
|
784
|
+
* `collection-bindings.ts`'s array-element census is that census: every
|
|
785
|
+
* sibling write-set census (a `let` cell, a class field, a parameter, a
|
|
786
|
+
* return) already answers a disagreeing write set as a disjoint tagged union
|
|
787
|
+
* through its own `unionArmsAt` channel, while the array census asked
|
|
788
|
+
* `joinOfWrites` alone and REFUSED the same disagreement
|
|
789
|
+
* (`array:elements-disagree`). `var xs = []; xs.push(1); xs.push('a')` is the
|
|
790
|
+
* shape: the array's storage fell to the box, and every `push` boxed its
|
|
791
|
+
* argument on the way in, for a program that declared nothing dynamic.
|
|
792
|
+
*
|
|
793
|
+
* Two things make the `ts.Type` form the right one here rather than a fourth
|
|
794
|
+
* arms channel. The census's array answers travel through `arrayElementAt`/
|
|
795
|
+
* `arrayElementForRead`/`arrayElementForOwner` into three other censuses that
|
|
796
|
+
* read a `ts.Type` (`local-bindings.ts`, `return-bindings.ts`,
|
|
797
|
+
* `field-bindings.ts`), so a list would leave every one of them answering the
|
|
798
|
+
* checker's `any` for a union the storage already carries. And the checker's
|
|
799
|
+
* OWN evolving-array machinery settles the SAME array to the SAME union at
|
|
800
|
+
* every reference it can finalize (`xs.join(...)` after the pushes is `(string
|
|
801
|
+
* | number)[]` there): TypeScript widens each pushed value off its literal form
|
|
802
|
+
* (`addEvolvingArrayElementType`, `getBaseTypeOfLiteralType`) and unions the
|
|
803
|
+
* results. Building the union through the checker from the identically
|
|
804
|
+
* widened members yields the IDENTICAL `ts.Type` object (verified: `built ===
|
|
805
|
+
* settled` for `[number, string, boolean]`), so the storage the census types,
|
|
806
|
+
* the reads the checker settled, and the `push` slots
|
|
807
|
+
* (`structural.ts`'s `evolvingArrayMemberTypeAt`) intern to one structural
|
|
808
|
+
* type with no conversion between them. An arms list interned separately
|
|
809
|
+
* could not promise that.
|
|
810
|
+
*
|
|
811
|
+
* Widening is therefore part of the rule, not a convenience: unwidened, `1`
|
|
812
|
+
* and `"a"` are two disjoint LITERAL arms, and a storage of `1 | "a"` would be
|
|
813
|
+
* a second authority beside the checker's `string | number` at every settled
|
|
814
|
+
* read. `disjointUnionMembersOf`'s own soundness test (no member subsumes
|
|
815
|
+
* another) is applied unchanged to the
|
|
816
|
+
* widened members, so a set the cell census would refuse is refused here too.
|
|
817
|
+
*
|
|
818
|
+
* Built through the checker's internal `getUnionType`, the same guarded reach
|
|
819
|
+
* `withoutUndefinedMember` above and `field-bindings.ts`'s `withNullish` make;
|
|
820
|
+
* a checker without it answers `null`, which is the refusal the caller already
|
|
821
|
+
* handles.
|
|
822
|
+
*/
|
|
823
|
+
export declare const disjointUnionTypeOf: (checker: ts.TypeChecker, types: readonly ts.Type[]) => ts.Type | null;
|
|
824
|
+
/**
|
|
825
|
+
* The parts of `parameter-bindings.ts` that answer one question --
|
|
826
|
+
* "what value does this reference of a named function's identifier stand
|
|
827
|
+
* for" -- without touching that module's own fixpoint state. Moved here so
|
|
828
|
+
* `parameter-bindings.ts` has room, under the architecture gate, for the
|
|
829
|
+
* value-flow evidence this module also builds: `indexNamedCallables` and
|
|
830
|
+
* `indexAliasEvidence`, below.
|
|
831
|
+
*/
|
|
832
|
+
/** Whether this declaration is one of the five function-like shapes the parameter-binding census tracks. */
|
|
833
|
+
export declare const isTrackedCallable: (node: ts.Node) => node is ts.SignatureDeclaration;
|
|
834
|
+
/**
|
|
835
|
+
* The real callee and the arguments that actually reach it, once an explicit-
|
|
836
|
+
* `this` wrapper -- `.call( thisArg, ...args )` or `.apply( thisArg, [ ...
|
|
837
|
+
* args ] )` -- is unwrapped, or `null` when this call is neither.
|
|
838
|
+
*
|
|
839
|
+
* `EventDispatcher.dispatchEvent` calls every registered listener as
|
|
840
|
+
* `array[ i ].call( this, event )`: a call to `array[ i ]`, with ONE argument,
|
|
841
|
+
* not a call to `Function.prototype.call` with two. Left wrapped, `checker.
|
|
842
|
+
* getResolvedSignature` resolves `.call`'s own (unrelated) ambient signature
|
|
843
|
+
* successfully -- it is not `any`, so it never fell through to the fallback
|
|
844
|
+
* that would have resolved the real callee -- and the call vanished from
|
|
845
|
+
* every candidate's evidence without a trace: not refused, simply never
|
|
846
|
+
* counted. `collect` skips recording checker attribution for these and
|
|
847
|
+
* `attributeCalls`/`agreedArgumentType` read this map instead of the raw
|
|
848
|
+
* node, so the SAME machinery that already resolves an ordinary call site's
|
|
849
|
+
* callee and arguments does the resolving here too, just against `callee`
|
|
850
|
+
* and `args` rather than `call.expression` and `call.arguments`.
|
|
851
|
+
*
|
|
852
|
+
* `.apply` is unwrapped only when its argument list is a literal array with
|
|
853
|
+
* no spread (`.apply( this, [ a, b ] )`) -- anything else (a spread, a
|
|
854
|
+
* variable holding the array) stays wrapped rather than guessed at, exactly
|
|
855
|
+
* the same "refuse rather than invent" rule this module uses everywhere
|
|
856
|
+
* else.
|
|
857
|
+
*
|
|
858
|
+
* The RECEIVER -- `call.expression.expression`, `array[ i ]` above -- must
|
|
859
|
+
* itself be a FUNCTION VALUE before any of this fires. `.call`/`.apply` are
|
|
860
|
+
* ordinary member names, and a program is free to declare its own object with
|
|
861
|
+
* a `.call( ... )` or `.apply( ... )` method (a Command/Strategy pattern, a
|
|
862
|
+
* Callable-shaped API): unwrapping THAT receiver would silently replace its
|
|
863
|
+
* real callee and arguments with wrong ones, from a name match with no
|
|
864
|
+
* relationship to `Function.prototype.call`/`.apply` at all. The receiver's
|
|
865
|
+
* own static type having at least one CALL SIGNATURE is what makes it
|
|
866
|
+
* actually a function value -- the same fact `parameter-bindings.ts`'s
|
|
867
|
+
* `isUnannotated` reads off a `Function`-typed parameter, asked here of the
|
|
868
|
+
* `.call`/`.apply` receiver instead.
|
|
869
|
+
*/
|
|
870
|
+
export declare const unwrapExplicitThisCall: (checker: ts.TypeChecker, call: ts.CallExpression) => ExplicitThisCallFrame | null;
|
|
871
|
+
/** The actual operand frame of a source call, with authenticated `.call`/`.apply` wrappers erased.
|
|
872
|
+
*
|
|
873
|
+
* `pendingExplicitThisAt` is the round-over-round counterpart of
|
|
874
|
+
* `unwrapExplicitThisCall`'s own static gate: that gate needs the receiver's
|
|
875
|
+
* CHECKER type to already carry a call signature, which an untyped JS array
|
|
876
|
+
* element never does -- `EventDispatcher.dispatchEvent`'s `array[ i ].call(
|
|
877
|
+
* this, event )` types `array[ i ]` as `any` even with a `@param {Function}`
|
|
878
|
+
* JSDoc tag on the pushing `addEventListener`, because the field the array
|
|
879
|
+
* lives on (`this._listeners`) itself carries no type. Unwrapping THAT
|
|
880
|
+
* receiver unconditionally would be unsound (a program's own `.call`-shaped
|
|
881
|
+
* Command/Strategy object would be silently misread as `Function.prototype.
|
|
882
|
+
* call`), so the census this resolver comes from proves the array's whole
|
|
883
|
+
* write history is CLOSED to real function values first (`callableArrayTargetsOf`
|
|
884
|
+
* in `parameter-bindings.ts`, the identical flow proof `callable-reach.ts`'s
|
|
885
|
+
* own target resolution trusts) and supplies a reading only once that holds --
|
|
886
|
+
* never guessed, and absent (round one, and every caller with no census yet)
|
|
887
|
+
* this stays byte-identical to the always-unresolved answer it replaced. */
|
|
888
|
+
export declare const invocationOperandsOf: (checker: ts.TypeChecker, call: ts.CallExpression | ts.NewExpression, pendingExplicitThisAt?: (call: ts.CallExpression) => ExplicitThisCallFrame | null) => FlowInvocationOperands;
|
|
889
|
+
/** Whether an identifier stands in the callee position of this call. */
|
|
890
|
+
export declare const isCalleeOf: (node: ts.Node, call: ts.CallExpression | ts.NewExpression) => boolean;
|
|
891
|
+
/**
|
|
892
|
+
* The symbol that names this function's value, or `null` when nothing does.
|
|
893
|
+
*
|
|
894
|
+
* A function is enumerable exactly when the program refers to it by a name,
|
|
895
|
+
* because a name is what a reference can be counted against. Three forms of
|
|
896
|
+
* name exist and all three are ordinary: a declaration's own (`function f(){}`),
|
|
897
|
+
* the variable a function expression initializes (`const f = function(){}`),
|
|
898
|
+
* and the member a method declares (`{ f() {} }`, `class { f() {} }`). A
|
|
899
|
+
* function expression written directly as an argument has no name at all, and
|
|
900
|
+
* refusing it is right: its only caller is the function it was passed to, which
|
|
901
|
+
* is precisely the caller this census cannot enumerate.
|
|
902
|
+
*/
|
|
903
|
+
export declare const nameOfCallable: (declaration: ts.SignatureDeclaration) => ts.MemberName | null;
|
|
904
|
+
/**
|
|
905
|
+
* Whether a reference to a function's name is one that keeps it enumerable.
|
|
906
|
+
*
|
|
907
|
+
* An import or export specifier re-binds the name in another module's scope
|
|
908
|
+
* without letting anything hold the function as a value, and a declaration's
|
|
909
|
+
* own name is not a reference to it. A shorthand property in a returned object
|
|
910
|
+
* (`return { has, init, get }`) is the idiom three's factories are built on:
|
|
911
|
+
* the function is reachable only as a member of that record, so every call to
|
|
912
|
+
* it is a member call this census resolves once the record has a type -- which
|
|
913
|
+
* is what the fixpoint is for.
|
|
914
|
+
*
|
|
915
|
+
* Two more shapes are binding-only for the identical reason, one level of
|
|
916
|
+
* indirection removed -- see `indexAliasEvidence` for the evidence that makes
|
|
917
|
+
* each of them SOUND rather than merely silent:
|
|
918
|
+
*
|
|
919
|
+
* - a bare `return f;`: the SELECTOR-RETURN idiom (`getSingularSetter(type)`
|
|
920
|
+
* returning one of several named setters from a switch). The function is
|
|
921
|
+
* reachable only by calling whatever the selector returns, and
|
|
922
|
+
* `indexAliasEvidence.returnedFrom` records exactly which functions a given
|
|
923
|
+
* selector declaration can return, so a call through its result becomes
|
|
924
|
+
* real evidence for every one of them.
|
|
925
|
+
* - `<propertyAccess> = f`: the MEMBER-PUBLICATION idiom (`this.setValue =
|
|
926
|
+
* setValueV3f`), the same idea `nameOfCallable` already handles for a
|
|
927
|
+
* function declared directly in that position, extended to a function
|
|
928
|
+
* merely REFERENCED there. `indexAliasEvidence.publishedUnderMember` keys
|
|
929
|
+
* on the checker's own symbol for the member, never its spelling, so a
|
|
930
|
+
* later call through an unrelated member that happens to share a name
|
|
931
|
+
* never matches.
|
|
932
|
+
*
|
|
933
|
+
* A fourth shape needs no alias evidence at all, because it carries no value
|
|
934
|
+
* flow to begin with: a class named in a HERITAGE CLAUSE (`class Sub extends
|
|
935
|
+
* Base`, `class Sub implements Base`). `ExpressionWithTypeArguments` is the
|
|
936
|
+
* node TypeScript uses for exactly these two positions and nowhere else, so
|
|
937
|
+
* a reference whose direct parent is one names the class being extended or
|
|
938
|
+
* implemented -- it does not hand the class's constructor to anything. The
|
|
939
|
+
* two ways a heritage mention could matter for a constructor's own
|
|
940
|
+
* enumerability are both already real `NewExpression`/`CallExpression` nodes
|
|
941
|
+
* this census's own `attributeCalls` visits and attributes through
|
|
942
|
+
* `checker.getResolvedSignature`, independent of the heritage reference
|
|
943
|
+
* itself: a `super(...)` call in a declared derived constructor resolves
|
|
944
|
+
* straight to the base constructor's declaration, and `new Derived(...)`
|
|
945
|
+
* where `Derived` declares no constructor of its own resolves to that same
|
|
946
|
+
* base declaration too (TypeScript gives the derived class the base's own
|
|
947
|
+
* construct signature when it has none -- measured directly against this
|
|
948
|
+
* compiler's own checker: `new Derived(...)`'s resolved signature IS the
|
|
949
|
+
* base constructor node, and a declared `super(...)` resolves to it too).
|
|
950
|
+
* Counting the heritage mention as a further escape does not add evidence
|
|
951
|
+
* the walk lacks -- it double-refuses a constructor whose real callers are
|
|
952
|
+
* already enumerated elsewhere.
|
|
953
|
+
*
|
|
954
|
+
* Everything else -- an argument, a bare variable initializer, a return of
|
|
955
|
+
* the bare name wrapped in a way that isn't a plain `ReturnStatement` -- hands
|
|
956
|
+
* the function to a caller this census cannot see, and stays an escape.
|
|
957
|
+
*/
|
|
958
|
+
export declare const isBindingOnlyReference: (node: ts.MemberName) => boolean;
|
|
959
|
+
/**
|
|
960
|
+
* Every tracked callable declaration in the program, keyed by the symbol
|
|
961
|
+
* `nameOfCallable` resolves for it -- built once, over EVERY declaration
|
|
962
|
+
* (not only the census's own unannotated-parameter candidates), because a
|
|
963
|
+
* selector can return, or a constructor can publish, a callable whose own
|
|
964
|
+
* parameters are fully typed and irrelevant to this census except as the
|
|
965
|
+
* far end of an alias chain leading to one that is not.
|
|
966
|
+
*/
|
|
967
|
+
export declare const indexNamedCallables: (checker: ts.TypeChecker, files: readonly ts.SourceFile[], reachable: ProgramReachability) => ReadonlyMap<ts.Symbol, ts.SignatureDeclaration>;
|
|
968
|
+
/**
|
|
969
|
+
* The two shapes of alias VALUE FLOW this module makes sound: a function
|
|
970
|
+
* published under a member, and a function bare-returned from a selector.
|
|
971
|
+
* Both maps are keyed by a real checker symbol or a real declaration --
|
|
972
|
+
* never by a name string, which is how a member on one class could
|
|
973
|
+
* otherwise be confused with a same-spelled member on an unrelated one.
|
|
974
|
+
*
|
|
975
|
+
* Neither map depends on `parameter-bindings.ts`'s own fixpoint: which
|
|
976
|
+
* functions get BOUND changes round to round, but which functions are
|
|
977
|
+
* PUBLISHED where is a fact about the program's syntax and its symbols, settled
|
|
978
|
+
* once the checker exists. Building this once, outside the round loop, is
|
|
979
|
+
* sound for the same reason `overridesOfBaseMethod` there is built once.
|
|
980
|
+
*/
|
|
981
|
+
export interface AliasEvidence {
|
|
982
|
+
/**
|
|
983
|
+
* Function declarations published under a resolvable member symbol.
|
|
984
|
+
* `this.setValue = setValueV3f` (and `_this.shadowMap = shadowMap`, and
|
|
985
|
+
* every other `<propertyAccess> = <name>` assignment) records the
|
|
986
|
+
* checker's own symbol for `setValue` mapping to `setValueV3f`'s
|
|
987
|
+
* declaration. Multiple functions can publish under the SAME symbol --
|
|
988
|
+
* a switch inside one constructor assigning different setters to
|
|
989
|
+
* `this.setValue` in different branches -- and every one of them is kept:
|
|
990
|
+
* each receives the evidence a later call attributes, and if their
|
|
991
|
+
* existing evidence then disagrees, the ordinary `call-sites-disagree`
|
|
992
|
+
* refusal fires, same as any other conflicting evidence.
|
|
993
|
+
*/
|
|
994
|
+
readonly publishedUnderMember: ReadonlyMap<ts.Symbol, ReadonlySet<ts.SignatureDeclaration>>;
|
|
995
|
+
/**
|
|
996
|
+
* Function declarations bare-returned from a selector, keyed by the
|
|
997
|
+
* selector's OWN declaration. `getSingularSetter`'s switch returning
|
|
998
|
+
* `setValueV1f`/`setValueV2f`/`setValueV3f`/`setValueV4f` across its
|
|
999
|
+
* cases records all four against `getSingularSetter`'s declaration.
|
|
1000
|
+
*/
|
|
1001
|
+
readonly returnedFrom: ReadonlyMap<ts.SignatureDeclaration, ReadonlySet<ts.SignatureDeclaration>>;
|
|
1002
|
+
}
|
|
1003
|
+
export declare const emptyAliasEvidence: AliasEvidence;
|
|
1004
|
+
export declare const indexAliasEvidence: (checker: ts.TypeChecker, files: readonly ts.SourceFile[], reachable: ProgramReachability, namedCallables: ReadonlyMap<ts.Symbol, ts.SignatureDeclaration>) => AliasEvidence;
|
|
1005
|
+
/**
|
|
1006
|
+
* The type a node holds according to every authority in the program, checker
|
|
1007
|
+
* included.
|
|
1008
|
+
*
|
|
1009
|
+
* The binding census answers `null` for "nothing here improves on the
|
|
1010
|
+
* checker's answer", which is the safe default for the census but a trap for
|
|
1011
|
+
* its readers: it makes consulting the census OPTIONAL. A consumer that simply
|
|
1012
|
+
* calls `checker.getTypeAtLocation` gets a plausible type, no error, and no
|
|
1013
|
+
* indication that a better answer already existed one call away. That is not a
|
|
1014
|
+
* hypothetical -- it is the single most common defect this compiler has had.
|
|
1015
|
+
* `signatureOf` asked the census for a signature's parameters and not its
|
|
1016
|
+
* result; `memberOf` had the census threaded into its own module and never
|
|
1017
|
+
* called it; the array-element consumer asked only about `never` and not
|
|
1018
|
+
* `any`. Each was a few lines, each cost hundreds of boxed carriers, and each
|
|
1019
|
+
* looked locally correct.
|
|
1020
|
+
*
|
|
1021
|
+
* So the rule is: a consumer asks THIS, not the checker. The checker is an
|
|
1022
|
+
* input to the census, not an alternative to it, and the fallback belongs in
|
|
1023
|
+
* one place rather than being rewritten -- or forgotten -- at every call site.
|
|
1024
|
+
*
|
|
1025
|
+
* A site that genuinely wants the checker's own answer wants a different
|
|
1026
|
+
* question than this one ("what did the program STATE here", for a stated
|
|
1027
|
+
* annotation, versus "what does this hold"), and should say so in its own
|
|
1028
|
+
* words at the call rather than reaching past this by habit.
|
|
1029
|
+
*/
|
|
1030
|
+
export declare const censusedTypeAt: (checker: ts.TypeChecker, census: {
|
|
1031
|
+
readonly typeAt: (node: ts.Node) => ts.Type | null;
|
|
1032
|
+
}, node: ts.Node) => ts.Type;
|
|
1033
|
+
/**
|
|
1034
|
+
* The synthesized-union arms a write-set census resolved for a cell, answered
|
|
1035
|
+
* at the DECLARATION and at every READ of it alike.
|
|
1036
|
+
*
|
|
1037
|
+
* A cell whose writes disagree DISJOINTLY resolves to a union rather than a
|
|
1038
|
+
* refusal (see `disjointUnionMembersOf`), and that answer has to travel as an
|
|
1039
|
+
* arm LIST because `ts.TypeChecker.getUnionType` is not public -- so it cannot
|
|
1040
|
+
* ride in a census's `typeAt`, and each census publishes it through a second
|
|
1041
|
+
* channel, `unionArmsAt`, for `structural.ts` to intern.
|
|
1042
|
+
*
|
|
1043
|
+
* Every one of those channels was written as `ts.isParameter(node) ? arms.get(
|
|
1044
|
+
* node) : null` (and the variable/field equivalents), which answers for the
|
|
1045
|
+
* declaration NODE and for nothing else. That is the two-authorities defect
|
|
1046
|
+
* this compiler keeps rediscovering, in its quietest possible form: the
|
|
1047
|
+
* declaration got the union, and every ordinary reference to the cell -- an
|
|
1048
|
+
* identifier one line down -- fell through to the checker's own `any` and
|
|
1049
|
+
* boxed. Nothing reported a disagreement, because the second authority
|
|
1050
|
+
* answered `null`, and `null` is exactly how a census says "the checker's
|
|
1051
|
+
* answer stands".
|
|
1052
|
+
*
|
|
1053
|
+
* Measured on the three.js app: **176 top-level `dynamic` carriers sat on identifiers
|
|
1054
|
+
* reading a parameter the census had already resolved** -- 104 + 57 + 15,
|
|
1055
|
+
* the three synthesized-union parameters in the renderer's object walks, to
|
|
1056
|
+
* the unit. Answering here instead swapped exactly 171 `dynamic` carriers for
|
|
1057
|
+
* 171 `tagged-union` ones (a carrier kind the same program already selected
|
|
1058
|
+
* 2040 times), with `ops` unchanged and 92 FEWER unmet obligations.
|
|
1059
|
+
*
|
|
1060
|
+
* No flow narrowing is discarded by answering at a read, which is the one
|
|
1061
|
+
* thing that could make this unsound and the reason a census's `typeAt` needs
|
|
1062
|
+
* an equality guard for its ordinary bindings: a synthesized union arises only
|
|
1063
|
+
* where the declaration's own checker type is `any`, and `any` carries no
|
|
1064
|
+
* narrowing for a reference to report differently.
|
|
1065
|
+
*
|
|
1066
|
+
* `declarations.length === 1` is the same soleness test every resolver in this
|
|
1067
|
+
* module applies -- a name with two declarations is two cells, and answering
|
|
1068
|
+
* for either would be picking one.
|
|
1069
|
+
*/
|
|
1070
|
+
export declare const synthesizedUnionArmsAt: <D extends ts.Declaration>(checker: ts.TypeChecker, node: ts.Node, arms: ReadonlyMap<D, readonly ts.Type[]>, owns?: (declaration: ts.Declaration) => declaration is D) => readonly ts.Type[] | null;
|