@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,1160 @@
|
|
|
1
|
+
import type { DeclarationId, FunctionId, StructuralTypeId } from '../identity/ids.js';
|
|
2
|
+
/**
|
|
3
|
+
* Physical carriers.
|
|
4
|
+
*
|
|
5
|
+
* A representation answers "which physical thing holds this value", and it is
|
|
6
|
+
* selected from an already-published semantic result. It is never a second
|
|
7
|
+
* interpretation of the source: if choosing a carrier requires re-reading the
|
|
8
|
+
* program, the semantic layer did not publish enough.
|
|
9
|
+
*
|
|
10
|
+
* `array-object` and `dense-buffer` are deliberately different kinds. A
|
|
11
|
+
* JavaScript-observable Array is an exotic object with hole semantics, an
|
|
12
|
+
* array-index key domain, and `length` define/delete/truncation rules; a dense
|
|
13
|
+
* buffer is a compiler-private storage block with none of that. Letting one
|
|
14
|
+
* kind mean both is what allows a single Array to be a tagged array object in
|
|
15
|
+
* one endpoint and a bare vector in another.
|
|
16
|
+
*/
|
|
17
|
+
/** The only reasons a value may be carried dynamically. */
|
|
18
|
+
export declare const dynamicReasons: readonly ["opt-in-fallback", "tostring-of-unknown", "thrown-error-carrier", "unasserted-json-parse", "declared-any-never-narrowed", "commonjs-module-boundary", "untyped-callable", "shadowed-callable-builtin"];
|
|
19
|
+
export type DynamicReason = (typeof dynamicReasons)[number];
|
|
20
|
+
/** Scalar domains with exact range semantics. */
|
|
21
|
+
export type ScalarDomain = 'boolean' | 'number' | 'bigint' | 'int32' | 'uint32' | 'float64';
|
|
22
|
+
/**
|
|
23
|
+
* The eight standard TypedArray element widths (ECMA-262 23.2), one per
|
|
24
|
+
* `Uint8Array`/`Int32Array`/... view. Deliberately not a widening of
|
|
25
|
+
* `ScalarDomain`: a typed array element is never the generic `'number'` (or
|
|
26
|
+
* `'boolean'`/`'bigint'`) domain that carrier models — every view is one
|
|
27
|
+
* specific fixed width every write truncates to, which is a different
|
|
28
|
+
* question than "what physical type holds a JS number". `int32`/`uint32`/
|
|
29
|
+
* `float64` are the same three string tags `ScalarDomain` already carries as
|
|
30
|
+
* unused storage-choice placeholders; the remaining five are new.
|
|
31
|
+
*/
|
|
32
|
+
/**
|
|
33
|
+
* The element a typed array view stores, one entry per row of ECMA-262 23.2's
|
|
34
|
+
* table of TypedArray constructors.
|
|
35
|
+
*
|
|
36
|
+
* `uint8-clamped` is `Uint8ClampedArray`, and it is a distinct domain rather
|
|
37
|
+
* than a flag on `uint8` because its WRITE RULE is different: every other
|
|
38
|
+
* integer view truncates modulo 2^N (ECMA-262 7.1.x `ToIntN`/`ToUintN`), while
|
|
39
|
+
* `Uint8ClampedArray` clamps to [0, 255] and rounds halves to EVEN (7.1.11
|
|
40
|
+
* `ToUint8Clamp`) -- so `a[0] = 1.5` stores 2, `a[0] = 2.5` stores 2, and
|
|
41
|
+
* `a[0] = 300` stores 255. Carrying it as `uint8` would make those three
|
|
42
|
+
* writes silently wrong. The C++ element type differs to match
|
|
43
|
+
* (`gea::ClampedUint8`), so the rule is chosen by overload resolution at
|
|
44
|
+
* compile time and there is no runtime kind flag to consult.
|
|
45
|
+
*
|
|
46
|
+
* `bigint64`/`biguint64` are absent: their elements are BigInts, which no
|
|
47
|
+
* `ScalarDomain` models and this backend has no carrier for at all. A program
|
|
48
|
+
* naming `BigInt64Array` therefore gets no typed-array carrier and refuses by
|
|
49
|
+
* name upstream, rather than being quietly given a 64-bit integer view whose
|
|
50
|
+
* reads would have to lie about their type.
|
|
51
|
+
*/
|
|
52
|
+
export type TypedArrayElementDomain = 'int8' | 'uint8' | 'uint8-clamped' | 'int16' | 'uint16' | 'int32' | 'uint32' | 'float32' | 'float64';
|
|
53
|
+
/** How long a reference is valid and who may keep it. */
|
|
54
|
+
export type Ownership = 'owned' | 'shared-refcount' | 'borrowed';
|
|
55
|
+
/** One field of a closed record shape. */
|
|
56
|
+
export interface RecordField {
|
|
57
|
+
readonly key: string;
|
|
58
|
+
readonly value: Representation;
|
|
59
|
+
/** A field that may be absent is not the same as a field holding `undefined`. */
|
|
60
|
+
readonly required: boolean;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* One accessor-backed member of a record: a property with no storage, read and
|
|
64
|
+
* written by calling a body.
|
|
65
|
+
*
|
|
66
|
+
* Kept out of `fields` because the two are different physical things. A field
|
|
67
|
+
* occupies a struct member; an accessor occupies none, and laying one out
|
|
68
|
+
* would reserve space for a value that is never stored there and would let a
|
|
69
|
+
* read find that space instead of running the getter.
|
|
70
|
+
*/
|
|
71
|
+
export interface RecordAccessor {
|
|
72
|
+
readonly key: string;
|
|
73
|
+
readonly getter: FunctionId | null;
|
|
74
|
+
readonly setter: FunctionId | null;
|
|
75
|
+
/**
|
|
76
|
+
* The carrier the member's VALUE has -- what the getter returns and the
|
|
77
|
+
* setter takes.
|
|
78
|
+
*
|
|
79
|
+
* Derived by the same `deriveStored` call a data field's carrier is, off the
|
|
80
|
+
* same member's type, so the two halves of one shape never answer "what does
|
|
81
|
+
* this member hold" differently. It is not part of `representationKey`: two
|
|
82
|
+
* shapes agreeing on key, getter and setter cannot disagree here, because
|
|
83
|
+
* the bodies those ids name are the ones that produce and consume it.
|
|
84
|
+
*
|
|
85
|
+
* A boxed read (`records.ts`'s field dispatcher) needs it. The native read
|
|
86
|
+
* (`emit-properties.ts`) does not -- there the call's own result operand
|
|
87
|
+
* carries the carrier -- which is exactly why this must come from the same
|
|
88
|
+
* derivation rather than a second opinion formed at emission.
|
|
89
|
+
*/
|
|
90
|
+
readonly value: Representation;
|
|
91
|
+
}
|
|
92
|
+
export type RecordIndexKey = 'string' | 'number' | 'symbol';
|
|
93
|
+
/**
|
|
94
|
+
* A whole numeric property table stores text keys after ToPropertyKey, unlike
|
|
95
|
+
* a numeric sidecar selected from a record's disjoint index signatures. Keep
|
|
96
|
+
* the numeric fast path, but carry other non-Symbol primitives through the
|
|
97
|
+
* table's text protocol. In particular absence names "undefined"/"null";
|
|
98
|
+
* recovering a number would either refuse it or alias a different property.
|
|
99
|
+
*/
|
|
100
|
+
export declare const dictionaryKeyDomainOf: (declared: RecordIndexKey, key: Representation) => RecordIndexKey;
|
|
101
|
+
/** One native dynamic-property table carried alongside a record's fixed fields. */
|
|
102
|
+
export interface RecordIndexSidecar {
|
|
103
|
+
readonly key: RecordIndexKey;
|
|
104
|
+
readonly value: Representation;
|
|
105
|
+
}
|
|
106
|
+
/** Exact ECMAScript Number::toString spelling accepted by a number index signature. */
|
|
107
|
+
export declare const isCanonicalNumberPropertyKeyText: (text: string) => boolean;
|
|
108
|
+
/** Select the disjoint sidecar addressed by a statically carried property key. */
|
|
109
|
+
export declare const recordIndexForKeyCarrier: (indexes: readonly RecordIndexSidecar[], key: Representation, constantText?: string) => RecordIndexSidecar | null;
|
|
110
|
+
/**
|
|
111
|
+
* Whether a C++ formal for this carrier is worth spelling `const&` instead of
|
|
112
|
+
* copying it -- the carrier-level ELIGIBILITY the target used to re-derive by
|
|
113
|
+
* testing `cppTypeOf`'s rendered text (`type === 'std::string'`,
|
|
114
|
+
* `type.startsWith('gea::Ref<')`) at up to four separate answerers
|
|
115
|
+
* (a program fact, so it belongs to the IR). A `const-ref` parameter is not
|
|
116
|
+
* necessarily EMITTED as one: per-body safety analysis
|
|
117
|
+
* (`targets/cpp/translation-unit.ts`'s `borrowedFormalsOf`,
|
|
118
|
+
* `targets/cpp/borrowed-call-entry.ts`'s `stableBorrowEntryOf`) still decides
|
|
119
|
+
* whether narrowing to a reference is safe for one specific body's uses --
|
|
120
|
+
* this field is the eligibility gate every one of those checks used a
|
|
121
|
+
* spelling test to answer, not the final declared convention.
|
|
122
|
+
*/
|
|
123
|
+
export type AbiParameterPassing = 'by-value' | 'const-ref';
|
|
124
|
+
/**
|
|
125
|
+
* `passingOf`'s answer for `value` under `ownership` (the ABI's own override
|
|
126
|
+
* for this position, or `null` to ask the carrier's own tier -- mirroring
|
|
127
|
+
* `cppTypeOf`'s optional second argument).
|
|
128
|
+
*
|
|
129
|
+
* `string` and `callable-identity` carry no `ownership` field at all -- a
|
|
130
|
+
* `std::string` always owns its buffer and `gea::Ref<gea::FunctionObjectIdentity>`
|
|
131
|
+
* is `cppTypeOf`'s one hardcoded reference spelling -- so both are named
|
|
132
|
+
* directly rather than falling out of the ownership-tier check below. Every
|
|
133
|
+
* other reference-shaped carrier (`class-ref`, `record`, `record-with-index`,
|
|
134
|
+
* `native-record-ref`, `array-object`, `typed-array`, `array-buffer`,
|
|
135
|
+
* `shared-array-buffer`, `data-view`, `keyed-collection`, `dictionary`) is
|
|
136
|
+
* spelled `gea::Ref<...>` by `cppTypeOf`'s `cppOwnershipWrap` exactly when its
|
|
137
|
+
* effective ownership is `shared-refcount`, which is what `'ownership' in
|
|
138
|
+
* value` plus the tier check reproduces without spelling anything.
|
|
139
|
+
*
|
|
140
|
+
* The one exception this function and `targets/cpp/types.ts`'s
|
|
141
|
+
* `cppAbiParameterType` still apply identically: an ArrayBuffer-family view
|
|
142
|
+
* keeps ITS OWN shared-refcount tier even when a function-value signature
|
|
143
|
+
* stamps the parameter `owned` after publication settled on the standard
|
|
144
|
+
* buffer carrier as shared, because the bytes still have observable reference
|
|
145
|
+
* identity a by-value copy would silently break.
|
|
146
|
+
*/
|
|
147
|
+
export declare const passingOf: (value: Representation, ownership?: Ownership | null) => AbiParameterPassing;
|
|
148
|
+
/** One physical parameter of a callable ABI. */
|
|
149
|
+
export interface AbiParameter {
|
|
150
|
+
readonly value: Representation;
|
|
151
|
+
readonly ownership: Ownership;
|
|
152
|
+
readonly passing: AbiParameterPassing;
|
|
153
|
+
}
|
|
154
|
+
/** The physical calling convention of one callable. */
|
|
155
|
+
export interface CallableAbi {
|
|
156
|
+
readonly parameters: readonly AbiParameter[];
|
|
157
|
+
readonly result: Representation;
|
|
158
|
+
/** The receiver carrier, or `null` for a callable that takes no receiver. */
|
|
159
|
+
readonly receiver: Representation | null;
|
|
160
|
+
/**
|
|
161
|
+
* The parameter index the trailing arguments are packed into, or `null` for a
|
|
162
|
+
* fixed-arity convention.
|
|
163
|
+
*
|
|
164
|
+
* A rest parameter has no fixed *argument* count, but it does have a fixed
|
|
165
|
+
* *frame*: the language binds it to one Array holding whatever was passed
|
|
166
|
+
* beyond the named parameters. So the slot is ordinary -- an `array-object`
|
|
167
|
+
* like any other -- and what varies is only who builds the array, which is
|
|
168
|
+
* the caller. Saying "no primitive" for that would refuse a convention the
|
|
169
|
+
* language itself defines exactly.
|
|
170
|
+
*/
|
|
171
|
+
readonly restFrom: number | null;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* The declaration/type identity which closes a native container back onto
|
|
175
|
+
* itself.
|
|
176
|
+
*
|
|
177
|
+
* A recursive record has a natural C++ name already: `native-record-ref`
|
|
178
|
+
* names its structural layout, and a `Ref<Record>` can point at an incomplete
|
|
179
|
+
* forward declaration. A recursive Array, Map, Set, or dictionary does not
|
|
180
|
+
* have such a name: spelling the container inline asks C++ to instantiate
|
|
181
|
+
* `Map<K, Ref<Map<K, ...>>>` forever. The identity here names the one wrapper
|
|
182
|
+
* struct that closes that equation. The outer container carries it as its
|
|
183
|
+
* definition; a marked `native-record-ref` is an explicit back edge. They
|
|
184
|
+
* deliberately have the same representation key and C++ type -- they are two
|
|
185
|
+
* paths to the same native object type, not a widening at the cycle.
|
|
186
|
+
*/
|
|
187
|
+
export interface RecursiveCarrier {
|
|
188
|
+
readonly type: StructuralTypeId;
|
|
189
|
+
/**
|
|
190
|
+
* The native carrier whose wrapper this fixpoint names. `'callable'` is not
|
|
191
|
+
* a container: a signature that mentions itself has no by-reference form to
|
|
192
|
+
* fall back on, so the wrapper struct IS the indirection and it is held by
|
|
193
|
+
* value -- `gea::CallableObject` stores a pointer and a capture, never the
|
|
194
|
+
* parameter types, so naming an incomplete self in its own base is legal.
|
|
195
|
+
*/
|
|
196
|
+
readonly container: 'array-object' | 'keyed-collection' | 'dictionary' | 'callable';
|
|
197
|
+
readonly role: 'definition' | 'reference';
|
|
198
|
+
}
|
|
199
|
+
export type Representation =
|
|
200
|
+
/**
|
|
201
|
+
* Lattice bottom. Not a carrier: it records that selection did not happen.
|
|
202
|
+
* It must fail closed before materialization rather than defaulting.
|
|
203
|
+
*/
|
|
204
|
+
{
|
|
205
|
+
readonly kind: 'unresolved';
|
|
206
|
+
readonly reason: string;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Not a value carrier at all.
|
|
210
|
+
*
|
|
211
|
+
* `never` shares this carrier with `void` because both occupy no storage
|
|
212
|
+
* (`representation/primitives.ts` says why), but they are not the same fact
|
|
213
|
+
* about the FULFILLMENT of a value: `void` is an evaluation that completed
|
|
214
|
+
* with nothing, and `never` is an evaluation that never completes at all.
|
|
215
|
+
* Every carrier decision in the compiler cares only about the storage half
|
|
216
|
+
* and reads `kind === 'void'`; `bottom` is for the handful that must know
|
|
217
|
+
* whether a value can arrive here. `Promise<never> -> Promise<T>` is the
|
|
218
|
+
* standing case: TypeScript admits it at every `T` because the fulfillment
|
|
219
|
+
* channel is never written, while `Promise<void> -> Promise<string>` is a
|
|
220
|
+
* real hole the backend must keep refusing.
|
|
221
|
+
*
|
|
222
|
+
* Deliberately NOT part of `representationKey`, for the same reason
|
|
223
|
+
* `class-ref`'s declaration-local facts are not: the key names the PHYSICAL
|
|
224
|
+
* carrier, and `never` and `void` are the identical nothing. Folding it in
|
|
225
|
+
* would give every program that mentions `never` anywhere a second spelling
|
|
226
|
+
* of one carrier -- the "one value, two carriers" case the key exists to
|
|
227
|
+
* catch -- and would move census node ids for programs whose emitted code
|
|
228
|
+
* is byte-identical.
|
|
229
|
+
*/
|
|
230
|
+
| {
|
|
231
|
+
readonly kind: 'void';
|
|
232
|
+
readonly bottom?: true;
|
|
233
|
+
} | {
|
|
234
|
+
readonly kind: 'scalar';
|
|
235
|
+
readonly domain: ScalarDomain;
|
|
236
|
+
} | {
|
|
237
|
+
readonly kind: 'string';
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* A symbol: a value the language mints, compares only by identity, and uses
|
|
241
|
+
* as a property key no string can collide with.
|
|
242
|
+
*
|
|
243
|
+
* Physically one interned id, because that is all the language lets a
|
|
244
|
+
* program observe of one. `Symbol()` mints a fresh id; `Symbol.for(k)` looks
|
|
245
|
+
* one up in a registry keyed by string, so two calls with the same key are
|
|
246
|
+
* the same symbol and `Symbol('x') !== Symbol('x')` stays true; a well-known
|
|
247
|
+
* symbol is a fixed id. `description` rides along for `toString`, and is not
|
|
248
|
+
* part of identity.
|
|
249
|
+
*
|
|
250
|
+
* There is no separate carrier for a `unique symbol` type. `const GEA_DIRTY
|
|
251
|
+
* = Symbol()` gives that constant its own TYPE -- which is what stops a
|
|
252
|
+
* program from passing one framework key where another is declared -- but a
|
|
253
|
+
* type is not storage, and every one of them holds exactly one id. Deriving
|
|
254
|
+
* them to one carrier is what lets a record field declared `unique symbol`
|
|
255
|
+
* be stored at all.
|
|
256
|
+
*/
|
|
257
|
+
| {
|
|
258
|
+
readonly kind: 'symbol';
|
|
259
|
+
} | {
|
|
260
|
+
readonly kind: 'null';
|
|
261
|
+
} | {
|
|
262
|
+
readonly kind: 'undefined';
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* A nominal class reference with exact class and ownership authority.
|
|
266
|
+
*
|
|
267
|
+
* `shapeId` names the instance's structure in the sealed structural table,
|
|
268
|
+
* the same way `native-record-ref` does: the class stays the carrier so a
|
|
269
|
+
* field typed as its own class has a finite carrier, and the layout is read
|
|
270
|
+
* back from the table at emission rather than expanded here.
|
|
271
|
+
*
|
|
272
|
+
* Deliberately NOT part of `representationKey`, for the same reason
|
|
273
|
+
* `ancestors` below is not: a class is NOMINAL, `projection/classes.ts` gives
|
|
274
|
+
* each class DECLARATION exactly one `ClassLayout`, and `cppTypeOf` spells a
|
|
275
|
+
* `class-ref` as `cppClassName(declaration)` with the shape playing no part.
|
|
276
|
+
* Two instantiations of one generic class therefore have one physical
|
|
277
|
+
* carrier, and folding the shape in gave that carrier two spellings -- the
|
|
278
|
+
* "one value, two carriers" case this key exists to CATCH, arrived at from
|
|
279
|
+
* the other side. hono is the measured case: `Context.notFound` reads
|
|
280
|
+
* `#notFoundHandler: NotFoundHandler<E>` -- a callable over `Context<E>`,
|
|
281
|
+
* which is `Context<E, any, BlankInput>` once the class's later parameters
|
|
282
|
+
* take their defaults -- and the narrowed read in a monomorphized copy
|
|
283
|
+
* spells the same class through its own instantiation. Identical carriers
|
|
284
|
+
* apart from the shape, so the `optional(F) -> F` narrowing every other
|
|
285
|
+
* defaulted field gets had no recipe and certification refused the read.
|
|
286
|
+
*
|
|
287
|
+
* `ancestors` is every class this one inherits from, transitively
|
|
288
|
+
* (`semantics/class-heritage.ts`), carried ON the carrier rather than looked
|
|
289
|
+
* up through a policy. Two questions need it and neither has anywhere else
|
|
290
|
+
* to ask: whether a handle declared at a base may be READ at a descendant
|
|
291
|
+
* (`instanceof` narrowing, `emit-narrowing.ts`) and whether one may be
|
|
292
|
+
* STORED as a base (an upcast). Both are asked from pure carrier-to-carrier
|
|
293
|
+
* functions with no compilation context to thread a policy through, and the
|
|
294
|
+
* answer is a fact about the class itself, not about the target -- so it
|
|
295
|
+
* belongs here, stated once by the one site that derives a `class-ref` at
|
|
296
|
+
* all. Deliberately NOT part of `representationKey`: the declaration
|
|
297
|
+
* already identifies the class, so two carriers agreeing on it agree on
|
|
298
|
+
* this too.
|
|
299
|
+
*/
|
|
300
|
+
| {
|
|
301
|
+
readonly kind: 'class-ref';
|
|
302
|
+
readonly declaration: DeclarationId;
|
|
303
|
+
readonly shapeId: string;
|
|
304
|
+
readonly ownership: Ownership;
|
|
305
|
+
readonly ancestors: readonly DeclarationId[];
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* A host handle admitted only by a versioned host protocol.
|
|
309
|
+
*
|
|
310
|
+
* `call`/`construct` are the handle's own `[[Call]]`/`[[Construct]]`
|
|
311
|
+
* conventions when the checker gave its type one -- `null` for a handle
|
|
312
|
+
* that has neither (`Math`), or whose overload set has no single physical
|
|
313
|
+
* frame to join (`DateConstructor`'s four `new` overloads: no primitive
|
|
314
|
+
* unifies "no args", "a timestamp", and "year, month, date, ..." into one
|
|
315
|
+
* ABI, so `construct` is `null` there even though the checker's type does
|
|
316
|
+
* declare construct signatures). This is deliberately the SAME carrier a
|
|
317
|
+
* data-only handle gets, not a second kind: a host protocol's members and
|
|
318
|
+
* its own call/construct convention are two facts about one handle, and a
|
|
319
|
+
* type can have either, both, or neither -- `Math` has neither, `Date`
|
|
320
|
+
* has member methods (`now`) plus an unjoinable construct set, and `Error`
|
|
321
|
+
* has both a joinable construct signature and no interesting members.
|
|
322
|
+
* Property access (`emit-properties.ts`'s `nativeHandleMemberText`) reads
|
|
323
|
+
* only `protocol`/`kind`, never `call`/`construct`, so a handle whose
|
|
324
|
+
* checker type merges call/construct signatures with named members --
|
|
325
|
+
* `DateConstructor` also declares `now`/`parse`/`UTC` -- keeps exactly the
|
|
326
|
+
* member access it already had; nothing here can take that away, because
|
|
327
|
+
* `targets/cpp/types.ts`'s `native-handle` spelling never reads these two
|
|
328
|
+
* fields either. Only `emitCall`/`emitConstruct` in `targets/cpp/emit.ts`
|
|
329
|
+
* read them, to invoke the handle itself rather than one of its members.
|
|
330
|
+
*/
|
|
331
|
+
| {
|
|
332
|
+
readonly kind: 'native-handle';
|
|
333
|
+
readonly protocol: string;
|
|
334
|
+
readonly version: number;
|
|
335
|
+
/**
|
|
336
|
+
* The host's own name for the type it carries this protocol's values in,
|
|
337
|
+
* when the plugin that installs the protocol stated one
|
|
338
|
+
* (`PluginCapabilities.nativeTypes`); `null` when it did not.
|
|
339
|
+
*
|
|
340
|
+
* A host's name for its own type, not a target spelling invented here --
|
|
341
|
+
* which is why it belongs on a target-neutral carrier: a backend spells it
|
|
342
|
+
* verbatim (`targets/cpp/types.ts`) rather than deriving one from
|
|
343
|
+
* `protocol`, and a protocol with no stated carrier keeps the opaque
|
|
344
|
+
* tagged handle. It is also the join key `preflight/run.ts` claims against
|
|
345
|
+
* and `emit-properties.ts` looks members up by, so the many declared names
|
|
346
|
+
* that share one runtime type share one claim and one member table.
|
|
347
|
+
*/
|
|
348
|
+
readonly native: string | null;
|
|
349
|
+
/**
|
|
350
|
+
* Every host carrier this one derives from, transitively, as the host
|
|
351
|
+
* states it (`PluginCapabilities.nativeBases`) -- nearest base first,
|
|
352
|
+
* empty for a handle whose host stated no inheritance and for one with
|
|
353
|
+
* no carrier at all.
|
|
354
|
+
*
|
|
355
|
+
* `class-ref`'s `ancestors` one carrier kind over, for the identical
|
|
356
|
+
* reason. An `NSStackView` IS an `NSView`: the generated bridge gives
|
|
357
|
+
* the wrapper structs that same inheritance, so storing one where the
|
|
358
|
+
* other is declared is the language's own derived-to-base rule with no
|
|
359
|
+
* text of its own. Nothing in TypeScript's structural view says so --
|
|
360
|
+
* two opaque handles are unrelated to the checker whatever the host's
|
|
361
|
+
* hierarchy says -- so the fact has to be carried, and it has to be
|
|
362
|
+
* carried HERE: the question "may this be STORED as that" is asked by
|
|
363
|
+
* pure carrier-to-carrier functions (the conversion chain, and through
|
|
364
|
+
* it the census that mints the node the certificate names) which have
|
|
365
|
+
* no compilation context to thread a host table through. Before this,
|
|
366
|
+
* the host table reached only the emitter, so the printer rendered an
|
|
367
|
+
* upcast the census had already refused by name and no program using
|
|
368
|
+
* one ever got that far.
|
|
369
|
+
*
|
|
370
|
+
* Keyed by the host's own carrier name, the same join key `native` is,
|
|
371
|
+
* so the many declared names that share one runtime type share one
|
|
372
|
+
* chain. A handle with no stated carrier is related to nothing: a host
|
|
373
|
+
* that named no C++ type for a protocol has said nothing about that
|
|
374
|
+
* protocol's place in a hierarchy either. Deliberately NOT part of
|
|
375
|
+
* `representationKey`: the carrier already identifies the host type, so
|
|
376
|
+
* two carriers agreeing on it agree on this too.
|
|
377
|
+
*/
|
|
378
|
+
readonly bases: readonly string[];
|
|
379
|
+
readonly call: CallableAbi | null;
|
|
380
|
+
readonly construct: CallableAbi | null;
|
|
381
|
+
} | {
|
|
382
|
+
readonly kind: 'record';
|
|
383
|
+
readonly shapeId: string;
|
|
384
|
+
readonly fields: readonly RecordField[];
|
|
385
|
+
/** Members read and written by calling a body rather than by touching storage. */
|
|
386
|
+
readonly accessors: readonly RecordAccessor[];
|
|
387
|
+
readonly ownership: Ownership;
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* A record whose declared shape has named members *and* an index signature
|
|
391
|
+
* over string, number, or symbol keys -- `interface Style { width?: number;
|
|
392
|
+
* [key: string]: unknown }`, `interface Sparse { count: number; [index:
|
|
393
|
+
* number]: string }`, or `interface States { name: string; [key: symbol]:
|
|
394
|
+
* State }`.
|
|
395
|
+
*
|
|
396
|
+
* The named members are a struct layout; each disjoint index domain is a
|
|
397
|
+
* dictionary over everything else. Neither half may stand in for the other: collapsing
|
|
398
|
+
* the whole carrier to `dictionary` would turn `style.width` into a hash
|
|
399
|
+
* lookup for a field that has a fixed offset, and refusing the shape outright
|
|
400
|
+
* (the previous answer) throws away the struct half over a dictionary half
|
|
401
|
+
* that is genuinely open. `indexes` states what every dynamic-keyed property
|
|
402
|
+
* beyond `fields` carries and which key domain addresses it; the emitted
|
|
403
|
+
* layout (`targets/cpp/records.ts`) is the named fields plus native sidecar
|
|
404
|
+
* members -- `gea::Dictionary<V>` for string keys,
|
|
405
|
+
* `gea::NumericDictionary<V>` for number keys, and
|
|
406
|
+
* `gea::SymbolDictionary<V>` for symbol keys -- the
|
|
407
|
+
* same shape `gea::runtime::regex::Pattern`'s
|
|
408
|
+
* dynamic-property sidecar gives a native type that also needs arbitrary
|
|
409
|
+
* properties -- this is that idea at the carrier level, for an ordinary
|
|
410
|
+
* struct instead of a native handle.
|
|
411
|
+
*/
|
|
412
|
+
| {
|
|
413
|
+
readonly kind: 'record-with-index';
|
|
414
|
+
readonly shapeId: string;
|
|
415
|
+
readonly fields: readonly RecordField[];
|
|
416
|
+
/**
|
|
417
|
+
* Canonical, disjoint JS property-key domains. String and number may be
|
|
418
|
+
* represented by one string-keyed table when their value carriers agree;
|
|
419
|
+
* symbols always retain their own identity-keyed table.
|
|
420
|
+
*/
|
|
421
|
+
readonly indexes: readonly RecordIndexSidecar[];
|
|
422
|
+
readonly ownership: Ownership;
|
|
423
|
+
}
|
|
424
|
+
/** A Proxy carries target, handler, and revoked state -- not the target alone. */
|
|
425
|
+
| {
|
|
426
|
+
readonly kind: 'proxy-object';
|
|
427
|
+
readonly target: Representation;
|
|
428
|
+
readonly handler: Representation;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* A reference to a natively laid-out record, named by shape rather than
|
|
432
|
+
* expanded. This is what carries a declared type: expanding a name whose body
|
|
433
|
+
* refers back to itself has no finite carrier, so the name stays the carrier
|
|
434
|
+
* and the layout is resolved from the sealed structural table at emission.
|
|
435
|
+
* `ownership` states the lifetime; `borrowed` means an external owner.
|
|
436
|
+
*/
|
|
437
|
+
| {
|
|
438
|
+
readonly kind: 'native-record-ref';
|
|
439
|
+
readonly shapeId: string;
|
|
440
|
+
readonly ownership: Ownership;
|
|
441
|
+
/**
|
|
442
|
+
* The C++ struct this record IS, when a host declared it, or `null`
|
|
443
|
+
* for one this compiler lays out itself. A stated name means the
|
|
444
|
+
* definition is the host's -- `records.ts` emits no struct for it --
|
|
445
|
+
* while the layout still derives, so a field this compiler cannot
|
|
446
|
+
* carry refuses instead of reaching C++ as a member that is not there.
|
|
447
|
+
*/
|
|
448
|
+
readonly native: string | null;
|
|
449
|
+
/**
|
|
450
|
+
* An indirection to a compiler-minted recursive container wrapper.
|
|
451
|
+
* `native` is a non-null private marker in this case so record emission
|
|
452
|
+
* never tries to lay this container out as a record; C++ spelling reads
|
|
453
|
+
* this identity rather than that marker text.
|
|
454
|
+
*/
|
|
455
|
+
readonly recursive?: RecursiveCarrier;
|
|
456
|
+
} | {
|
|
457
|
+
readonly kind: 'borrowed-ref';
|
|
458
|
+
readonly referent: Representation;
|
|
459
|
+
}
|
|
460
|
+
/** A JavaScript-observable Array: holes, index keys, `length` semantics. */
|
|
461
|
+
| {
|
|
462
|
+
readonly kind: 'array-object';
|
|
463
|
+
readonly element: Representation;
|
|
464
|
+
readonly ownership: Ownership;
|
|
465
|
+
/** Present only where this Array is the body of a recursive type equation. */
|
|
466
|
+
readonly recursive?: RecursiveCarrier;
|
|
467
|
+
/**
|
|
468
|
+
* The typed fields an interface ADDS to the Array it extends --
|
|
469
|
+
* TypeScript's `NodeArray<T> extends ReadonlyArray<T>, ReadonlyTextRange`
|
|
470
|
+
* puts `pos`, `end`, `hasTrailingComma` on every node list -- or `null`
|
|
471
|
+
* for a plain array. The C++ type is the same `gea::ArrayObject<E>`
|
|
472
|
+
* either way: the fields live in the array's own extension sidecar
|
|
473
|
+
* (`ArrayObject::extensionFields`), typed by a generated struct
|
|
474
|
+
* (`records.ts`'s `arrayExtensionDeclarations`), so a plain array cast
|
|
475
|
+
* to the interface (`elements.slice() as MutableNodeArray<T>`) is the
|
|
476
|
+
* SAME object and converts by identity (`conversions.ts`). Part of the
|
|
477
|
+
* carrier's identity because a property read has to know the layout;
|
|
478
|
+
* keyed by the FIELDS, not the interface, so `MutableNodeArray<T>` and
|
|
479
|
+
* `NodeArray<T>` -- one object under two spellings -- are one carrier.
|
|
480
|
+
*/
|
|
481
|
+
readonly extension: readonly RecordField[] | null;
|
|
482
|
+
}
|
|
483
|
+
/** Compiler/runtime-private dense storage. Never a JavaScript-observable Array. */
|
|
484
|
+
| {
|
|
485
|
+
readonly kind: 'dense-buffer';
|
|
486
|
+
readonly element: Representation;
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* A flat, fixed-element-width numeric buffer -- `Uint8Array`, `Int32Array`,
|
|
490
|
+
* `Float64Array` and the rest of the eight standard TypedArray views. Not
|
|
491
|
+
* `dense-buffer`: that kind is compiler-private storage with no JavaScript
|
|
492
|
+
* identity and no producer anywhere in `derive.ts`; a typed array IS a
|
|
493
|
+
* JavaScript-observable value with its own indexed get/set truncation
|
|
494
|
+
* rules (ECMA-262 23.2), so it is a third, distinct kind rather than a
|
|
495
|
+
* spelling of either `array-object` (which has holes and an
|
|
496
|
+
* ordinary-property domain a typed array does not have) or `dense-buffer`.
|
|
497
|
+
*/
|
|
498
|
+
| {
|
|
499
|
+
readonly kind: 'typed-array';
|
|
500
|
+
readonly element: TypedArrayElementDomain;
|
|
501
|
+
/** The checker-resolved ArrayBufferLike parameter; Atomics needs this distinction. */
|
|
502
|
+
readonly buffer: 'array-buffer' | 'shared-array-buffer';
|
|
503
|
+
readonly ownership: Ownership;
|
|
504
|
+
}
|
|
505
|
+
/**
|
|
506
|
+
* ECMA-262 25.1's `ArrayBuffer`: a fixed-length block of BYTES with no
|
|
507
|
+
* element type of its own, which every typed array and every `DataView` is a
|
|
508
|
+
* VIEW over.
|
|
509
|
+
*
|
|
510
|
+
* Its own kind rather than `typed-array(uint8)`, for the reason those two
|
|
511
|
+
* differ observably: an ArrayBuffer has no indexed access at all (`b[0]` is
|
|
512
|
+
* `undefined`, not a byte), no `length`, and no element width -- while
|
|
513
|
+
* `new Uint8Array(b)` and `new Uint8Array(u8)` are two DIFFERENT constructor
|
|
514
|
+
* overloads whose results share bytes in the first case and copy in the
|
|
515
|
+
* second. Collapsing the two onto one carrier would make the emitter unable
|
|
516
|
+
* to tell those overloads apart, which is the silent-wrong-answer shape the
|
|
517
|
+
* whole typed-array family is about.
|
|
518
|
+
*
|
|
519
|
+
* Not `dense-buffer` either, and for exactly the reason `typed-array`'s own
|
|
520
|
+
* comment above gives: `dense-buffer` is compiler-private storage that
|
|
521
|
+
* `representation/verify.ts` refuses in any observable position, and an
|
|
522
|
+
* ArrayBuffer is a JavaScript value a program holds, passes and reads
|
|
523
|
+
* `byteLength` off.
|
|
524
|
+
*
|
|
525
|
+
* The physical carrier is the SAME `std::shared_ptr<std::vector<uint8_t>>`
|
|
526
|
+
* `gea::TypedArray` already stores its bytes behind (`gea::ArrayBuffer` is
|
|
527
|
+
* an alias of that vector), which is what makes aliasing real rather than
|
|
528
|
+
* simulated: `view.buffer` hands back the very block the view reads, and a
|
|
529
|
+
* write through either is seen by the other.
|
|
530
|
+
*/
|
|
531
|
+
| {
|
|
532
|
+
readonly kind: 'array-buffer';
|
|
533
|
+
readonly ownership: Ownership;
|
|
534
|
+
}
|
|
535
|
+
/** A fixed-length concurrent byte block, distinct from ArrayBuffer. */
|
|
536
|
+
| {
|
|
537
|
+
readonly kind: 'shared-array-buffer';
|
|
538
|
+
readonly ownership: Ownership;
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* ECMA-262 25.3's `DataView`: a VIEW over an `ArrayBuffer` whose element
|
|
542
|
+
* width and BYTE ORDER are chosen per access rather than fixed by the view's
|
|
543
|
+
* own type.
|
|
544
|
+
*
|
|
545
|
+
* That is exactly what makes it a separate kind from `typed-array` rather
|
|
546
|
+
* than a spelling of it. A typed array's element type IS the view's type --
|
|
547
|
+
* `Int32Array` reads `int32` at native byte order, always -- while
|
|
548
|
+
* `view.getInt32(0)` and `view.getInt32(0, true)` read the SAME bytes as two
|
|
549
|
+
* different numbers, and `getFloat64`/`getUint8` read them as two more. A
|
|
550
|
+
* carrier parameterized by one element could not state that; there is no
|
|
551
|
+
* element to parameterize on.
|
|
552
|
+
*/
|
|
553
|
+
| {
|
|
554
|
+
readonly kind: 'data-view';
|
|
555
|
+
readonly ownership: Ownership;
|
|
556
|
+
}
|
|
557
|
+
/** A storage snapshot, which is not an ECMAScript Array identity. */
|
|
558
|
+
| {
|
|
559
|
+
readonly kind: 'native-sequence';
|
|
560
|
+
readonly element: Representation;
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* The iteration cursor `gea::Iterator<E, TReturn, TNext>` (`runtime/gea_runtime.h`).
|
|
564
|
+
*
|
|
565
|
+
* `source` says which of the two things that can build one built THIS one --
|
|
566
|
+
* `'generator'` for a `function*`'s own `Generator<T, TReturn, TNext>`
|
|
567
|
+
* (`representation/derive.ts`'s `GeneratorDeclarationPolicy`), `'sequence'`
|
|
568
|
+
* for the four fixed-storage walks (`Array`/`Set`/`string`/`Map`, plus the
|
|
569
|
+
* `for`-`in` enumerator and static-tuple walk) that need no `[Symbol.
|
|
570
|
+
* iterator]` lookup at all (`publish.ts`'s `nativeCursorIteratorOf`). The
|
|
571
|
+
* distinction is not cosmetic: only a generator's own cursor has a
|
|
572
|
+
* `%GeneratorPrototype%.return`/`.throw` to call (ECMA-262 27.5.1) --
|
|
573
|
+
* `%ArrayIteratorPrototype%` and its three siblings define neither -- so
|
|
574
|
+
* `manifest/capabilities.ts` and `prototype/emit-prototype-iterator.ts`
|
|
575
|
+
* gate those two members on `source === 'generator'` rather than certifying
|
|
576
|
+
* them for a receiver that carries this same physical cursor type but was
|
|
577
|
+
* never actually a generator.
|
|
578
|
+
*
|
|
579
|
+
* `resume`/`completion` are what `next(v)`/a `return v` inside the body
|
|
580
|
+
* actually store -- the resume channel (`TNext`) and the completion value
|
|
581
|
+
* (`TReturn`) of `Generator<T, TReturn, TNext>`. Both default to
|
|
582
|
+
* `{ kind: 'undefined' }` for every `'sequence'` source (none of the four
|
|
583
|
+
* fixed walks, nor `for`-`in`, ever resumes with a value or completes with
|
|
584
|
+
* one) and for a generator whose own `TReturn`/`TNext` did not derive to a
|
|
585
|
+
* concrete native carrier -- collapsed there rather than left as whatever
|
|
586
|
+
* `deriveStored` answered, because this cursor has no boxed slot to store a
|
|
587
|
+
* `dynamic`/`unresolved` value in (the "never box a typed value" rule cuts
|
|
588
|
+
* the same way here as everywhere else): a generator whose `next(v)`/
|
|
589
|
+
* completion value is read anyway is refused downstream, by name, exactly
|
|
590
|
+
* as reading `undefined`'s own (nonexistent) members already is.
|
|
591
|
+
*/
|
|
592
|
+
| {
|
|
593
|
+
readonly kind: 'iterator';
|
|
594
|
+
readonly element: Representation;
|
|
595
|
+
readonly resume: Representation;
|
|
596
|
+
readonly completion: Representation;
|
|
597
|
+
readonly source: 'generator' | 'sequence';
|
|
598
|
+
} | {
|
|
599
|
+
readonly kind: 'promise';
|
|
600
|
+
readonly value: Representation;
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* One of the language's four keyed collections -- `Map<K, V>`, `Set<T>`,
|
|
604
|
+
* `WeakMap<K, V>`, `WeakSet<T>` -- carried over the CONCRETE key and value
|
|
605
|
+
* carriers the checker proved, never over a boxed element.
|
|
606
|
+
*
|
|
607
|
+
* This is the port of v1's `gea_cpp_typed_js_map<Key, Value>` /
|
|
608
|
+
* `gea_cpp_typed_js_set<Key>` (`targets/cpp/runtime/value_11_collections.h`
|
|
609
|
+
* there): a keyed collection is a distinct physical thing from every kind
|
|
610
|
+
* already here, and none of them can stand in for it. `dictionary` is a
|
|
611
|
+
* string- or number-keyed table with no insertion order, no identity of its
|
|
612
|
+
* own, and no key domain beyond those two -- a `Map<Store, Observer>` has
|
|
613
|
+
* none of that. `record` is a fixed field set. `array-object` is
|
|
614
|
+
* index-keyed with holes. Collapsing a Map onto any of them would be the
|
|
615
|
+
* same silent widening the no-boxing rule forbids, one level up.
|
|
616
|
+
*
|
|
617
|
+
* `value` is `null` for the two set families and never for the two map
|
|
618
|
+
* families: a Set stores keys only, and giving it a payload slot that is
|
|
619
|
+
* never read would be a carrier claiming storage that does not exist.
|
|
620
|
+
*
|
|
621
|
+
* `family` distinguishes strong from weak because the C++ type differs, not
|
|
622
|
+
* because the weakness is observable: this runtime has no garbage collector
|
|
623
|
+
* to collect a weakly-held key, so `gea::WeakMap`/`gea::WeakSet` are
|
|
624
|
+
* pointer-keyed maps that hold their keys ALIVE. See their doc comments in
|
|
625
|
+
* `runtime/gea_runtime.h` -- the difference from the strong families is the
|
|
626
|
+
* key EQUALITY rule (reference identity, so only a carrier with pointer
|
|
627
|
+
* identity may be a weak key), not the lifetime.
|
|
628
|
+
*
|
|
629
|
+
* Neither `key` nor `value` may be `unresolved`: that is lattice bottom, so
|
|
630
|
+
* a collection over it could not state what it stores. Both MAY be
|
|
631
|
+
* `dynamic`, and the distinction is the whole point -- a position the
|
|
632
|
+
* program itself declared `any`/`unknown` and never narrowed is a genuine
|
|
633
|
+
* dynamic boundary with a real carrier, not an unknown shape, and
|
|
634
|
+
* `Map<string, any>` gets that carrier rather than a refusal. What is
|
|
635
|
+
* forbidden is the widening: a key or value the checker DID type stays that
|
|
636
|
+
* type, so `Map<string, Effect>` is never a map of boxes. See
|
|
637
|
+
* `collections.ts` for the derivation and `runtime/gea_runtime.h`'s
|
|
638
|
+
* `sameValueZero<Value>` / `canonicalKey<Value>` / `weakKeySame<Value>` for
|
|
639
|
+
* how a dynamic key still gets the exact ECMA-262 comparisons.
|
|
640
|
+
*/
|
|
641
|
+
| {
|
|
642
|
+
readonly kind: 'keyed-collection';
|
|
643
|
+
readonly family: 'map' | 'set' | 'weak-map' | 'weak-set';
|
|
644
|
+
readonly key: Representation;
|
|
645
|
+
/** The payload carrier for the two map families; `null` for the two set families, which store keys only. */
|
|
646
|
+
readonly value: Representation | null;
|
|
647
|
+
readonly ownership: Ownership;
|
|
648
|
+
/** Present only where this collection is the body of a recursive type equation. */
|
|
649
|
+
readonly recursive?: RecursiveCarrier;
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* An object shape with no named members, carried entirely by its own index
|
|
653
|
+
* signature -- `interface StringCounts { [key: string]: number }` or the
|
|
654
|
+
* number-keyed `interface Sparse { [index: number]: string }`. `key` states
|
|
655
|
+
* the domain the lookup is keyed by, and `targets/cpp/types.ts` spells the
|
|
656
|
+
* two domains as two distinct runtime containers (`gea::Dictionary<V>` /
|
|
657
|
+
* `gea::NumericDictionary<V>`) rather than coercing one key domain into the
|
|
658
|
+
* other's storage.
|
|
659
|
+
*/
|
|
660
|
+
| {
|
|
661
|
+
readonly kind: 'dictionary';
|
|
662
|
+
readonly key: 'string' | 'number' | 'symbol';
|
|
663
|
+
readonly value: Representation;
|
|
664
|
+
readonly ownership: Ownership;
|
|
665
|
+
/** Present only where this dictionary is the body of a recursive type equation. */
|
|
666
|
+
readonly recursive?: RecursiveCarrier;
|
|
667
|
+
} | {
|
|
668
|
+
readonly kind: 'function';
|
|
669
|
+
readonly functionId: FunctionId;
|
|
670
|
+
readonly abi: CallableAbi;
|
|
671
|
+
}
|
|
672
|
+
/** A closed, authenticated family of callables sharing one joined ABI. */
|
|
673
|
+
| {
|
|
674
|
+
readonly kind: 'function-family';
|
|
675
|
+
readonly members: readonly FunctionId[];
|
|
676
|
+
readonly abi: CallableAbi;
|
|
677
|
+
} | {
|
|
678
|
+
readonly kind: 'constructor-family';
|
|
679
|
+
readonly members: readonly DeclarationId[];
|
|
680
|
+
readonly abi: CallableAbi;
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* A constructor whose class is not proven, carried by its convention.
|
|
684
|
+
*
|
|
685
|
+
* The exact counterpart of `function-value-dispatch`: `new () => Component`
|
|
686
|
+
* states what `[[Construct]]` takes and returns without naming which class
|
|
687
|
+
* implements it, so the carrier is the construct pointer, not a member set.
|
|
688
|
+
* Collapsing it into `constructor-family` with an empty member list would
|
|
689
|
+
* claim a closed family of nothing.
|
|
690
|
+
*/
|
|
691
|
+
| {
|
|
692
|
+
readonly kind: 'constructor-value-dispatch';
|
|
693
|
+
readonly abi: CallableAbi;
|
|
694
|
+
}
|
|
695
|
+
/**
|
|
696
|
+
* A function object with both `[[Call]]` and `[[Construct]]`.
|
|
697
|
+
*
|
|
698
|
+
* `Number`, `Date`, and every other built-in constructor really are both, and
|
|
699
|
+
* the two conventions differ: `Number(x)` returns a number, `new Number(x)`
|
|
700
|
+
* returns an object. One carrier holding one ABI cannot say which a site
|
|
701
|
+
* selected, and picking either would make the other silently wrong.
|
|
702
|
+
*/
|
|
703
|
+
| {
|
|
704
|
+
readonly kind: 'function-and-constructor';
|
|
705
|
+
readonly call: CallableAbi;
|
|
706
|
+
readonly construct: CallableAbi;
|
|
707
|
+
} | {
|
|
708
|
+
readonly kind: 'function-value-family';
|
|
709
|
+
readonly members: readonly FunctionId[];
|
|
710
|
+
readonly abi: CallableAbi;
|
|
711
|
+
readonly optional: boolean;
|
|
712
|
+
} | {
|
|
713
|
+
readonly kind: 'function-value-dispatch';
|
|
714
|
+
readonly abi: CallableAbi;
|
|
715
|
+
/** Present only where this signature is the body of a recursive type equation. */
|
|
716
|
+
readonly recursive?: RecursiveCarrier;
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* Which of a closed set of GENERIC source functions a cell holds.
|
|
720
|
+
*
|
|
721
|
+
* `const setOriginal = flags & NoOriginalNode ? identity : setOriginalNode`
|
|
722
|
+
* holds one of two generic functions; neither has a frame until a call
|
|
723
|
+
* instantiates it, so no `CallableObject` can carry the choice. The tag
|
|
724
|
+
* can: a `std::uint8_t` indexing `members` (sorted declaration ids, the
|
|
725
|
+
* order `genericFunctionSetMembersOf` states). A reference to a member is
|
|
726
|
+
* the constant index; a call through the cell is a `closed-family`
|
|
727
|
+
* invocation whose targets are the copies that call instantiates, one per
|
|
728
|
+
* member, dispatched on the tag (`ir/lower-invocation.ts`,
|
|
729
|
+
* `emit-callable.ts`). Widening into a superset remaps the index.
|
|
730
|
+
*/
|
|
731
|
+
/**
|
|
732
|
+
* A function VALUE with no calling convention: storable, passable and
|
|
733
|
+
* comparable, but not callable.
|
|
734
|
+
*
|
|
735
|
+
* `(...args: never[]) => void` -- TypeScript's `AnyFunction`, and tsc's own
|
|
736
|
+
* (`core.ts`) -- is not a convention at all. `never` is uninhabited, so no
|
|
737
|
+
* call through such a slot can supply an argument, and the type exists to say
|
|
738
|
+
* "some function, which nobody here calls": tsc passes it straight to
|
|
739
|
+
* `Error.captureStackTrace`. Giving it a frame is where the silent miscompile
|
|
740
|
+
* lives -- a concrete `f(a, b, c)` converted into a zero-argument frame
|
|
741
|
+
* compiles and then runs with garbage the first time anyone calls it.
|
|
742
|
+
*
|
|
743
|
+
* The carrier is the identity half every callable already owns:
|
|
744
|
+
* `gea::CallableObject` holds a `Ref<FunctionObjectIdentity>` alongside its
|
|
745
|
+
* thunk, so converting any callable into this is a field read, not a
|
|
746
|
+
* fabrication. A CALL through it has no convention to use and is refused --
|
|
747
|
+
* loudly, at emission, which is the correct answer for a program that calls
|
|
748
|
+
* a value whose own type says it takes no arguments.
|
|
749
|
+
*/
|
|
750
|
+
| {
|
|
751
|
+
readonly kind: 'callable-identity';
|
|
752
|
+
} | {
|
|
753
|
+
readonly kind: 'generic-function-set';
|
|
754
|
+
readonly members: readonly DeclarationId[];
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
* An optional payload with an exact absence tag.
|
|
758
|
+
*
|
|
759
|
+
* `absence` names *which* of the language's two absent values the flag stands
|
|
760
|
+
* for. It has to: `x === null` and `x === undefined` are different questions
|
|
761
|
+
* with different answers over the same `gea::Optional<T>`, and a carrier that
|
|
762
|
+
* only said "absent" would leave a backend guessing which one -- a silently
|
|
763
|
+
* wrong branch rather than a refusal. A union carrying *both* absent values
|
|
764
|
+
* is not an optional at all (`derive.ts`'s `deriveUnion` builds a tagged
|
|
765
|
+
* union for it), so one tag is always enough.
|
|
766
|
+
*/
|
|
767
|
+
| {
|
|
768
|
+
readonly kind: 'optional';
|
|
769
|
+
readonly payload: Representation;
|
|
770
|
+
readonly absence: 'null' | 'undefined';
|
|
771
|
+
}
|
|
772
|
+
/** A sum whose arms are proven pairwise disjoint at runtime. */
|
|
773
|
+
| {
|
|
774
|
+
readonly kind: 'tagged-union';
|
|
775
|
+
readonly arms: readonly TaggedUnionArm[];
|
|
776
|
+
}
|
|
777
|
+
/** The boxed carrier. Admissible only for one of the four reasons above. */
|
|
778
|
+
| {
|
|
779
|
+
readonly kind: 'dynamic';
|
|
780
|
+
readonly reason: DynamicReason;
|
|
781
|
+
};
|
|
782
|
+
/** One arm of a tagged union, with the discriminator that selects it. */
|
|
783
|
+
export interface TaggedUnionArm {
|
|
784
|
+
readonly tag: string;
|
|
785
|
+
readonly value: Representation;
|
|
786
|
+
/** The semantic type this arm covers, so member census can be checked complete. */
|
|
787
|
+
readonly semanticType: StructuralTypeId;
|
|
788
|
+
/**
|
|
789
|
+
* The runtime fact that separates this arm from another arm with the same
|
|
790
|
+
* JavaScript tag and physical C++ payload.
|
|
791
|
+
*
|
|
792
|
+
* A closed callable family is authenticated by source FunctionId. An
|
|
793
|
+
* evaluated callable ABI without a closed family is explicitly
|
|
794
|
+
* unverifiable: payload type equality proves only a calling convention, not
|
|
795
|
+
* which function the checker admitted. Keeping that refusal on the arm --
|
|
796
|
+
* and therefore in `representationKey` -- prevents a union from silently
|
|
797
|
+
* changing identity when two declarations happen to share one ABI.
|
|
798
|
+
* A broad, already-dynamic `Function` arm is different: it claims every
|
|
799
|
+
* callable and retains the boxed Value without inventing an ABI. Its
|
|
800
|
+
* `callable-tag` discriminator is therefore sufficient only when no other
|
|
801
|
+
* arm also answers to the Function tag; the shared union classifier rejects
|
|
802
|
+
* such an overlap.
|
|
803
|
+
*/
|
|
804
|
+
readonly runtimeDiscriminator: {
|
|
805
|
+
readonly kind: 'carrier';
|
|
806
|
+
} | {
|
|
807
|
+
readonly kind: 'callable-tag';
|
|
808
|
+
} | {
|
|
809
|
+
readonly kind: 'callable-membership';
|
|
810
|
+
readonly members: readonly FunctionId[];
|
|
811
|
+
} | {
|
|
812
|
+
readonly kind: 'unverifiable-callable';
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
/** The container variants which can name a recursive native wrapper. */
|
|
816
|
+
export type RecursiveContainerRepresentation = Extract<Representation, {
|
|
817
|
+
readonly kind: 'array-object' | 'keyed-collection' | 'dictionary' | 'function-value-dispatch';
|
|
818
|
+
}>;
|
|
819
|
+
/**
|
|
820
|
+
* The fixpoint identity a carrier participates in, or `null` for an ordinary
|
|
821
|
+
* acyclic container. Kept in the model so derivation, verification, and the
|
|
822
|
+
* C++ spelling read the same fact instead of each inferring recursion from a
|
|
823
|
+
* traversal of their own.
|
|
824
|
+
*/
|
|
825
|
+
export declare const recursiveCarrierOf: (representation: Representation) => RecursiveCarrier | null;
|
|
826
|
+
/**
|
|
827
|
+
* The extension half of an `array-object` key: empty for a plain array, so
|
|
828
|
+
* every key written before extensions existed is unchanged, and the field
|
|
829
|
+
* list -- name, requiredness, carrier -- for an extended one. Exported so the
|
|
830
|
+
* emitter names the generated struct by the same identity the carrier has.
|
|
831
|
+
*/
|
|
832
|
+
export declare const arrayExtensionKey: (extension: readonly RecordField[] | null) => string;
|
|
833
|
+
export declare const representationKey: (representation: Representation) => string;
|
|
834
|
+
/** A stable key for a calling convention. */
|
|
835
|
+
export declare const abiKey: (abi: CallableAbi) => string;
|
|
836
|
+
/**
|
|
837
|
+
* Whether a carrier boxes a value that has a static type.
|
|
838
|
+
*
|
|
839
|
+
* Used by the no-boxing gate. `dynamic` is legitimate only for the four
|
|
840
|
+
* declared reasons; every other appearance is a defect to fix at the producer.
|
|
841
|
+
*/
|
|
842
|
+
export declare const isBoxed: (representation: Representation) => boolean;
|
|
843
|
+
/**
|
|
844
|
+
* Whether a carrier has no absent state at all -- so `a ?? b` over it never
|
|
845
|
+
* evaluates `b`.
|
|
846
|
+
*
|
|
847
|
+
* Read straight off `alwaysTruthyKinds` because that set is already exactly
|
|
848
|
+
* this fact plus more: every kind in it is an Object or a callable whose
|
|
849
|
+
* absence, where it has one, lives in an `optional` WRAPPER rather than in the
|
|
850
|
+
* carrier itself. The three carriers that self-encode absence are outside the
|
|
851
|
+
* set for reasons its own comment states -- `native-handle` and a
|
|
852
|
+
* shared-refcount `class-ref`, the two `representation/optional.ts` collapses
|
|
853
|
+
* `T | null` onto -- and so are `optional`, `dynamic` and every sum, each of
|
|
854
|
+
* which plainly has one.
|
|
855
|
+
*
|
|
856
|
+
* `constructor-family` is the measured case: node-server's `export const
|
|
857
|
+
* CloseEvent: typeof globalThis.CloseEvent = globalThis.CloseEvent ?? class
|
|
858
|
+
* extends Event {...}`. The plan gives the global read a bare constructor
|
|
859
|
+
* family, which is the census's own statement that the value is there -- a host
|
|
860
|
+
* that says otherwise says so through `semantics/normalize/absent-globals.ts`,
|
|
861
|
+
* which turns the read's type into `undefined` and takes the carrier out of
|
|
862
|
+
* this set. So the fallback class never runs, and asking for a conversion
|
|
863
|
+
* between two unrelated program classes is asking for a value that arm never
|
|
864
|
+
* produces.
|
|
865
|
+
*/
|
|
866
|
+
export declare const carriesNoAbsence: (representation: Representation) => boolean;
|
|
867
|
+
/**
|
|
868
|
+
* Whether `representation` -- unwrapped once if it is an `optional` -- can
|
|
869
|
+
* only ever be absent, never a live, present-but-falsy value.
|
|
870
|
+
*
|
|
871
|
+
* This is the fact that licenses treating one arm of a merge as dead code
|
|
872
|
+
* rather than a missing conversion: `a && a.b` keeps `a` on the branch where
|
|
873
|
+
* `a` tested falsy, and an Object is never falsy, so when `a`'s own payload
|
|
874
|
+
* is one, the present case cannot be the reason that branch runs -- only
|
|
875
|
+
* `a`'s own absence can, and the checker's own type for the whole `&&`
|
|
876
|
+
* already reflects that by excluding the payload from the join. A bare
|
|
877
|
+
* (non-optional) representation with an always-truthy kind answers `true`
|
|
878
|
+
* too: it has no absence at all, so if it reaches here as the falsy side of
|
|
879
|
+
* an `&&`, the branch is not merely narrowed, it is wholly unreachable.
|
|
880
|
+
*
|
|
881
|
+
* One fact with one asker: `ir/lower-narrow.ts`'s `mergeIncoming` (what a
|
|
882
|
+
* dead arm lowers to). Preflight's `buildMergeNarrowingObligations` asked it
|
|
883
|
+
* too until Phase 1.6 deleted that second decision tree; the obligation ids
|
|
884
|
+
* quoted below are its historical spelling of the same pairs.
|
|
885
|
+
*/
|
|
886
|
+
/**
|
|
887
|
+
* Whether a merge's own carrier has an absent state a dead `&&` arm can be
|
|
888
|
+
* materialized into.
|
|
889
|
+
*
|
|
890
|
+
* The companion fact to `isDeadMergeContribution`: that one says the kept arm
|
|
891
|
+
* contributes nothing but absence, this one says the merge has somewhere to
|
|
892
|
+
* put it. Both authorities need both halves, and both used to spell this one
|
|
893
|
+
* as `kind === 'optional'`.
|
|
894
|
+
*
|
|
895
|
+
* That spelling was too narrow by exactly one carrier, and it is the carrier
|
|
896
|
+
* this file's own `alwaysTruthyKinds` comment already names: `optional.ts`
|
|
897
|
+
* COLLAPSES `T | null` onto a bare `native-handle`, because a host handle
|
|
898
|
+
* self-encodes absence as an invalid state. So a merge whose checker type is
|
|
899
|
+
* `WSInst | null` has carrier `native-handle`, not `optional` -- and the
|
|
900
|
+
* `kind === 'optional'` test then refused a program the collapse itself
|
|
901
|
+
* created.
|
|
902
|
+
*
|
|
903
|
+
* Measured on `examples/dialer`: `if (e.candidate && this.ws)`, with
|
|
904
|
+
* `ws: WebSocketInstance | null`, raised
|
|
905
|
+
* `merge-narrowing:optional(native-record-ref(...),null)->native-handle(...)`,
|
|
906
|
+
* an obligation no conversion could ever satisfy, on a program with zero
|
|
907
|
+
* violations. The C++ side already had the spelling all along --
|
|
908
|
+
* `types.ts`'s `carriesAbsence` answers `true` for `native-handle`, so the
|
|
909
|
+
* constant renders as an empty handle (`gea::host::WebSocket{}`), which is
|
|
910
|
+
* exactly what `emit-narrowing.ts`'s `emptyHandleText` writes for the same
|
|
911
|
+
* carrier on the store path.
|
|
912
|
+
*/
|
|
913
|
+
/**
|
|
914
|
+
* Whether a carrier has an `undefined` state at all -- the question a
|
|
915
|
+
* definedness test asks, asked of the carrier rather than of a value.
|
|
916
|
+
*
|
|
917
|
+
* `targets/cpp/emit-presence.ts`'s `definedTestText` is the same rule as a
|
|
918
|
+
* spelling, and delegates here rather than restating it: a carrier this answers
|
|
919
|
+
* `false` for renders the test as the constant `true`, which is honest -- such a
|
|
920
|
+
* value genuinely cannot be `undefined` -- and is exactly why a lowering that
|
|
921
|
+
* MERGES over a definedness guard has to ask this first. A merge over a
|
|
922
|
+
* constant-true test is not a merge; its absent arm is dead, and building one
|
|
923
|
+
* anyway hands the emitter a branch whose other side can never run.
|
|
924
|
+
*
|
|
925
|
+
* A host handle's own absence stands for `null`, never for `undefined` (see
|
|
926
|
+
* `optionalOf`), so it is defined whatever it holds -- as is every carrier that
|
|
927
|
+
* is simply a value that exists.
|
|
928
|
+
*/
|
|
929
|
+
export declare const carriesUndefined: (representation: Representation) => boolean;
|
|
930
|
+
/**
|
|
931
|
+
* Whether `ir/lower-destructuring.ts`'s array-pattern fast path already reads
|
|
932
|
+
* this carrier positionally, in place: a plain array, a positional tuple
|
|
933
|
+
* record (`ir/lower-allocation.ts`'s `lowerTupleLiteral` names the same shape
|
|
934
|
+
* "record" -- there is deliberately no separate tuple carrier), or a tagged
|
|
935
|
+
* union every arm of which is itself one of these two --
|
|
936
|
+
* `preflight/tuple-destructuring.ts`'s uniform tuple-union.
|
|
937
|
+
*/
|
|
938
|
+
export declare const isArrayPatternCapable: (representation: Representation) => boolean;
|
|
939
|
+
/**
|
|
940
|
+
* The one arm of a tagged union a nested array-pattern position can read
|
|
941
|
+
* positionally, when every OTHER arm cannot -- `number | number[]`, the
|
|
942
|
+
* per-position element of a plain (non-tuple) array whose own element is
|
|
943
|
+
* itself a union: exactly one arm (the array) supports positional reads, and
|
|
944
|
+
* the other (the number) is exactly the value ECMA-262 7.4.2 `GetIterator`
|
|
945
|
+
* throws a `TypeError` over. `null` for a union with zero such arms, or with
|
|
946
|
+
* MORE than one -- two capable arms (`number[] | string[]`) is a genuine
|
|
947
|
+
* ambiguity this compiler does not resolve, and refusing it is the
|
|
948
|
+
* fail-closed answer, not a guess.
|
|
949
|
+
*/
|
|
950
|
+
export declare const soleArrayPatternCapableArm: (representation: Representation) => {
|
|
951
|
+
readonly index: number;
|
|
952
|
+
readonly arm: Representation;
|
|
953
|
+
} | null;
|
|
954
|
+
/**
|
|
955
|
+
* The payload under a field value's own `undefined`-optional carrier, or
|
|
956
|
+
* `null` for every other field.
|
|
957
|
+
*
|
|
958
|
+
* Property presence no longer comes from this wrapper. Generated structs keep
|
|
959
|
+
* an independent bit for every `!required` field, because a present property
|
|
960
|
+
* whose value is `undefined` and a missing property are observably different.
|
|
961
|
+
* This helper remains the value-carrier decomposition used where code needs
|
|
962
|
+
* the payload of `T | undefined` itself.
|
|
963
|
+
*/
|
|
964
|
+
export declare const absentFieldPayload: (field: RecordField) => Representation | null;
|
|
965
|
+
export declare const carriesMergeAbsence: (representation: Representation) => boolean;
|
|
966
|
+
export declare const isDeadMergeContribution: (representation: Representation) => boolean;
|
|
967
|
+
/**
|
|
968
|
+
* The `||` mirror of `isDeadMergeContribution`: a kept operand with NO truthy
|
|
969
|
+
* state. `a || b` publishes `a` only when `ToBoolean(a)` is true, and a carrier
|
|
970
|
+
* that is only ever `null`/`undefined` (propertyHelper's `verifyProp || name`,
|
|
971
|
+
* where every caller passes `null` or nothing) has no such state, so the
|
|
972
|
+
* kept branch never runs and the merge only ever publishes the evaluated
|
|
973
|
+
* side. Nothing is converted because nothing arrives. Asked by
|
|
974
|
+
* `ir/lower-narrow.ts`'s `mergeIncoming`. Deliberately not extended to an
|
|
975
|
+
* `optional` or a union: those carry a payload that CAN be truthy.
|
|
976
|
+
*/
|
|
977
|
+
export declare const contributesNoTruthiness: (representation: Representation) => boolean;
|
|
978
|
+
/**
|
|
979
|
+
* Whether every falsy state this carrier has is an ABSENCE -- the WHOLE-operand
|
|
980
|
+
* question, as against `isDeadMergeContribution`'s per-arm one.
|
|
981
|
+
*
|
|
982
|
+
* The two differ over exactly the carriers `optional.ts` COLLAPSES `T | null`
|
|
983
|
+
* onto: a bare `class-ref(shared-refcount)` (a `gea::Ref<T>`) and a bare
|
|
984
|
+
* `native-handle`. `isDeadMergeContribution` must refuse those, and its own
|
|
985
|
+
* comment says why -- a null `Ref` is a falsy state, and an ARM proven dead is
|
|
986
|
+
* DROPPED from `partialDeadMergeArms`'s rebuild, so a null flowing through a
|
|
987
|
+
* dropped arm would fall out of the chain into a neighbour's value.
|
|
988
|
+
*
|
|
989
|
+
* Asked of a whole `&&` operand into a merge that carries an absence, nothing
|
|
990
|
+
* is dropped and the answer changes. ECMAScript's `ToBoolean` is `true` for
|
|
991
|
+
* every object, so the only value such a carrier can hold on the branch where
|
|
992
|
+
* it tested falsy is its own null -- and the merge's own absence is where that
|
|
993
|
+
* null belongs. `crash.ts`'s `this.engine && this.endBuffer` (`AudioEngine |
|
|
994
|
+
* null` guarding a `BufferLike | null`) is the shape: the kept operand
|
|
995
|
+
* contributes nothing the merge does not already have a state for, yet
|
|
996
|
+
* `merge-narrowing:class-ref(...)->optional(native-record-ref(...),null)`
|
|
997
|
+
* asked for a conversion no registry could hold.
|
|
998
|
+
*
|
|
999
|
+
* Strictly wider than `isDeadMergeContribution` -- `absenceTaggedOutside` only
|
|
1000
|
+
* ever ENABLES the return above -- so every merge the narrower fact licensed
|
|
1001
|
+
* is licensed identically here. `ir/lower-narrow.ts`'s `mergeIncoming` asks
|
|
1002
|
+
* this one and does not re-derive it.
|
|
1003
|
+
*/
|
|
1004
|
+
export declare const contributesOnlyAbsence: (representation: Representation) => boolean;
|
|
1005
|
+
/** The live/dead split of a tagged union merge arm, when the split is partial -- see `partialDeadMergeArms`. */
|
|
1006
|
+
export interface PartialMergeArmSplit {
|
|
1007
|
+
readonly payload: Extract<Representation, {
|
|
1008
|
+
kind: 'tagged-union';
|
|
1009
|
+
}>;
|
|
1010
|
+
/** Indices into `payload.arms` NOT proven dead by `isDeadMergeContribution`, in ascending order. Never empty, never `payload.arms.length`. */
|
|
1011
|
+
readonly liveIndices: readonly number[];
|
|
1012
|
+
/** Whether `representation` itself (before unwrapping) was `optional` -- the arm's own absence is then a second, independent reason this merge arm can run. */
|
|
1013
|
+
readonly keptIsOptional: boolean;
|
|
1014
|
+
}
|
|
1015
|
+
/**
|
|
1016
|
+
* The per-arm decomposition of `isDeadMergeContribution`, asked only when the
|
|
1017
|
+
* WHOLE answer is neither wholly `true` nor wholly `false`.
|
|
1018
|
+
*
|
|
1019
|
+
* `isDeadMergeContribution` covers two ends: every arm dead (the kept operand
|
|
1020
|
+
* contributes nothing but its own absence -- `mergeIncoming`'s existing
|
|
1021
|
+
* bypass) and every arm live (an ordinary conversion, already the general
|
|
1022
|
+
* conversion graph's job). This is the middle: SOME arms dead, at least one
|
|
1023
|
+
* live -- `results[name]` typed `T[] | string`, where `T[]` can never be the
|
|
1024
|
+
* reason a `&&` fell through but `string` can (an empty one).
|
|
1025
|
+
*
|
|
1026
|
+
* Returns `null` for anything that is not that middle case: not a tagged
|
|
1027
|
+
* union at all (once unwrapped of one optional layer, matching
|
|
1028
|
+
* `isDeadMergeContribution`'s own unwrap), wholly dead, or wholly live. Each
|
|
1029
|
+
* `null` is a real "does not apply", not a missing answer -- the caller falls
|
|
1030
|
+
* through to whichever of the two existing paths does apply.
|
|
1031
|
+
*
|
|
1032
|
+
* One fact, asked from both authorities that must never disagree about it,
|
|
1033
|
+
* exactly as `isDeadMergeContribution` and `carriesMergeAbsence` already are:
|
|
1034
|
+
* `ir/lower-narrow.ts`'s `mergeIncoming`, which both decides to rebuild via
|
|
1035
|
+
* the live-arm proof instead of a general conversion and checks that the
|
|
1036
|
+
* rebuild is buildable at all -- every live arm must actually have somewhere
|
|
1037
|
+
* to convert to, and the source's own absence, if it has one, needs
|
|
1038
|
+
* `carriesMergeAbsence(merged)` to hold it -- blocking the body otherwise.
|
|
1039
|
+
*/
|
|
1040
|
+
/**
|
|
1041
|
+
* Whether `representation` is boolean-shaped: itself `scalar(boolean)`, or an
|
|
1042
|
+
* `optional` whose payload is.
|
|
1043
|
+
*
|
|
1044
|
+
* The signal `ir/lower-narrow.ts`'s `mergeIncoming` checks
|
|
1045
|
+
* before licensing `ToBoolean` (`targets/cpp/emit-presence.ts`'s
|
|
1046
|
+
* `booleanTestText`) as a live arm's conversion into a `&&` merge's own
|
|
1047
|
+
* carrier, rather than requiring a structural, value-preserving one.
|
|
1048
|
+
*
|
|
1049
|
+
* Sound only here, at a `&&` merge whose own published type already
|
|
1050
|
+
* collapsed to boolean-or-absent: ECMA-262's own definition of `&&` decides
|
|
1051
|
+
* which operand to keep by `ToBoolean`, so when the checker's inferred type
|
|
1052
|
+
* for the WHOLE expression is `boolean | undefined` rather than the kept
|
|
1053
|
+
* operand's own type, it has already proven the kept contribution is
|
|
1054
|
+
* meaningful only as its truthiness -- an object-shaped arm has no boolean
|
|
1055
|
+
* value of its own, but it does have a `ToBoolean` answer, and that answer is
|
|
1056
|
+
* exactly what the checker's type says this merge publishes. This is why
|
|
1057
|
+
* `partialDeadMergeArms`'s live/dead split still matters here rather than
|
|
1058
|
+
* making this a blanket "any carrier converts to boolean" capability: the
|
|
1059
|
+
* SAME renderer applies `ToBoolean` only to arms this merge's own narrowing
|
|
1060
|
+
* already proved live, one call site's condition and nowhere else -- not a
|
|
1061
|
+
* new entry in the general conversion registry, which would let it fire for
|
|
1062
|
+
* any unrelated occurrence of the same representation pair.
|
|
1063
|
+
*/
|
|
1064
|
+
/**
|
|
1065
|
+
* Whether a `&&` merge publishes its kept operand's TRUTHINESS rather than
|
|
1066
|
+
* its value.
|
|
1067
|
+
*
|
|
1068
|
+
* The same proof `isBooleanShapedMergeTarget` states for one live arm of a
|
|
1069
|
+
* partially-dead tagged union, asked of the kept operand as a WHOLE -- and
|
|
1070
|
+
* for the same reason. ECMA-262 decides which operand `&&` keeps by
|
|
1071
|
+
* `ToBoolean` in the first place, so when the checker's type for the whole
|
|
1072
|
+
* expression is a plain `boolean` while the kept operand's own carrier is
|
|
1073
|
+
* not, it has already proven the kept contribution meaningful only as its
|
|
1074
|
+
* truthiness. `object && object.isObject3D` over three's `Object3D` is the
|
|
1075
|
+
* shape: the merge publishes `boolean`, the kept side is a
|
|
1076
|
+
* `class-ref(shared-refcount)` -- nullable, because `optional.ts` collapses
|
|
1077
|
+
* `T | null` onto it -- and its `ToBoolean` (`emit-presence.ts`'s
|
|
1078
|
+
* `booleanTestText`, total over every carrier) IS the value this branch
|
|
1079
|
+
* yields.
|
|
1080
|
+
*
|
|
1081
|
+
* Deliberately EXACT, not `isBooleanShapedMergeTarget`'s optional-tolerant
|
|
1082
|
+
* test: `optional(scalar(boolean))` would need the boolean wrapped back into
|
|
1083
|
+
* an optional, a second step `ir/lower-narrow.ts` has no conversion use to
|
|
1084
|
+
* name here. A merge that publishes `boolean | undefined` keeps raising its
|
|
1085
|
+
* obligation, correctly, rather than being half-answered.
|
|
1086
|
+
*
|
|
1087
|
+
* Asked by `ir/lower-narrow.ts`'s `mergeIncoming`, the one authority on what
|
|
1088
|
+
* a merge arm builds.
|
|
1089
|
+
*/
|
|
1090
|
+
export declare const mergesAsTruthiness: (merged: Representation) => boolean;
|
|
1091
|
+
export declare const isBooleanShapedMergeTarget: (representation: Representation) => boolean;
|
|
1092
|
+
export declare const partialDeadMergeArms: (representation: Representation) => PartialMergeArmSplit | null;
|
|
1093
|
+
/**
|
|
1094
|
+
* The ownership class a carrier crosses a body boundary under, or `null` when
|
|
1095
|
+
* it states none a copy can be proven safe under.
|
|
1096
|
+
*
|
|
1097
|
+
* One function, because everything that spells a `capture:` capability keys
|
|
1098
|
+
* the manifest's `captureOwnershipSupport` by this string: `ir/certify.ts`
|
|
1099
|
+
* demands it, `targets/cpp/captures.ts` admits it, and
|
|
1100
|
+
* `emit-binding-reference.ts` names it in the refusal when admission says no.
|
|
1101
|
+
*
|
|
1102
|
+
* It used to be two. This one answered `'value'` by `default` and the one in
|
|
1103
|
+
* `ir/captures.ts` answered `null` for `unresolved`, `proxy-object`,
|
|
1104
|
+
* `borrowed-ref`, `dense-buffer`, `native-sequence`, `iterator` and `promise`
|
|
1105
|
+
* -- so certification published `capture:value` for carriers whose admission
|
|
1106
|
+
* then refused them by name, the same certify/print disagreement 2.3 fixed
|
|
1107
|
+
* four of. The fail-CLOSED answer is the correct one and is what survives: a
|
|
1108
|
+
* carrier that names no copy-safe ownership must refuse where the certificate
|
|
1109
|
+
* is minted, not where the text is spelled. The hole was invisible only
|
|
1110
|
+
* because `AllocateCallableOperation.captures` is still unfilled, so
|
|
1111
|
+
* `ir/certify.ts`'s own demand list is empty today.
|
|
1112
|
+
*/
|
|
1113
|
+
export declare const ownershipOf: (representation: Representation) => string | null;
|
|
1114
|
+
/**
|
|
1115
|
+
* The `capture:` capability discriminator for a carrier -- what both the
|
|
1116
|
+
* demand and the refusal spell.
|
|
1117
|
+
*
|
|
1118
|
+
* A carrier with no copy-safe ownership still has to name SOMETHING, because
|
|
1119
|
+
* a demand keyed on a name the manifest cannot publish is precisely how the
|
|
1120
|
+
* refusal stays typed and attributable: `capture:unsupported-proxy-object`
|
|
1121
|
+
* says which carrier could not be transported, where a bare `capture:null`
|
|
1122
|
+
* would say only that one could not. `null` for the representation itself is
|
|
1123
|
+
* a placement that never stated one, which is a different unknown and spells
|
|
1124
|
+
* differently.
|
|
1125
|
+
*/
|
|
1126
|
+
export declare const captureCapabilityOf: (representation: Representation | null) => string;
|
|
1127
|
+
/**
|
|
1128
|
+
* Every carrier reachable inside a representation, including the root.
|
|
1129
|
+
*
|
|
1130
|
+
* One walk, shared: `verify.ts`'s guards ask "is anything in here unresolved /
|
|
1131
|
+
* boxed / a dense buffer", and a probe in the emitter asks "is anything in here
|
|
1132
|
+
* unresolved" before it asks for a physical C++ type. Two copies of this switch
|
|
1133
|
+
* would answer those questions over different carrier sets, which is precisely
|
|
1134
|
+
* how a fail-closed guard silently stops covering a kind.
|
|
1135
|
+
*
|
|
1136
|
+
* ⛔ `record-with-index` was missing from this switch and fell through to
|
|
1137
|
+
* `default`, so nothing inside one was ever visited: mongodb's `Filter` -- a
|
|
1138
|
+
* record-with-index whose fields are the whole query -- was invisible to every
|
|
1139
|
+
* guard built on this walk.
|
|
1140
|
+
*/
|
|
1141
|
+
export declare function walkRepresentation(representation: Representation, visited?: Set<Representation>): Generator<Representation>;
|
|
1142
|
+
/**
|
|
1143
|
+
* Whether a carrier holds lattice bottom anywhere inside it.
|
|
1144
|
+
*
|
|
1145
|
+
* `unresolved` has no physical type, and `targets/cpp/types.ts`'s `cppTypeOf`
|
|
1146
|
+
* throws on one rather than inventing a slot -- correctly, since a carrier that
|
|
1147
|
+
* was never selected must not materialize as a default-constructed value. That
|
|
1148
|
+
* makes it a hazard for the emitter's *probes*: a function asking "could this
|
|
1149
|
+
* record be recast to an array?" is asking a question with a legitimate `false`
|
|
1150
|
+
* answer, and it must not blow up the compile to find out. Asking this first is
|
|
1151
|
+
* how such a probe stays a probe.
|
|
1152
|
+
*/
|
|
1153
|
+
export declare const containsUnresolved: (representation: Representation) => boolean;
|
|
1154
|
+
/**
|
|
1155
|
+
* The carrier every `throw` converts its value into: ECMAScript does not
|
|
1156
|
+
* type a thrown value, so this is the one genuinely dynamic boundary the
|
|
1157
|
+
* language itself states. The catch side reads it back without conversion
|
|
1158
|
+
* (`ir/lower-exceptions.ts`).
|
|
1159
|
+
*/
|
|
1160
|
+
export declare const thrownValueCarrier: Representation;
|