@geastack/compiler 1.0.37 → 1.0.38
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/dist/cli-emit.js +5 -0
- package/dist/cli.js +10 -0
- package/dist/compiler.d.ts +10 -3
- package/dist/compiler.js +364 -224
- package/dist/conversion/build.d.ts +13 -1
- package/dist/conversion/build.js +336 -141
- package/dist/conversion/graph-validation.d.ts +7 -2
- package/dist/conversion/graph-validation.js +36 -22
- package/dist/conversion/native-sum.js +106 -17
- package/dist/diagnostics/sweep.js +1 -1
- package/dist/ir/callable-class-flow.d.ts +0 -11
- package/dist/ir/callable-class-flow.js +970 -169
- package/dist/ir/certificate.d.ts +1 -1
- package/dist/ir/certificate.js +12 -1
- package/dist/ir/certify/carrier-keys.d.ts +17 -1
- package/dist/ir/certify/carrier-keys.js +35 -2
- package/dist/ir/certify/function-source.js +2 -1
- package/dist/ir/certify/has-property-key.d.ts +6 -0
- package/dist/ir/certify/has-property-key.js +8 -1
- package/dist/ir/certify/property-access-keys.js +2 -1
- package/dist/ir/certify/runtime-helper.js +2 -1
- package/dist/ir/emission-representations.d.ts +2 -2
- package/dist/ir/emission-representations.js +9 -3
- package/dist/ir/generic-call-entry.d.ts +3 -1
- package/dist/ir/logical-receivers.js +29 -1
- package/dist/ir/lower-completion.js +11 -6
- package/dist/ir/lower-destructuring.js +3 -2
- package/dist/ir/native-host-method-reads.d.ts +5 -0
- package/dist/ir/native-host-method-reads.js +30 -21
- package/dist/ir/operation-conversions.js +4 -1
- package/dist/ir/publish-conversion-recipes.js +12 -1
- package/dist/plugins/apple/jsx.js +1 -1
- package/dist/plugins/gea/component-classes.js +1 -1
- package/dist/plugins/gea/component-inline.js +1 -1
- package/dist/plugins/gea/contract.d.ts +1 -1
- package/dist/plugins/gea/contract.js +1 -1
- package/dist/plugins/gea/host.js +27 -1
- package/dist/plugins/gea/lower.js +8 -1
- package/dist/plugins/gea/producer.js +1 -1
- package/dist/plugins/gea/reactive-slots.d.ts +1 -1
- package/dist/plugins/gea/reactive-slots.js +1 -1
- package/dist/plugins/load.js +51 -22
- package/dist/preflight/run.d.ts +12 -1
- package/dist/preflight/run.js +65 -29
- package/dist/projection/native-callable-data.js +2 -1
- package/dist/representation/plan.js +102 -4
- package/dist/semantics/alias-this-field-declaration-transform.js +1 -1
- package/dist/semantics/ambient-type-realization-transform.js +1 -1
- package/dist/semantics/ambient.d.ts +1 -1
- package/dist/semantics/ambient.js +1 -1
- package/dist/semantics/borrowed-builtin-call-bind-source-transform.js +1 -1
- package/dist/semantics/borrowed-method-receiver-copy-source-transform.js +1 -1
- package/dist/semantics/call-invalidated-narrowing.d.ts +1 -1
- package/dist/semantics/call-invalidated-narrowing.js +4 -2
- package/dist/semantics/callable-own-data-slots.d.ts +6 -0
- package/dist/semantics/callable-own-data-slots.js +177 -101
- package/dist/semantics/class-alias.d.ts +1 -1
- package/dist/semantics/class-alias.js +1 -1
- package/dist/semantics/class-heritage.d.ts +1 -1
- package/dist/semantics/class-heritage.js +1 -1
- package/dist/semantics/commonjs-wrapper.d.ts +4 -3
- package/dist/semantics/commonjs-wrapper.js +50 -7
- package/dist/semantics/constructor-function-class-source-transform.js +1 -1
- package/dist/semantics/constructor-slot-subclasses.d.ts +1 -1
- package/dist/semantics/constructor-slot-subclasses.js +1 -1
- package/dist/semantics/declaration-overlay-transform.js +3 -2
- package/dist/semantics/declared-integers.d.ts +1 -1
- package/dist/semantics/declared-integers.js +1 -1
- package/dist/semantics/define-property-source-transform.js +1 -1
- package/dist/semantics/diagnostic-source-preparation.d.ts +1 -1
- package/dist/semantics/documentation-ranges.d.ts +1 -1
- package/dist/semantics/documentation-ranges.js +1 -1
- package/dist/semantics/dynamic-fallback.d.ts +1 -1
- package/dist/semantics/dynamic-fallback.js +1 -1
- package/dist/semantics/frontend-timing.js +19 -0
- package/dist/semantics/frontend.d.ts +2 -2
- package/dist/semantics/frontend.js +127 -54
- package/dist/semantics/host-declaration-provenance.d.ts +1 -1
- package/dist/semantics/host-methods.d.ts +1 -1
- package/dist/semantics/host-methods.js +1 -1
- package/dist/semantics/host-protocols.d.ts +1 -1
- package/dist/semantics/host-protocols.js +1 -1
- package/dist/semantics/inherited-accessor.d.ts +1 -1
- package/dist/semantics/inherited-accessor.js +1 -1
- package/dist/semantics/interface-families.d.ts +1 -1
- package/dist/semantics/interface-families.js +1 -1
- package/dist/semantics/interface-implementors.d.ts +1 -1
- package/dist/semantics/interface-implementors.js +1 -1
- package/dist/semantics/jsdoc-namepath-transform.js +1 -1
- package/dist/semantics/jsx-runtime-provider.d.ts +1 -1
- package/dist/semantics/jsx-runtime-provider.js +1 -1
- package/dist/semantics/known-caller-predicate-parameters.d.ts +1 -1
- package/dist/semantics/known-caller-predicate-parameters.js +1 -1
- package/dist/semantics/model/edges.d.ts +124 -0
- package/dist/semantics/model/edges.js +192 -0
- package/dist/semantics/model/graph.d.ts +26 -2
- package/dist/semantics/model/graph.js +54 -0
- package/dist/semantics/model/sealed-facts.d.ts +19 -0
- package/dist/semantics/model/sealed-facts.js +221 -0
- package/dist/semantics/model/selected-signature.d.ts +1 -1
- package/dist/semantics/model/selected-signature.js +1 -1
- package/dist/semantics/module-resolution.d.ts +1 -1
- package/dist/semantics/module-resolution.js +1 -1
- package/dist/semantics/native-function-signatures.d.ts +1 -1
- package/dist/semantics/native-function-signatures.js +1 -1
- package/dist/semantics/native-object-data-slots.js +20 -4
- package/dist/semantics/new-callee-class-tag-source-transform.js +1 -1
- package/dist/semantics/node-project.d.ts +1 -1
- package/dist/semantics/node-project.js +1 -1
- package/dist/semantics/node-source-hooks.js +1 -1
- package/dist/semantics/normalize/absent-globals.d.ts +1 -1
- package/dist/semantics/normalize/absent-globals.js +1 -1
- package/dist/semantics/normalize/any-cast-member-call.d.ts +1 -1
- package/dist/semantics/normalize/any-cast-member-call.js +1 -1
- package/dist/semantics/normalize/arguments-objects.d.ts +1 -1
- package/dist/semantics/normalize/arguments-objects.js +1 -1
- package/dist/semantics/normalize/asserted-argument-arms.d.ts +1 -1
- package/dist/semantics/normalize/asserted-argument-arms.js +1 -1
- package/dist/semantics/normalize/asserted-arm-absence.d.ts +1 -1
- package/dist/semantics/normalize/asserted-arm-absence.js +1 -1
- package/dist/semantics/normalize/assignment-patterns.d.ts +1 -1
- package/dist/semantics/normalize/assignment-patterns.js +1 -1
- package/dist/semantics/normalize/bag-absence.d.ts +1 -1
- package/dist/semantics/normalize/bag-absence.js +1 -1
- package/dist/semantics/normalize/binding-fixpoint.js +9 -2
- package/dist/semantics/normalize/bivariant-slot-parameter.d.ts +1 -1
- package/dist/semantics/normalize/bivariant-slot-parameter.js +1 -1
- package/dist/semantics/normalize/callable-data-write.d.ts +1 -1
- package/dist/semantics/normalize/callable-data-write.js +1 -1
- package/dist/semantics/normalize/callback-parameter-contracts.d.ts +1 -1
- package/dist/semantics/normalize/callback-parameter-contracts.js +1 -1
- package/dist/semantics/normalize/cells/agreement.d.ts +18 -1
- package/dist/semantics/normalize/cells/agreement.js +8 -0
- package/dist/semantics/normalize/cells/candidates.d.ts +1 -1
- package/dist/semantics/normalize/cells/candidates.js +1 -1
- package/dist/semantics/normalize/cells/facts.d.ts +1 -1
- package/dist/semantics/normalize/cells/facts.js +1 -1
- package/dist/semantics/normalize/cells/index.d.ts +2 -2
- package/dist/semantics/normalize/cells/index.js +1 -1
- package/dist/semantics/normalize/cells/model.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/bag.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/collection.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/collection.js +1 -1
- package/dist/semantics/normalize/cells/policies/field.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/field.js +1 -1
- package/dist/semantics/normalize/cells/policies/index.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/local.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/local.js +1 -1
- package/dist/semantics/normalize/cells/policies/parameter.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/parameter.js +1 -1
- package/dist/semantics/normalize/cells/policies/return.d.ts +1 -1
- package/dist/semantics/normalize/cells/policies/return.js +1 -1
- package/dist/semantics/normalize/cells/policies/shared.d.ts +1 -1
- package/dist/semantics/normalize/cells/policy.d.ts +1 -1
- package/dist/semantics/normalize/census.d.ts +1 -1
- package/dist/semantics/normalize/census.js +45 -12
- package/dist/semantics/normalize/class-instance-record-statement.d.ts +1 -1
- package/dist/semantics/normalize/class-instance-record-statement.js +1 -1
- package/dist/semantics/normalize/collection-bindings.d.ts +1 -1
- package/dist/semantics/normalize/collection-bindings.js +1 -1
- package/dist/semantics/normalize/commonjs-module-record.d.ts +1 -1
- package/dist/semantics/normalize/commonjs-module-record.js +1 -1
- package/dist/semantics/normalize/commonjs-require.d.ts +1 -1
- package/dist/semantics/normalize/commonjs-require.js +1 -1
- package/dist/semantics/normalize/contribution.d.ts +4 -3
- package/dist/semantics/normalize/contribution.js +145 -42
- package/dist/semantics/normalize/dead-event-emissions.d.ts +1 -1
- package/dist/semantics/normalize/dead-event-emissions.js +1 -1
- package/dist/semantics/normalize/dead-method-copies.d.ts +1 -1
- package/dist/semantics/normalize/dead-method-copies.js +1 -1
- package/dist/semantics/normalize/dead-typeof-guards.d.ts +1 -1
- package/dist/semantics/normalize/dead-typeof-guards.js +1 -1
- package/dist/semantics/normalize/deferred-intrinsic-protocols.d.ts +1 -1
- package/dist/semantics/normalize/deferred-intrinsic-protocols.js +1 -1
- package/dist/semantics/normalize/derived-expression-type.d.ts +1 -1
- package/dist/semantics/normalize/derived-expression-type.js +4 -4
- package/dist/semantics/normalize/evaluation-order.d.ts +1 -1
- package/dist/semantics/normalize/evaluation-order.js +1 -1
- package/dist/semantics/normalize/field-bindings.d.ts +1 -1
- package/dist/semantics/normalize/field-bindings.js +4 -3
- package/dist/semantics/normalize/flow/array-element-continuation.d.ts +1 -1
- package/dist/semantics/normalize/flow/array-element-continuation.js +3 -3
- package/dist/semantics/normalize/flow/callable-array-origins.d.ts +1 -1
- package/dist/semantics/normalize/flow/callable-array-origins.js +1 -1
- package/dist/semantics/normalize/flow/callable-completions.d.ts +1 -1
- package/dist/semantics/normalize/flow/callable-completions.js +1 -1
- package/dist/semantics/normalize/flow/callable-reach.d.ts +1 -1
- package/dist/semantics/normalize/flow/callable-reach.js +73 -52
- package/dist/semantics/normalize/flow/class-family-member-read.d.ts +1 -1
- package/dist/semantics/normalize/flow/class-family-member-read.js +3 -3
- package/dist/semantics/normalize/flow/collection-value-continuation.d.ts +1 -1
- package/dist/semantics/normalize/flow/collection-value-continuation.js +1 -1
- package/dist/semantics/normalize/flow/component-solver.d.ts +181 -3
- package/dist/semantics/normalize/flow/component-solver.js +705 -164
- package/dist/semantics/normalize/flow/computed-key-set.d.ts +1 -1
- package/dist/semantics/normalize/flow/computed-key-set.js +1 -1
- package/dist/semantics/normalize/flow/export-importers.d.ts +1 -1
- package/dist/semantics/normalize/flow/export-importers.js +13 -3
- package/dist/semantics/normalize/flow/host-text-sink.d.ts +1 -1
- package/dist/semantics/normalize/flow/host-text-sink.js +1 -1
- package/dist/semantics/normalize/flow/intrinsic-array-callback-frames.d.ts +1 -1
- package/dist/semantics/normalize/flow/intrinsic-array-callback-frames.js +1 -1
- package/dist/semantics/normalize/flow/intrinsic-data-definition.d.ts +1 -1
- package/dist/semantics/normalize/flow/intrinsic-data-definition.js +1 -1
- package/dist/semantics/normalize/flow/invocation-facts.d.ts +1 -1
- package/dist/semantics/normalize/flow/invocation-facts.js +1 -1
- package/dist/semantics/normalize/flow/member-call-forwarding.d.ts +1 -1
- package/dist/semantics/normalize/flow/member-call-forwarding.js +1 -1
- package/dist/semantics/normalize/flow/model.d.ts +1 -1
- package/dist/semantics/normalize/flow/model.js +5 -1
- package/dist/semantics/normalize/flow/native-collection-protocol.d.ts +1 -1
- package/dist/semantics/normalize/flow/native-collection-protocol.js +1 -1
- package/dist/semantics/normalize/flow/node-path-token.d.ts +1 -1
- package/dist/semantics/normalize/flow/object-binding-continuation.d.ts +1 -1
- package/dist/semantics/normalize/flow/object-binding-continuation.js +1 -1
- package/dist/semantics/normalize/flow/origin-authority.d.ts +1 -1
- package/dist/semantics/normalize/flow/owned-class-receivers.d.ts +1 -1
- package/dist/semantics/normalize/flow/owned-class-receivers.js +1 -1
- package/dist/semantics/normalize/flow/parameter-values.d.ts +1 -1
- package/dist/semantics/normalize/flow/parameter-values.js +1 -1
- package/dist/semantics/normalize/flow/record-alias-closure.d.ts +1 -1
- package/dist/semantics/normalize/flow/record-alias-closure.js +1 -1
- package/dist/semantics/normalize/flow/seeded-origins.d.ts +1 -1
- package/dist/semantics/normalize/flow/seeded-origins.js +1 -1
- package/dist/semantics/normalize/flow/source-accessor-descriptor.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-accessor-descriptor.js +1 -1
- package/dist/semantics/normalize/flow/source-callable-own-data.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-callable-own-data.js +1 -1
- package/dist/semantics/normalize/flow/source-callable-readonly-set.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-callable-readonly-set.js +1 -1
- package/dist/semantics/normalize/flow/source-class-data.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-class-data.js +1 -1
- package/dist/semantics/normalize/flow/source-class-instanceof.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-class-instanceof.js +1 -1
- package/dist/semantics/normalize/flow/source-class-static-data.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-class-static-data.js +1 -1
- package/dist/semantics/normalize/flow/source-commonjs-exports.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-construction-frames.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-construction-frames.js +1 -1
- package/dist/semantics/normalize/flow/source-descriptor-protocol.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-descriptor-protocol.js +1 -1
- package/dist/semantics/normalize/flow/source-executing-parameter-values.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-executing-parameter-values.js +1 -1
- package/dist/semantics/normalize/flow/source-global-binding.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-global-binding.js +1 -1
- package/dist/semantics/normalize/flow/source-intrinsic-member-data.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-intrinsic-member-data.js +1 -1
- package/dist/semantics/normalize/flow/source-invocation-frame-layout.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-invocation-frame-layout.js +24 -32
- package/dist/semantics/normalize/flow/source-invocation-receiver.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-invocation-receiver.js +1 -1
- package/dist/semantics/normalize/flow/source-native-class-alias.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-native-class-alias.js +1 -1
- package/dist/semantics/normalize/flow/source-native-iterable-integrity.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-native-iterable-integrity.js +1 -1
- package/dist/semantics/normalize/flow/source-native-origin.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-native-origin.js +1 -1
- package/dist/semantics/normalize/flow/source-normal-predecessor.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-normal-predecessor.js +1 -1
- package/dist/semantics/normalize/flow/source-property-key.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-property-key.js +1 -1
- package/dist/semantics/normalize/flow/source-prototype-method-identity.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-prototype-method-identity.js +1 -1
- package/dist/semantics/normalize/flow/source-proxy-operation.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-proxy-operation.js +1 -1
- package/dist/semantics/normalize/flow/source-raw-constructor-entry.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-raw-constructor-entry.js +1 -1
- package/dist/semantics/normalize/flow/source-read-protocol.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-read-protocol.js +1 -1
- package/dist/semantics/normalize/flow/source-record-data.d.ts +1 -1
- package/dist/semantics/normalize/flow/source-record-data.js +1 -1
- package/dist/semantics/normalize/flow/source-value-session.d.ts +33 -3
- package/dist/semantics/normalize/flow/source-value-session.js +381 -173
- package/dist/semantics/normalize/flow/standard-prototype-method-source.d.ts +1 -1
- package/dist/semantics/normalize/flow/standard-prototype-method-source.js +1 -1
- package/dist/semantics/normalize/flow/targets.d.ts +1 -1
- package/dist/semantics/normalize/flow/targets.js +1 -1
- package/dist/semantics/normalize/flow/value-flow.d.ts +1 -1
- package/dist/semantics/normalize/flow/value-flow.js +243 -52
- package/dist/semantics/normalize/flow/value-provenance.d.ts +1 -1
- package/dist/semantics/normalize/flow/value-provenance.js +1 -1
- package/dist/semantics/normalize/fresh-dictionary-storage.d.ts +1 -1
- package/dist/semantics/normalize/fresh-dictionary-storage.js +1 -1
- package/dist/semantics/normalize/fresh-ordinary-object.d.ts +1 -1
- package/dist/semantics/normalize/fresh-ordinary-object.js +1 -1
- package/dist/semantics/normalize/fresh-table-last-use.d.ts +1 -1
- package/dist/semantics/normalize/fresh-table-last-use.js +1 -1
- package/dist/semantics/normalize/gating.d.ts +3 -3
- package/dist/semantics/normalize/gating.js +17 -20
- package/dist/semantics/normalize/generic-function-choice.d.ts +1 -1
- package/dist/semantics/normalize/generic-function-choice.js +1 -1
- package/dist/semantics/normalize/global-host-mutations.d.ts +1 -1
- package/dist/semantics/normalize/global-host-mutations.js +420 -138
- package/dist/semantics/normalize/host-effect-contracts.d.ts +1 -1
- package/dist/semantics/normalize/host-effect-contracts.js +1 -1
- package/dist/semantics/normalize/host-mutation-computed-keys.d.ts +1 -1
- package/dist/semantics/normalize/host-mutation-key-reader.d.ts +1 -1
- package/dist/semantics/normalize/host-mutation-key-reader.js +1 -1
- package/dist/semantics/normalize/identities.d.ts +41 -1
- package/dist/semantics/normalize/identities.js +75 -9
- package/dist/semantics/normalize/implicit-arguments-tuple.d.ts +1 -1
- package/dist/semantics/normalize/implicit-arguments-tuple.js +1 -1
- package/dist/semantics/normalize/implicit-arguments.d.ts +1 -1
- package/dist/semantics/normalize/implicit-arguments.js +1 -1
- package/dist/semantics/normalize/installed-global-properties.d.ts +1 -1
- package/dist/semantics/normalize/installed-global-properties.js +1 -1
- package/dist/semantics/normalize/instantiation.d.ts +1 -1
- package/dist/semantics/normalize/instantiation.js +1 -1
- package/dist/semantics/normalize/intrinsic-accessor-getter.d.ts +1 -1
- package/dist/semantics/normalize/intrinsic-accessor-getter.js +1 -1
- package/dist/semantics/normalize/intrinsic-property-call.d.ts +1 -1
- package/dist/semantics/normalize/intrinsic-property-call.js +1 -1
- package/dist/semantics/normalize/intrinsic-prototype.d.ts +1 -1
- package/dist/semantics/normalize/intrinsic-prototype.js +1 -1
- package/dist/semantics/normalize/intrinsic-return-identity.d.ts +1 -1
- package/dist/semantics/normalize/intrinsic-return-identity.js +1 -1
- package/dist/semantics/normalize/intrinsic-static-member.d.ts +1 -1
- package/dist/semantics/normalize/jsdoc-type-names.d.ts +1 -1
- package/dist/semantics/normalize/jsdoc-type-names.js +1 -1
- package/dist/semantics/normalize/local-bindings.d.ts +1 -1
- package/dist/semantics/normalize/local-bindings.js +3 -2
- package/dist/semantics/normalize/logical-object-truthiness.d.ts +1 -1
- package/dist/semantics/normalize/logical-object-truthiness.js +1 -1
- package/dist/semantics/normalize/logical-result-type.d.ts +1 -1
- package/dist/semantics/normalize/logical-result-type.js +1 -1
- package/dist/semantics/normalize/merged-declaration.d.ts +1 -1
- package/dist/semantics/normalize/merged-declaration.js +1 -1
- package/dist/semantics/normalize/namespace-paths.d.ts +1 -1
- package/dist/semantics/normalize/namespace-paths.js +1 -1
- package/dist/semantics/normalize/never-override-result.d.ts +1 -1
- package/dist/semantics/normalize/never-override-result.js +1 -1
- package/dist/semantics/normalize/normalize.d.ts +23 -4
- package/dist/semantics/normalize/normalize.js +125 -15
- package/dist/semantics/normalize/null-blind-parameter.d.ts +1 -1
- package/dist/semantics/normalize/null-blind-parameter.js +1 -1
- package/dist/semantics/normalize/nullable-memo.d.ts +28 -0
- package/dist/semantics/normalize/nullable-memo.js +99 -0
- package/dist/semantics/normalize/object-bag-bindings.d.ts +1 -1
- package/dist/semantics/normalize/object-bag-bindings.js +15 -4
- package/dist/semantics/normalize/omitted-stated-parameter.d.ts +1 -1
- package/dist/semantics/normalize/omitted-stated-parameter.js +1 -1
- package/dist/semantics/normalize/open-type-form.d.ts +1 -1
- package/dist/semantics/normalize/open-type-form.js +1 -1
- package/dist/semantics/normalize/override-field-arms.d.ts +1 -1
- package/dist/semantics/normalize/override-field-arms.js +1 -1
- package/dist/semantics/normalize/parameter-bindings.d.ts +1 -52
- package/dist/semantics/normalize/parameter-bindings.js +105 -10
- package/dist/semantics/normalize/parameter-slot.d.ts +1 -1
- package/dist/semantics/normalize/parameter-slot.js +1 -1
- package/dist/semantics/normalize/physical-overload-result.d.ts +1 -1
- package/dist/semantics/normalize/physical-overload-result.js +1 -1
- package/dist/semantics/normalize/primitive-property-absence.d.ts +1 -1
- package/dist/semantics/normalize/producer-context.d.ts +1 -1
- package/dist/semantics/normalize/producers/allocations.d.ts +1 -1
- package/dist/semantics/normalize/producers/allocations.js +1 -1
- package/dist/semantics/normalize/producers/binding-kind.d.ts +1 -1
- package/dist/semantics/normalize/producers/binding-kind.js +1 -1
- package/dist/semantics/normalize/producers/bindings.d.ts +1 -1
- package/dist/semantics/normalize/producers/bindings.js +1 -1
- package/dist/semantics/normalize/producers/boundary.d.ts +1 -1
- package/dist/semantics/normalize/producers/boundary.js +1 -1
- package/dist/semantics/normalize/producers/cited-value-type.d.ts +1 -1
- package/dist/semantics/normalize/producers/cited-value-type.js +1 -1
- package/dist/semantics/normalize/producers/class-lifecycle.js +1 -1
- package/dist/semantics/normalize/producers/computations.js +1 -1
- package/dist/semantics/normalize/producers/conditional-guard.d.ts +1 -1
- package/dist/semantics/normalize/producers/control-loops.d.ts +1 -1
- package/dist/semantics/normalize/producers/control-loops.js +1 -1
- package/dist/semantics/normalize/producers/control.d.ts +1 -1
- package/dist/semantics/normalize/producers/control.js +1 -1
- package/dist/semantics/normalize/producers/declaration-lifecycle.js +1 -1
- package/dist/semantics/normalize/producers/destructuring.d.ts +1 -1
- package/dist/semantics/normalize/producers/destructuring.js +1 -1
- package/dist/semantics/normalize/producers/dynamic-language.js +1 -1
- package/dist/semantics/normalize/producers/enums.d.ts +1 -1
- package/dist/semantics/normalize/producers/enums.js +1 -1
- package/dist/semantics/normalize/producers/erasure.d.ts +1 -1
- package/dist/semantics/normalize/producers/erasure.js +1 -1
- package/dist/semantics/normalize/producers/exact-arms.d.ts +1 -1
- package/dist/semantics/normalize/producers/exact-arms.js +1 -1
- package/dist/semantics/normalize/producers/intrinsic-accessor-getter.d.ts +1 -1
- package/dist/semantics/normalize/producers/invocations.d.ts +1 -1
- package/dist/semantics/normalize/producers/invocations.js +1 -1
- package/dist/semantics/normalize/producers/iteration-yield.d.ts +1 -1
- package/dist/semantics/normalize/producers/iteration-yield.js +1 -1
- package/dist/semantics/normalize/producers/jsx.js +1 -1
- package/dist/semantics/normalize/producers/logical-merge-type.d.ts +1 -1
- package/dist/semantics/normalize/producers/logical-merge-type.js +1 -1
- package/dist/semantics/normalize/producers/mint.js +88 -5
- package/dist/semantics/normalize/producers/native-callable-readonly-set.d.ts +1 -1
- package/dist/semantics/normalize/producers/native-own-assignment.d.ts +1 -1
- package/dist/semantics/normalize/producers/native-own-assignment.js +1 -1
- package/dist/semantics/normalize/producers/nullish.d.ts +1 -1
- package/dist/semantics/normalize/producers/nullish.js +1 -1
- package/dist/semantics/normalize/producers/object-assignment.d.ts +1 -1
- package/dist/semantics/normalize/producers/object-assignment.js +1 -1
- package/dist/semantics/normalize/producers/object-tag.d.ts +1 -1
- package/dist/semantics/normalize/producers/object-tag.js +1 -1
- package/dist/semantics/normalize/producers/optional-chain.d.ts +1 -1
- package/dist/semantics/normalize/producers/optional-chain.js +1 -1
- package/dist/semantics/normalize/producers/properties.d.ts +1 -1
- package/dist/semantics/normalize/producers/properties.js +1 -1
- package/dist/semantics/normalize/producers/protocol.d.ts +1 -1
- package/dist/semantics/normalize/producers/protocol.js +1 -1
- package/dist/semantics/normalize/producers/references.d.ts +1 -1
- package/dist/semantics/normalize/producers/references.js +1 -1
- package/dist/semantics/normalize/producers/shared.d.ts +1 -1
- package/dist/semantics/normalize/producers/shared.js +1 -1
- package/dist/semantics/normalize/producers/spread-arguments.d.ts +1 -1
- package/dist/semantics/normalize/producers/spread-arguments.js +1 -1
- package/dist/semantics/normalize/producers/tagged-template.d.ts +1 -1
- package/dist/semantics/normalize/producers/tagged-template.js +1 -1
- package/dist/semantics/normalize/producers/tuple-spread.d.ts +1 -1
- package/dist/semantics/normalize/producers/tuple-spread.js +1 -1
- package/dist/semantics/normalize/property-key-domain.d.ts +8 -1
- package/dist/semantics/normalize/property-key-domain.js +74 -47
- package/dist/semantics/normalize/reachability.d.ts +1 -1
- package/dist/semantics/normalize/reachability.js +3 -2
- package/dist/semantics/normalize/reassigned-bindings.d.ts +1 -1
- package/dist/semantics/normalize/record-home-arms.d.ts +1 -1
- package/dist/semantics/normalize/record-home-arms.js +1 -1
- package/dist/semantics/normalize/record-link-families.d.ts +1 -1
- package/dist/semantics/normalize/record-link-families.js +1 -1
- package/dist/semantics/normalize/record-stand-in-arms.d.ts +1 -1
- package/dist/semantics/normalize/record-stand-in-arms.js +1 -1
- package/dist/semantics/normalize/record-storage-families.d.ts +1 -1
- package/dist/semantics/normalize/record-storage-families.js +1 -1
- package/dist/semantics/normalize/return-bindings.d.ts +1 -1
- package/dist/semantics/normalize/return-bindings.js +1 -1
- package/dist/semantics/normalize/return-paths.d.ts +1 -1
- package/dist/semantics/normalize/return-paths.js +1 -1
- package/dist/semantics/normalize/round-tables.d.ts +21 -0
- package/dist/semantics/normalize/round-tables.js +59 -0
- package/dist/semantics/normalize/script-global-redefinition.d.ts +1 -1
- package/dist/semantics/normalize/script-global-redefinition.js +1 -1
- package/dist/semantics/normalize/shared-array-storage.d.ts +1 -1
- package/dist/semantics/normalize/shared-array-storage.js +1 -1
- package/dist/semantics/normalize/sloppy-absence.d.ts +1 -1
- package/dist/semantics/normalize/sloppy-absence.js +1 -1
- package/dist/semantics/normalize/source-native-iterable.d.ts +2 -2
- package/dist/semantics/normalize/source-native-iterable.js +4 -2
- package/dist/semantics/normalize/source-object-prototype-absence.d.ts +1 -1
- package/dist/semantics/normalize/source-object-prototype-absence.js +1 -1
- package/dist/semantics/normalize/specialization.d.ts +1 -1
- package/dist/semantics/normalize/specialization.js +1 -1
- package/dist/semantics/normalize/specialized-source-frames.d.ts +1 -1
- package/dist/semantics/normalize/specialized-source-frames.js +12 -4
- package/dist/semantics/normalize/structural-any-binding-consumer.d.ts +1 -1
- package/dist/semantics/normalize/structural-any-binding-consumer.js +1 -1
- package/dist/semantics/normalize/structural-array-element.d.ts +1 -1
- package/dist/semantics/normalize/structural-array-element.js +1 -1
- package/dist/semantics/normalize/structural-array-read.d.ts +1 -1
- package/dist/semantics/normalize/structural-array-read.js +1 -1
- package/dist/semantics/normalize/structural-callable.d.ts +1 -1
- package/dist/semantics/normalize/structural-callable.js +1 -1
- package/dist/semantics/normalize/structural-creation-order.d.ts +1 -1
- package/dist/semantics/normalize/structural-creation-order.js +1 -1
- package/dist/semantics/normalize/structural-declarations.d.ts +1 -1
- package/dist/semantics/normalize/structural-declarations.js +1 -1
- package/dist/semantics/normalize/structural-declared-body.d.ts +1 -1
- package/dist/semantics/normalize/structural-declared-body.js +1 -1
- package/dist/semantics/normalize/structural-generics.d.ts +1 -1
- package/dist/semantics/normalize/structural-generics.js +1 -1
- package/dist/semantics/normalize/structural-indexed-access.d.ts +1 -1
- package/dist/semantics/normalize/structural-indexed-access.js +1 -1
- package/dist/semantics/normalize/structural-instantiated-member.d.ts +1 -1
- package/dist/semantics/normalize/structural-instantiated-member.js +199 -68
- package/dist/semantics/normalize/structural-joins.d.ts +1 -1
- package/dist/semantics/normalize/structural-layout-relevance.d.ts +1 -1
- package/dist/semantics/normalize/structural-layout-relevance.js +1 -1
- package/dist/semantics/normalize/structural-layout-type.d.ts +1 -1
- package/dist/semantics/normalize/structural-layout-type.js +14 -2
- package/dist/semantics/normalize/structural-leaves.d.ts +1 -1
- package/dist/semantics/normalize/structural-leaves.js +1 -1
- package/dist/semantics/normalize/structural-local-union.d.ts +1 -1
- package/dist/semantics/normalize/structural-local-union.js +21 -16
- package/dist/semantics/normalize/structural-members.d.ts +1 -1
- package/dist/semantics/normalize/structural-members.js +1 -1
- package/dist/semantics/normalize/structural-mutable-field.d.ts +1 -2
- package/dist/semantics/normalize/structural-mutable-field.js +17 -4
- package/dist/semantics/normalize/structural-mutable-method.d.ts +1 -1
- package/dist/semantics/normalize/structural-mutable-method.js +1 -1
- package/dist/semantics/normalize/structural-parts.d.ts +1 -1
- package/dist/semantics/normalize/structural-parts.js +1 -1
- package/dist/semantics/normalize/structural-receiver.d.ts +1 -1
- package/dist/semantics/normalize/structural-receiver.js +1 -1
- package/dist/semantics/normalize/structural-rules.d.ts +4 -4
- package/dist/semantics/normalize/structural-rules.js +30 -12
- package/dist/semantics/normalize/structural-self-reference.d.ts +1 -1
- package/dist/semantics/normalize/structural-self-reference.js +1 -1
- package/dist/semantics/normalize/structural.d.ts +1 -1
- package/dist/semantics/normalize/structural.js +2467 -2239
- package/dist/semantics/normalize/suppressed-write-arms.d.ts +1 -1
- package/dist/semantics/normalize/suppressed-write-arms.js +1 -1
- package/dist/semantics/normalize/symbol-keyed-this-slots.d.ts +1 -1
- package/dist/semantics/normalize/symbol-keyed-this-slots.js +1 -1
- package/dist/semantics/normalize/unreduced-type-form.d.ts +1 -1
- package/dist/semantics/normalize/unreduced-type-form.js +1 -1
- package/dist/semantics/normalize/unresolvable-names.d.ts +1 -1
- package/dist/semantics/normalize/unresolvable-names.js +1 -1
- package/dist/semantics/normalize/unshared-array-result.d.ts +1 -1
- package/dist/semantics/normalize/unshared-array-result.js +1 -1
- package/dist/semantics/package-sources.d.ts +1 -1
- package/dist/semantics/package-sources.js +1 -1
- package/dist/semantics/program.d.ts +1 -1
- package/dist/semantics/program.js +11 -5
- package/dist/semantics/prototype-install-source-transform.js +1 -1
- package/dist/semantics/prototype-object-class-source-transform.js +1 -1
- package/dist/semantics/prototype-reparenting.d.ts +1 -1
- package/dist/semantics/prototype-reparenting.js +1 -1
- package/dist/semantics/shared-declaration-files.d.ts +1 -1
- package/dist/semantics/source-transform-exports.js +1 -1
- package/dist/semantics/stable-checker.d.ts +9 -1
- package/dist/semantics/stable-checker.js +21 -5
- package/dist/semantics/subclass-member-overlay-transform.js +46 -5
- package/dist/semantics/symbol-keyed-expando-source-transform.js +1 -1
- package/dist/semantics/this-constructor-source-transform.js +1 -1
- package/dist/semantics/typescript.d.ts +12 -0
- package/dist/semantics/typescript.js +12 -0
- package/dist/semantics/uncached-jsdoc-tags.d.ts +16 -0
- package/dist/semantics/uncached-jsdoc-tags.js +23 -0
- package/dist/semantics/unchecked-guard-argument-copies.d.ts +1 -1
- package/dist/semantics/unchecked-guard-argument-copies.js +1 -1
- package/dist/semantics/unchecked-write-member-declarations.d.ts +1 -1
- package/dist/semantics/unchecked-write-member-declarations.js +1 -1
- package/dist/semantics/uninstantiable-classes.d.ts +1 -1
- package/dist/semantics/uninstantiable-classes.js +1 -1
- package/dist/targets/cpp/conversions.js +137 -87
- package/dist/targets/cpp/emit-in.js +2 -1
- package/dist/targets/cpp/emit-iterator.d.ts +6 -5
- package/dist/targets/cpp/emit-iterator.js +23 -13
- package/dist/targets/cpp/emit-narrowing.d.ts +8 -0
- package/dist/targets/cpp/emit-narrowing.js +11 -1
- package/dist/targets/cpp/emit-record-view.d.ts +9 -0
- package/dist/targets/cpp/emit-record-view.js +12 -1
- package/package.json +7 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import { operationId, regionId, semanticResultId } from '../../../identity/ids.js';
|
|
3
3
|
import { normalCompletion, throwingCompletion, pureEffects } from '../../model/operands.js';
|
|
4
4
|
import { objectAssignmentSource } from '../assignment-patterns.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { outermostErasureOf } from './erasure.js';
|
|
2
|
-
import ts from 'typescript';
|
|
2
|
+
import ts from '#typescript';
|
|
3
3
|
import { throwingCompletion } from '../../model/operands.js';
|
|
4
4
|
import { isGlobalObjectConstructor } from '../derived-expression-type.js';
|
|
5
5
|
import { mintOperationId, mintResult, operand } from './mint.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isObjectTagCalleePart } from './object-tag.js';
|
|
2
2
|
import { contributeIntrinsicAccessorGetter } from './intrinsic-accessor-getter.js';
|
|
3
3
|
import { isIntrinsicAccessorGetterPart } from '../intrinsic-accessor-getter.js';
|
|
4
|
-
import ts from 'typescript';
|
|
4
|
+
import ts from '#typescript';
|
|
5
5
|
import { operationId, semanticResultId } from '../../../identity/ids.js';
|
|
6
6
|
import { normalCompletion, pureEffects, throwingCompletion } from '../../model/operands.js';
|
|
7
7
|
import { blocked, mintOperationId, mintResult, operand } from './mint.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import type { OperationId, SemanticResultId, StructuralTypeId } from '../../../identity/ids.js';
|
|
3
3
|
import type { SemanticEdge } from '../../model/edges.js';
|
|
4
4
|
import { type OperandSource } from '../../model/operands.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import { operationId, semanticResultId } from '../../../identity/ids.js';
|
|
3
3
|
import { pureEffects, throwingCompletion } from '../../model/operands.js';
|
|
4
4
|
import { blocked, mintOperationId, mintResult, operand } from './mint.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import { genericClassAliasTargetSymbol } from '../../class-alias.js';
|
|
3
3
|
import { isScriptGlobalObjectPropertyDeclaration } from '../script-global-redefinition.js';
|
|
4
4
|
import { enclosingCallIfCallee, flowNarrowsType, unwrapErasedExpression } from './erasure.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import { genericFunctionSetMembersOf, runtimeSymbolMemberIndexOf } from '../../model/structural-types.js';
|
|
3
3
|
import { isFabricatedSignatureShape } from '../structural-callable.js';
|
|
4
4
|
import { symbolPropertyKeyText } from '../../model/structural-types.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import type { SemanticEdge } from '../../model/edges.js';
|
|
3
3
|
import type { OperandEvaluation, SemanticOperand } from '../../model/operands.js';
|
|
4
4
|
import type { SemanticOperation } from '../../model/operations.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import { operationId, semanticResultId } from '../../../identity/ids.js';
|
|
3
3
|
import { isFixedArgumentsSpreadAt } from '../implicit-arguments-tuple.js';
|
|
4
4
|
import { argumentsObjectValueAt, isArgumentsObjectIdentifier } from './bindings.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import { semanticResultId } from '../../../identity/ids.js';
|
|
3
3
|
import { normalCompletion, pureEffects, throwingCompletion } from '../../model/operands.js';
|
|
4
4
|
import { blocked, mintOperationId, mintResult, operand } from './mint.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import { semanticResultId } from '../../../identity/ids.js';
|
|
3
3
|
import { normalCompletion, pureEffects } from '../../model/operands.js';
|
|
4
4
|
import { declaredClosedTupleRestElementsOf } from '../parameter-slot.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import type { ValueFlowIndex } from './flow/model.js';
|
|
3
3
|
/** An over-approximation of ToPropertyKey's string results; unknown never excludes a name. */
|
|
4
4
|
export type PropertyKeyDomain = {
|
|
@@ -16,6 +16,13 @@ export type PropertyKeyDomain = {
|
|
|
16
16
|
readonly left: PropertyKeyDomain;
|
|
17
17
|
readonly right: PropertyKeyDomain;
|
|
18
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* `reachable` for a caller that counts every write. A module-level function on
|
|
21
|
+
* purpose: an inline `() => true` shares its context with every other closure
|
|
22
|
+
* of the function that writes it, and key domains are remembered with the flow
|
|
23
|
+
* index -- one such arrow kept half a gigabyte of a proof's authority alive.
|
|
24
|
+
*/
|
|
25
|
+
export declare const everyWriteReachable: () => boolean;
|
|
19
26
|
export declare const createPropertyKeyDomains: (checker: ts.TypeChecker, flow: ValueFlowIndex, reachable: (node: ts.Node) => boolean, parameterTypeAt?: (parameter: ts.Expression) => ts.Type) => {
|
|
20
27
|
readonly of: (expression: ts.Expression) => PropertyKeyDomain;
|
|
21
28
|
readonly mayName: (domain: PropertyKeyDomain, name: string) => boolean;
|
|
@@ -1,21 +1,54 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import { unwrapErasedExpression } from './producers/erasure.js';
|
|
3
3
|
import { isCanonicalNumericKey } from './host-mutation-keys.js';
|
|
4
4
|
const unknown = { kind: 'unknown' };
|
|
5
5
|
const numeric = { kind: 'number' };
|
|
6
6
|
const literal = (value) => ({ kind: 'literal', value });
|
|
7
7
|
const concat = (left, right) => ({ kind: 'concat', left, right });
|
|
8
|
+
const isNumberType = (type) => (type.flags & ts.TypeFlags.NumberLike) !== 0 && (type.flags & ~ts.TypeFlags.NumberLike) === 0;
|
|
8
9
|
const isStringDomain = (domain) => domain.kind === 'literal' || domain.kind === 'concat' || (domain.kind === 'union' && domain.members.every(isStringDomain));
|
|
10
|
+
/**
|
|
11
|
+
* `reachable` for a caller that counts every write. A module-level function on
|
|
12
|
+
* purpose: an inline `() => true` shares its context with every other closure
|
|
13
|
+
* of the function that writes it, and key domains are remembered with the flow
|
|
14
|
+
* index -- one such arrow kept half a gigabyte of a proof's authority alive.
|
|
15
|
+
*/
|
|
16
|
+
export const everyWriteReachable = () => true;
|
|
9
17
|
export const createPropertyKeyDomains = (checker, flow, reachable, parameterTypeAt = (parameter) => checker.getTypeAtLocation(parameter)) => {
|
|
10
18
|
const domains = new Map();
|
|
19
|
+
// One domain per type, not per asking expression: a parameter typed as a
|
|
20
|
+
// union of hundreds of literal keys was rebuilt literal by literal for every
|
|
21
|
+
// reference to it, and the copies were what this table held.
|
|
22
|
+
const typeDomains = new Map();
|
|
11
23
|
const typeDomain = (type) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
const known = typeDomains.get(type);
|
|
25
|
+
if (known)
|
|
26
|
+
return known;
|
|
27
|
+
const domain = type.isUnion()
|
|
28
|
+
? { kind: 'union', members: type.types.map(typeDomain) }
|
|
29
|
+
: type.isStringLiteral()
|
|
30
|
+
? literal(type.value)
|
|
31
|
+
: isNumberType(type)
|
|
32
|
+
? numeric
|
|
33
|
+
: unknown;
|
|
34
|
+
typeDomains.set(type, domain);
|
|
35
|
+
return domain;
|
|
36
|
+
};
|
|
37
|
+
// Every reference to a variable answers the union of its writes, so it is
|
|
38
|
+
// built once per declaration. Entered as `unknown` first for the same reason
|
|
39
|
+
// `domainOf` does: a write that reads the variable itself is a cycle.
|
|
40
|
+
const variables = new Map();
|
|
41
|
+
const variableDomain = (declaration) => {
|
|
42
|
+
const known = variables.get(declaration);
|
|
43
|
+
if (known)
|
|
44
|
+
return known;
|
|
45
|
+
variables.set(declaration, unknown);
|
|
46
|
+
const writes = flow.writesToDeclaration(declaration).filter((write) => reachable(write.site) && write.slot === 'whole');
|
|
47
|
+
const domain = writes.length > 0
|
|
48
|
+
? { kind: 'union', members: writes.map((write) => (write.value === null ? unknown : domainOf(write.value))) }
|
|
49
|
+
: unknown;
|
|
50
|
+
variables.set(declaration, domain);
|
|
51
|
+
return domain;
|
|
19
52
|
};
|
|
20
53
|
const domainOf = (expression) => {
|
|
21
54
|
const current = unwrapErasedExpression(expression);
|
|
@@ -34,7 +67,7 @@ export const createPropertyKeyDomains = (checker, flow, reachable, parameterType
|
|
|
34
67
|
// it: a paging buffer's `page.buffer[o] = b`, with `o` from `i & mask` and
|
|
35
68
|
// `o += this.pageOffset`, stores through a numeric key and so can never
|
|
36
69
|
// name `pageOffset` -- none of the syntax below states that.
|
|
37
|
-
else if (
|
|
70
|
+
else if (isNumberType(checker.getTypeAtLocation(current)))
|
|
38
71
|
result = numeric;
|
|
39
72
|
else if (ts.isTemplateExpression(current)) {
|
|
40
73
|
result = literal(current.head.text);
|
|
@@ -55,13 +88,8 @@ export const createPropertyKeyDomains = (checker, flow, reachable, parameterType
|
|
|
55
88
|
}
|
|
56
89
|
else {
|
|
57
90
|
const declaration = ts.isIdentifier(current) ? flow.targetOf(current)?.declaration : null;
|
|
58
|
-
if (declaration && ts.isVariableDeclaration(declaration))
|
|
59
|
-
|
|
60
|
-
result =
|
|
61
|
-
writes.length > 0
|
|
62
|
-
? { kind: 'union', members: writes.map((write) => (write.value === null ? unknown : domainOf(write.value))) }
|
|
63
|
-
: unknown;
|
|
64
|
-
}
|
|
91
|
+
if (declaration && ts.isVariableDeclaration(declaration))
|
|
92
|
+
result = variableDomain(declaration);
|
|
65
93
|
else if (ts.isIdentifier(current) && declaration && ts.isParameter(declaration)) {
|
|
66
94
|
result = typeDomain(parameterTypeAt(current));
|
|
67
95
|
}
|
|
@@ -69,45 +97,44 @@ export const createPropertyKeyDomains = (checker, flow, reachable, parameterType
|
|
|
69
97
|
domains.set(current, result);
|
|
70
98
|
return result;
|
|
71
99
|
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
100
|
+
// Nothing is remembered across questions. A consumer asks every keyed write
|
|
101
|
+
// against every member name, and its own answers are memoized per name; a
|
|
102
|
+
// table here kept one entry per (write, name) -- and, for a concatenation,
|
|
103
|
+
// every prefix and suffix of every name it split -- for as long as the flow
|
|
104
|
+
// index lived, half a gigabyte on a large program. `domainMayName` remembers
|
|
105
|
+
// a concatenation's parts for one question only.
|
|
106
|
+
const mayName = domainMayName;
|
|
107
|
+
return { of: domainOf, mayName };
|
|
108
|
+
};
|
|
109
|
+
/** One query's answer. The parts are remembered for this query alone: nested concatenations split the same slices repeatedly. */
|
|
110
|
+
const domainMayName = (domain, name) => {
|
|
111
|
+
const parts = new Map();
|
|
112
|
+
const matches = (part, text) => {
|
|
113
|
+
switch (part.kind) {
|
|
84
114
|
case 'unknown':
|
|
85
|
-
|
|
86
|
-
break;
|
|
115
|
+
return true;
|
|
87
116
|
case 'literal':
|
|
88
|
-
|
|
89
|
-
break;
|
|
117
|
+
return part.value === text;
|
|
90
118
|
case 'number':
|
|
91
|
-
|
|
92
|
-
break;
|
|
119
|
+
return String(Number(text)) === text;
|
|
93
120
|
case 'union':
|
|
94
|
-
|
|
95
|
-
break;
|
|
121
|
+
return part.members.some((member) => matches(member, text));
|
|
96
122
|
case 'concat': {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
123
|
+
let texts = parts.get(part);
|
|
124
|
+
if (texts === undefined)
|
|
125
|
+
parts.set(part, (texts = new Map()));
|
|
126
|
+
const known = texts.get(text);
|
|
127
|
+
if (known !== undefined)
|
|
128
|
+
return known;
|
|
129
|
+
let result = false;
|
|
130
|
+
for (let split = 0; split <= text.length && !result; split++)
|
|
131
|
+
result = matches(part.left, text.slice(0, split)) && matches(part.right, text.slice(split));
|
|
132
|
+
texts.set(text, result);
|
|
133
|
+
return result;
|
|
105
134
|
}
|
|
106
135
|
}
|
|
107
|
-
names.set(name, result);
|
|
108
|
-
return result;
|
|
109
136
|
};
|
|
110
|
-
return
|
|
137
|
+
return matches(domain, name);
|
|
111
138
|
};
|
|
112
139
|
const domainEdgeLiteral = (domain, side) => domain.kind === 'literal' ? domain.value : domain.kind === 'concat' ? domainEdgeLiteral(domain[side], side) : null;
|
|
113
140
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import { typeOnlyModuleUse } from '../module-resolution.js';
|
|
3
|
+
import { uncachedJsDocTags } from '../uncached-jsdoc-tags.js';
|
|
3
4
|
import { namespaceMembersUnderClosedKeyOf } from './flow/targets.js';
|
|
4
5
|
/**
|
|
5
6
|
* Every statement of every file: the answer when nothing may be pruned.
|
|
@@ -1141,7 +1142,7 @@ export const censusReachability = (input) => {
|
|
|
1141
1142
|
* comment.
|
|
1142
1143
|
*/
|
|
1143
1144
|
const markJsDocNamedClasses = (node) => {
|
|
1144
|
-
for (const tag of
|
|
1145
|
+
for (const tag of uncachedJsDocTags(node)) {
|
|
1145
1146
|
if (ts.isJSDocAugmentsTag(tag) || ts.isJSDocImplementsTag(tag)) {
|
|
1146
1147
|
markTypeNamedClasses(tag.class);
|
|
1147
1148
|
continue;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import { forEachReachableStatement } from './reachability.js';
|
|
3
3
|
export const emptyRecordStandInArmCensus = { armsOf: () => null, armsAt: () => null, recordsOf: () => null };
|
|
4
4
|
const isClassInstanceType = (type) => (type.flags & ts.TypeFlags.Object) !== 0 && ((type.getSymbol()?.flags ?? 0) & ts.SymbolFlags.Class) !== 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import { type ParameterBindingCensus } from './parameter-bindings.js';
|
|
3
3
|
import { type CollectionBindingCensus } from './collection-bindings.js';
|
|
4
4
|
import { type ObjectBagCensus } from './object-bag-bindings.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import { definitelyReturns } from './return-paths.js';
|
|
3
3
|
import { carriesUnsubstitutedGeneric, emptyParameterBindingCensus } from './parameter-bindings.js';
|
|
4
4
|
import { emptyCollectionBindingCensus } from './collection-bindings.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
export declare const definitelyReturns: (statements: readonly ts.Statement[]) => boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type ts from '#typescript';
|
|
2
|
+
type Table = Map<unknown, unknown>;
|
|
3
|
+
/**
|
|
4
|
+
* Shares a census's lookup tables with the round before it, wherever they
|
|
5
|
+
* state the same thing.
|
|
6
|
+
*
|
|
7
|
+
* The binding fixpoint keeps every round's census alive to the end of
|
|
8
|
+
* normalization (each round is the next one's `upstream`), and a round
|
|
9
|
+
* rebuilds tables that the census inputs barely move: on a 48K-line app every
|
|
10
|
+
* parameter census's call tables and the last two object-bag censuses' write
|
|
11
|
+
* tables were entry-for-entry those of the round before, three copies of each
|
|
12
|
+
* held through production. A table equal to the earlier round's, order
|
|
13
|
+
* included, is replaced by that table; otherwise each list equal to the
|
|
14
|
+
* earlier round's is. Only for tables no reader mutates once the census that
|
|
15
|
+
* built them has returned; keyed per checker, since each round runs over the
|
|
16
|
+
* same one.
|
|
17
|
+
*/
|
|
18
|
+
export declare const createRoundTableSharing: <T extends {
|
|
19
|
+
readonly [name: string]: Table;
|
|
20
|
+
}>() => ((checker: ts.TypeChecker, tables: T) => T);
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const sameValue = (a, b) => a === b || (Array.isArray(a) && Array.isArray(b) && a.length === b.length && a.every((entry, index) => entry === b[index]));
|
|
2
|
+
/** Every entry equal, in the same order: indistinguishable to any reader, iteration included. */
|
|
3
|
+
const sameTable = (a, b) => {
|
|
4
|
+
if (a.size !== b.size)
|
|
5
|
+
return false;
|
|
6
|
+
const theirs = b.entries();
|
|
7
|
+
for (const [key, value] of a) {
|
|
8
|
+
const next = theirs.next();
|
|
9
|
+
if (next.done || next.value[0] !== key || !sameValue(next.value[1], value))
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
return true;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Shares a census's lookup tables with the round before it, wherever they
|
|
16
|
+
* state the same thing.
|
|
17
|
+
*
|
|
18
|
+
* The binding fixpoint keeps every round's census alive to the end of
|
|
19
|
+
* normalization (each round is the next one's `upstream`), and a round
|
|
20
|
+
* rebuilds tables that the census inputs barely move: on a 48K-line app every
|
|
21
|
+
* parameter census's call tables and the last two object-bag censuses' write
|
|
22
|
+
* tables were entry-for-entry those of the round before, three copies of each
|
|
23
|
+
* held through production. A table equal to the earlier round's, order
|
|
24
|
+
* included, is replaced by that table; otherwise each list equal to the
|
|
25
|
+
* earlier round's is. Only for tables no reader mutates once the census that
|
|
26
|
+
* built them has returned; keyed per checker, since each round runs over the
|
|
27
|
+
* same one.
|
|
28
|
+
*/
|
|
29
|
+
export const createRoundTableSharing = () => {
|
|
30
|
+
const previous = new WeakMap();
|
|
31
|
+
return (checker, tables) => {
|
|
32
|
+
const earlier = previous.get(checker);
|
|
33
|
+
if (earlier === undefined) {
|
|
34
|
+
previous.set(checker, tables);
|
|
35
|
+
return tables;
|
|
36
|
+
}
|
|
37
|
+
const shared = {};
|
|
38
|
+
for (const [name, table] of Object.entries(tables)) {
|
|
39
|
+
const before = earlier[name];
|
|
40
|
+
if (before === undefined)
|
|
41
|
+
shared[name] = table;
|
|
42
|
+
else if (sameTable(table, before))
|
|
43
|
+
shared[name] = before;
|
|
44
|
+
else {
|
|
45
|
+
for (const [key, value] of table) {
|
|
46
|
+
if (!Array.isArray(value))
|
|
47
|
+
continue;
|
|
48
|
+
const list = before.get(key);
|
|
49
|
+
if (list !== value && sameValue(list, value))
|
|
50
|
+
table.set(key, list);
|
|
51
|
+
}
|
|
52
|
+
shared[name] = table;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const result = shared;
|
|
56
|
+
previous.set(checker, result);
|
|
57
|
+
return result;
|
|
58
|
+
};
|
|
59
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import ts from 'typescript';
|
|
1
|
+
import ts from '#typescript';
|
|
2
2
|
import type { StructuralTypeId } from '../../identity/ids.js';
|
|
3
3
|
import type { NativeIterableProvider } from '../../plugins/native-iterable-providers.js';
|
|
4
4
|
import type { ProducerContext } from './producer-context.js';
|
|
@@ -16,4 +16,4 @@ export interface SourceNativeIterable {
|
|
|
16
16
|
readonly elementType: StructuralTypeId;
|
|
17
17
|
readonly integrity: SourceNativeIterableIntegrity;
|
|
18
18
|
}
|
|
19
|
-
export declare const sourceNativeIterableOf: (context: ProducerContext, flow: ValueFlowIndex, providers: ReadonlyMap<string, NativeIterableProvider>, source: ts.Expression, consumer: ts.CallExpression | null) => SourceNativeIterable | null;
|
|
19
|
+
export declare const sourceNativeIterableOf: (context: Omit<ProducerContext, "ordinals" | "evaluationOrdinals">, flow: ValueFlowIndex, providers: ReadonlyMap<string, NativeIterableProvider>, source: ts.Expression, consumer: ts.CallExpression | null) => SourceNativeIterable | null;
|