@tsonic/frontend 0.0.73 → 0.0.75
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/.tsbuildinfo +1 -1
- package/dist/core-intrinsics/provenance.d.ts +7 -0
- package/dist/core-intrinsics/provenance.d.ts.map +1 -1
- package/dist/core-intrinsics/provenance.js +28 -8
- package/dist/core-intrinsics/provenance.js.map +1 -1
- package/dist/graph/extraction/imports.d.ts.map +1 -1
- package/dist/graph/extraction/imports.js +2 -0
- package/dist/graph/extraction/imports.js.map +1 -1
- package/dist/ir/binding/binding-call-resolution-calls.d.ts +11 -0
- package/dist/ir/binding/binding-call-resolution-calls.d.ts.map +1 -0
- package/dist/ir/binding/binding-call-resolution-calls.js +974 -0
- package/dist/ir/binding/binding-call-resolution-calls.js.map +1 -0
- package/dist/ir/binding/binding-call-resolution-candidates.d.ts +15 -0
- package/dist/ir/binding/binding-call-resolution-candidates.d.ts.map +1 -0
- package/dist/ir/binding/binding-call-resolution-candidates.js +178 -0
- package/dist/ir/binding/binding-call-resolution-candidates.js.map +1 -0
- package/dist/ir/binding/binding-call-resolution.d.ts +11 -0
- package/dist/ir/binding/binding-call-resolution.d.ts.map +1 -0
- package/dist/ir/binding/binding-call-resolution.js +11 -0
- package/dist/ir/binding/binding-call-resolution.js.map +1 -0
- package/dist/ir/binding/binding-factory.d.ts +7 -4
- package/dist/ir/binding/binding-factory.d.ts.map +1 -1
- package/dist/ir/binding/binding-factory.js +44 -829
- package/dist/ir/binding/binding-factory.js.map +1 -1
- package/dist/ir/binding/binding-helpers.d.ts +1 -0
- package/dist/ir/binding/binding-helpers.d.ts.map +1 -1
- package/dist/ir/binding/binding-helpers.js +37 -14
- package/dist/ir/binding/binding-helpers.js.map +1 -1
- package/dist/ir/binding/binding-registry.d.ts +52 -0
- package/dist/ir/binding/binding-registry.d.ts.map +1 -0
- package/dist/ir/binding/binding-registry.js +582 -0
- package/dist/ir/binding/binding-registry.js.map +1 -0
- package/dist/ir/binding/binding-types.d.ts +2 -0
- package/dist/ir/binding/binding-types.d.ts.map +1 -1
- package/dist/ir/binding-resolution-cases/extension-method-binding.test.d.ts +7 -0
- package/dist/ir/binding-resolution-cases/extension-method-binding.test.d.ts.map +1 -0
- package/dist/ir/binding-resolution-cases/extension-method-binding.test.js +463 -0
- package/dist/ir/binding-resolution-cases/extension-method-binding.test.js.map +1 -0
- package/dist/ir/binding-resolution-cases/extension-method-owner-resolution.test.d.ts +6 -0
- package/dist/ir/binding-resolution-cases/extension-method-owner-resolution.test.d.ts.map +1 -0
- package/dist/ir/binding-resolution-cases/extension-method-owner-resolution.test.js +252 -0
- package/dist/ir/binding-resolution-cases/extension-method-owner-resolution.test.js.map +1 -0
- package/dist/ir/binding-resolution-cases/extension-method-tsbindgen-modifiers.test.d.ts +6 -0
- package/dist/ir/binding-resolution-cases/extension-method-tsbindgen-modifiers.test.d.ts.map +1 -0
- package/dist/ir/binding-resolution-cases/extension-method-tsbindgen-modifiers.test.js +369 -0
- package/dist/ir/binding-resolution-cases/extension-method-tsbindgen-modifiers.test.js.map +1 -0
- package/dist/ir/binding-resolution-cases/extract-type-name.test.d.ts +5 -0
- package/dist/ir/binding-resolution-cases/extract-type-name.test.d.ts.map +1 -0
- package/dist/ir/binding-resolution-cases/extract-type-name.test.js +57 -0
- package/dist/ir/binding-resolution-cases/extract-type-name.test.js.map +1 -0
- package/dist/ir/binding-resolution-cases/global-binding-preferences.test.d.ts +5 -0
- package/dist/ir/binding-resolution-cases/global-binding-preferences.test.d.ts.map +1 -0
- package/dist/ir/binding-resolution-cases/global-binding-preferences.test.js +323 -0
- package/dist/ir/binding-resolution-cases/global-binding-preferences.test.js.map +1 -0
- package/dist/ir/binding-resolution-cases/global-identifier-resolution.test.d.ts +5 -0
- package/dist/ir/binding-resolution-cases/global-identifier-resolution.test.d.ts.map +1 -0
- package/dist/ir/binding-resolution-cases/global-identifier-resolution.test.js +1057 -0
- package/dist/ir/binding-resolution-cases/global-identifier-resolution.test.js.map +1 -0
- package/dist/ir/binding-resolution-cases/helpers.d.ts +38 -0
- package/dist/ir/binding-resolution-cases/helpers.d.ts.map +1 -0
- package/dist/ir/binding-resolution-cases/helpers.js +59 -0
- package/dist/ir/binding-resolution-cases/helpers.js.map +1 -0
- package/dist/ir/binding-resolution-cases/hierarchical-binding-resolution.test.d.ts +5 -0
- package/dist/ir/binding-resolution-cases/hierarchical-binding-resolution.test.d.ts.map +1 -0
- package/dist/ir/binding-resolution-cases/hierarchical-binding-resolution.test.js +259 -0
- package/dist/ir/binding-resolution-cases/hierarchical-binding-resolution.test.js.map +1 -0
- package/dist/ir/binding-resolution-cases/imported-globals-shadowing.test.d.ts +2 -0
- package/dist/ir/binding-resolution-cases/imported-globals-shadowing.test.d.ts.map +1 -0
- package/dist/ir/binding-resolution-cases/imported-globals-shadowing.test.js +566 -0
- package/dist/ir/binding-resolution-cases/imported-globals-shadowing.test.js.map +1 -0
- package/dist/ir/binding-resolution-cases/js-array-member-binding.test.d.ts +5 -0
- package/dist/ir/binding-resolution-cases/js-array-member-binding.test.d.ts.map +1 -0
- package/dist/ir/binding-resolution-cases/js-array-member-binding.test.js +186 -0
- package/dist/ir/binding-resolution-cases/js-array-member-binding.test.js.map +1 -0
- package/dist/ir/binding-resolution-cases/module-import-type-alias-renaming.test.d.ts +6 -0
- package/dist/ir/binding-resolution-cases/module-import-type-alias-renaming.test.d.ts.map +1 -0
- package/dist/ir/binding-resolution-cases/module-import-type-alias-renaming.test.js +198 -0
- package/dist/ir/binding-resolution-cases/module-import-type-alias-renaming.test.js.map +1 -0
- package/dist/ir/binding-resolution.test.d.ts +9 -4
- package/dist/ir/binding-resolution.test.d.ts.map +1 -1
- package/dist/ir/binding-resolution.test.js +9 -1428
- package/dist/ir/binding-resolution.test.js.map +1 -1
- package/dist/ir/bindings-disambiguation-cases/failure-disambiguation.test.d.ts +8 -0
- package/dist/ir/bindings-disambiguation-cases/failure-disambiguation.test.d.ts.map +1 -0
- package/dist/ir/bindings-disambiguation-cases/failure-disambiguation.test.js +255 -0
- package/dist/ir/bindings-disambiguation-cases/failure-disambiguation.test.js.map +1 -0
- package/dist/ir/bindings-disambiguation-cases/success-disambiguation.test.d.ts +11 -0
- package/dist/ir/bindings-disambiguation-cases/success-disambiguation.test.d.ts.map +1 -0
- package/dist/ir/bindings-disambiguation-cases/success-disambiguation.test.js +326 -0
- package/dist/ir/bindings-disambiguation-cases/success-disambiguation.test.js.map +1 -0
- package/dist/ir/bindings-disambiguation.test.d.ts +2 -10
- package/dist/ir/bindings-disambiguation.test.d.ts.map +1 -1
- package/dist/ir/bindings-disambiguation.test.js +2 -561
- package/dist/ir/bindings-disambiguation.test.js.map +1 -1
- package/dist/ir/builder/exports.d.ts +2 -2
- package/dist/ir/builder/exports.d.ts.map +1 -1
- package/dist/ir/builder/exports.js +6 -10
- package/dist/ir/builder/exports.js.map +1 -1
- package/dist/ir/builder/imports.d.ts.map +1 -1
- package/dist/ir/builder/imports.js +105 -62
- package/dist/ir/builder/imports.js.map +1 -1
- package/dist/ir/builder/orchestrator.d.ts.map +1 -1
- package/dist/ir/builder/orchestrator.js +7 -9
- package/dist/ir/builder/orchestrator.js.map +1 -1
- package/dist/ir/builder/statements.d.ts +5 -0
- package/dist/ir/builder/statements.d.ts.map +1 -1
- package/dist/ir/builder/statements.js +16 -5
- package/dist/ir/builder/statements.js.map +1 -1
- package/dist/ir/builder-cases/_test-helpers.d.ts +61 -0
- package/dist/ir/builder-cases/_test-helpers.d.ts.map +1 -0
- package/dist/ir/builder-cases/_test-helpers.js +123 -0
- package/dist/ir/builder-cases/_test-helpers.js.map +1 -0
- package/dist/ir/builder-cases/call-inference-generics/alias-cache.test.d.ts +2 -0
- package/dist/ir/builder-cases/call-inference-generics/alias-cache.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/call-inference-generics/alias-cache.test.js +123 -0
- package/dist/ir/builder-cases/call-inference-generics/alias-cache.test.js.map +1 -0
- package/dist/ir/builder-cases/call-inference-generics/context-threading.test.d.ts +2 -0
- package/dist/ir/builder-cases/call-inference-generics/context-threading.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/call-inference-generics/context-threading.test.js +839 -0
- package/dist/ir/builder-cases/call-inference-generics/context-threading.test.js.map +1 -0
- package/dist/ir/builder-cases/clr-identity.test.d.ts +5 -0
- package/dist/ir/builder-cases/clr-identity.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/clr-identity.test.js +188 -0
- package/dist/ir/builder-cases/clr-identity.test.js.map +1 -0
- package/dist/ir/builder-cases/clr-iterable-overload-resolution.test.d.ts +2 -0
- package/dist/ir/builder-cases/clr-iterable-overload-resolution.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/clr-iterable-overload-resolution.test.js +1436 -0
- package/dist/ir/builder-cases/clr-iterable-overload-resolution.test.js.map +1 -0
- package/dist/ir/builder-cases/conditional-narrowing.test.d.ts +5 -0
- package/dist/ir/builder-cases/conditional-narrowing.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/conditional-narrowing.test.js +598 -0
- package/dist/ir/builder-cases/conditional-narrowing.test.js.map +1 -0
- package/dist/ir/builder-cases/contextual-typing-middleware.test.d.ts +5 -0
- package/dist/ir/builder-cases/contextual-typing-middleware.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/contextual-typing-middleware.test.js +384 -0
- package/dist/ir/builder-cases/contextual-typing-middleware.test.js.map +1 -0
- package/dist/ir/builder-cases/expression-conversion.test.d.ts +5 -0
- package/dist/ir/builder-cases/expression-conversion.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/expression-conversion.test.js +712 -0
- package/dist/ir/builder-cases/expression-conversion.test.js.map +1 -0
- package/dist/ir/builder-cases/fluent-and-nullable-params.test.d.ts +5 -0
- package/dist/ir/builder-cases/fluent-and-nullable-params.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/fluent-and-nullable-params.test.js +170 -0
- package/dist/ir/builder-cases/fluent-and-nullable-params.test.js.map +1 -0
- package/dist/ir/builder-cases/for-of-loops.test.d.ts +5 -0
- package/dist/ir/builder-cases/for-of-loops.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/for-of-loops.test.js +367 -0
- package/dist/ir/builder-cases/for-of-loops.test.js.map +1 -0
- package/dist/ir/builder-cases/generic-call-parameter-specialization.test.d.ts +2 -0
- package/dist/ir/builder-cases/generic-call-parameter-specialization.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/generic-call-parameter-specialization.test.js +192 -0
- package/dist/ir/builder-cases/generic-call-parameter-specialization.test.js.map +1 -0
- package/dist/ir/builder-cases/implements-and-struct.test.d.ts +5 -0
- package/dist/ir/builder-cases/implements-and-struct.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/implements-and-struct.test.js +145 -0
- package/dist/ir/builder-cases/implements-and-struct.test.js.map +1 -0
- package/dist/ir/builder-cases/import-extraction.test.d.ts +5 -0
- package/dist/ir/builder-cases/import-extraction.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/import-extraction.test.js +852 -0
- package/dist/ir/builder-cases/import-extraction.test.js.map +1 -0
- package/dist/ir/builder-cases/imported-null-guard-assignments.test.d.ts +2 -0
- package/dist/ir/builder-cases/imported-null-guard-assignments.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/imported-null-guard-assignments.test.js +185 -0
- package/dist/ir/builder-cases/imported-null-guard-assignments.test.js.map +1 -0
- package/dist/ir/builder-cases/imported-union-aliases.test.d.ts +2 -0
- package/dist/ir/builder-cases/imported-union-aliases.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/imported-union-aliases.test.js +255 -0
- package/dist/ir/builder-cases/imported-union-aliases.test.js.map +1 -0
- package/dist/ir/builder-cases/installed-source-package-deterministic-typing.test.d.ts +2 -0
- package/dist/ir/builder-cases/installed-source-package-deterministic-typing.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/installed-source-package-deterministic-typing.test.js +1267 -0
- package/dist/ir/builder-cases/installed-source-package-deterministic-typing.test.js.map +1 -0
- package/dist/ir/builder-cases/invocation-flow-assertions.test.d.ts +2 -0
- package/dist/ir/builder-cases/invocation-flow-assertions.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/invocation-flow-assertions.test.js +198 -0
- package/dist/ir/builder-cases/invocation-flow-assertions.test.js.map +1 -0
- package/dist/ir/builder-cases/js-surface-helpers.test.d.ts +5 -0
- package/dist/ir/builder-cases/js-surface-helpers.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/js-surface-helpers.test.js +1990 -0
- package/dist/ir/builder-cases/js-surface-helpers.test.js.map +1 -0
- package/dist/ir/builder-cases/module-structure-and-exports.test.d.ts +5 -0
- package/dist/ir/builder-cases/module-structure-and-exports.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/module-structure-and-exports.test.js +97 -0
- package/dist/ir/builder-cases/module-structure-and-exports.test.js.map +1 -0
- package/dist/ir/builder-cases/namespace-imports-and-function-narrowing.test.d.ts +5 -0
- package/dist/ir/builder-cases/namespace-imports-and-function-narrowing.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/namespace-imports-and-function-narrowing.test.js +511 -0
- package/dist/ir/builder-cases/namespace-imports-and-function-narrowing.test.js.map +1 -0
- package/dist/ir/builder-cases/narrowing-isarray-and-typeof.test.d.ts +5 -0
- package/dist/ir/builder-cases/narrowing-isarray-and-typeof.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/narrowing-isarray-and-typeof.test.js +676 -0
- package/dist/ir/builder-cases/narrowing-isarray-and-typeof.test.js.map +1 -0
- package/dist/ir/builder-cases/object-exports-and-member-inference.test.d.ts +5 -0
- package/dist/ir/builder-cases/object-exports-and-member-inference.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/object-exports-and-member-inference.test.js +159 -0
- package/dist/ir/builder-cases/object-exports-and-member-inference.test.js.map +1 -0
- package/dist/ir/builder-cases/object-synthesis-advanced.test.d.ts +5 -0
- package/dist/ir/builder-cases/object-synthesis-advanced.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/object-synthesis-advanced.test.js +250 -0
- package/dist/ir/builder-cases/object-synthesis-advanced.test.js.map +1 -0
- package/dist/ir/builder-cases/object-synthesis.test.d.ts +5 -0
- package/dist/ir/builder-cases/object-synthesis.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/object-synthesis.test.js +254 -0
- package/dist/ir/builder-cases/object-synthesis.test.js.map +1 -0
- package/dist/ir/builder-cases/overload-family-markers.test.d.ts +2 -0
- package/dist/ir/builder-cases/overload-family-markers.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/overload-family-markers.test.js +264 -0
- package/dist/ir/builder-cases/overload-family-markers.test.js.map +1 -0
- package/dist/ir/builder-cases/overload-null-guard-selection.test.d.ts +2 -0
- package/dist/ir/builder-cases/overload-null-guard-selection.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/overload-null-guard-selection.test.js +210 -0
- package/dist/ir/builder-cases/overload-null-guard-selection.test.js.map +1 -0
- package/dist/ir/builder-cases/overload-stub-typing.test.d.ts +2 -0
- package/dist/ir/builder-cases/overload-stub-typing.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/overload-stub-typing.test.js +111 -0
- package/dist/ir/builder-cases/overload-stub-typing.test.js.map +1 -0
- package/dist/ir/builder-cases/private-members-and-instanceof.test.d.ts +5 -0
- package/dist/ir/builder-cases/private-members-and-instanceof.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/private-members-and-instanceof.test.js +239 -0
- package/dist/ir/builder-cases/private-members-and-instanceof.test.js.map +1 -0
- package/dist/ir/builder-cases/promise-callback-typing.test.d.ts +5 -0
- package/dist/ir/builder-cases/promise-callback-typing.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/promise-callback-typing.test.js +977 -0
- package/dist/ir/builder-cases/promise-callback-typing.test.js.map +1 -0
- package/dist/ir/builder-cases/recursive-aliases-and-flow-types.test.d.ts +5 -0
- package/dist/ir/builder-cases/recursive-aliases-and-flow-types.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/recursive-aliases-and-flow-types.test.js +509 -0
- package/dist/ir/builder-cases/recursive-aliases-and-flow-types.test.js.map +1 -0
- package/dist/ir/builder-cases/statement-conversion.test.d.ts +5 -0
- package/dist/ir/builder-cases/statement-conversion.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/statement-conversion.test.js +240 -0
- package/dist/ir/builder-cases/statement-conversion.test.js.map +1 -0
- package/dist/ir/builder-cases/type-access-and-records.test.d.ts +5 -0
- package/dist/ir/builder-cases/type-access-and-records.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/type-access-and-records.test.js +420 -0
- package/dist/ir/builder-cases/type-access-and-records.test.js.map +1 -0
- package/dist/ir/builder-cases/typeof-narrowing-and-intrinsics.test.d.ts +5 -0
- package/dist/ir/builder-cases/typeof-narrowing-and-intrinsics.test.d.ts.map +1 -0
- package/dist/ir/builder-cases/typeof-narrowing-and-intrinsics.test.js +187 -0
- package/dist/ir/builder-cases/typeof-narrowing-and-intrinsics.test.js.map +1 -0
- package/dist/ir/builder.test.d.ts +27 -4
- package/dist/ir/builder.test.d.ts.map +1 -1
- package/dist/ir/builder.test.js +27 -3579
- package/dist/ir/builder.test.js.map +1 -1
- package/dist/ir/converters/access-paths.d.ts +20 -0
- package/dist/ir/converters/access-paths.d.ts.map +1 -0
- package/dist/ir/converters/access-paths.js +163 -0
- package/dist/ir/converters/access-paths.js.map +1 -0
- package/dist/ir/converters/array-type-guards.d.ts +7 -0
- package/dist/ir/converters/array-type-guards.d.ts.map +1 -0
- package/dist/ir/converters/array-type-guards.js +33 -0
- package/dist/ir/converters/array-type-guards.js.map +1 -0
- package/dist/ir/converters/assertion-wrapping.d.ts +4 -0
- package/dist/ir/converters/assertion-wrapping.d.ts.map +1 -0
- package/dist/ir/converters/assertion-wrapping.js +40 -0
- package/dist/ir/converters/assertion-wrapping.js.map +1 -0
- package/dist/ir/converters/expressions/access/access-converter.d.ts.map +1 -1
- package/dist/ir/converters/expressions/access/access-converter.js +104 -41
- package/dist/ir/converters/expressions/access/access-converter.js.map +1 -1
- package/dist/ir/converters/expressions/access/binding-resolution-hierarchical.d.ts +18 -0
- package/dist/ir/converters/expressions/access/binding-resolution-hierarchical.d.ts.map +1 -0
- package/dist/ir/converters/expressions/access/binding-resolution-hierarchical.js +347 -0
- package/dist/ir/converters/expressions/access/binding-resolution-hierarchical.js.map +1 -0
- package/dist/ir/converters/expressions/access/binding-resolution-memberid.d.ts +28 -0
- package/dist/ir/converters/expressions/access/binding-resolution-memberid.d.ts.map +1 -0
- package/dist/ir/converters/expressions/access/binding-resolution-memberid.js +522 -0
- package/dist/ir/converters/expressions/access/binding-resolution-memberid.js.map +1 -0
- package/dist/ir/converters/expressions/access/binding-resolution.d.ts +7 -31
- package/dist/ir/converters/expressions/access/binding-resolution.d.ts.map +1 -1
- package/dist/ir/converters/expressions/access/binding-resolution.js +7 -490
- package/dist/ir/converters/expressions/access/binding-resolution.js.map +1 -1
- package/dist/ir/converters/expressions/access/member-resolution.d.ts +7 -6
- package/dist/ir/converters/expressions/access/member-resolution.d.ts.map +1 -1
- package/dist/ir/converters/expressions/access/member-resolution.js +323 -77
- package/dist/ir/converters/expressions/access/member-resolution.js.map +1 -1
- package/dist/ir/converters/expressions/ambient-global-source-owner.d.ts +5 -0
- package/dist/ir/converters/expressions/ambient-global-source-owner.d.ts.map +1 -0
- package/dist/ir/converters/expressions/ambient-global-source-owner.js +252 -0
- package/dist/ir/converters/expressions/ambient-global-source-owner.js.map +1 -0
- package/dist/ir/converters/expressions/array-literals.d.ts +25 -0
- package/dist/ir/converters/expressions/array-literals.d.ts.map +1 -0
- package/dist/ir/converters/expressions/array-literals.js +356 -0
- package/dist/ir/converters/expressions/array-literals.js.map +1 -0
- package/dist/ir/converters/expressions/calls/bound-global-call-parameters.d.ts +13 -0
- package/dist/ir/converters/expressions/calls/bound-global-call-parameters.d.ts.map +1 -0
- package/dist/ir/converters/expressions/calls/bound-global-call-parameters.js +56 -0
- package/dist/ir/converters/expressions/calls/bound-global-call-parameters.js.map +1 -0
- package/dist/ir/converters/expressions/calls/call-converter.d.ts +7 -17
- package/dist/ir/converters/expressions/calls/call-converter.d.ts.map +1 -1
- package/dist/ir/converters/expressions/calls/call-converter.js +7 -648
- package/dist/ir/converters/expressions/calls/call-converter.js.map +1 -1
- package/dist/ir/converters/expressions/calls/call-expression.d.ts +9 -0
- package/dist/ir/converters/expressions/calls/call-expression.d.ts.map +1 -0
- package/dist/ir/converters/expressions/calls/call-expression.js +9 -0
- package/dist/ir/converters/expressions/calls/call-expression.js.map +1 -0
- package/dist/ir/converters/expressions/calls/call-general.d.ts +25 -0
- package/dist/ir/converters/expressions/calls/call-general.d.ts.map +1 -0
- package/dist/ir/converters/expressions/calls/call-general.js +2237 -0
- package/dist/ir/converters/expressions/calls/call-general.js.map +1 -0
- package/dist/ir/converters/expressions/calls/call-intrinsics.d.ts +16 -0
- package/dist/ir/converters/expressions/calls/call-intrinsics.d.ts.map +1 -0
- package/dist/ir/converters/expressions/calls/call-intrinsics.js +308 -0
- package/dist/ir/converters/expressions/calls/call-intrinsics.js.map +1 -0
- package/dist/ir/converters/expressions/calls/call-resolution.d.ts +58 -0
- package/dist/ir/converters/expressions/calls/call-resolution.d.ts.map +1 -0
- package/dist/ir/converters/expressions/calls/call-resolution.js +293 -0
- package/dist/ir/converters/expressions/calls/call-resolution.js.map +1 -0
- package/dist/ir/converters/expressions/calls/call-site-analysis-argument-passing.d.ts +51 -0
- package/dist/ir/converters/expressions/calls/call-site-analysis-argument-passing.d.ts.map +1 -0
- package/dist/ir/converters/expressions/calls/call-site-analysis-argument-passing.js +313 -0
- package/dist/ir/converters/expressions/calls/call-site-analysis-argument-passing.js.map +1 -0
- package/dist/ir/converters/expressions/calls/call-site-analysis-unification.d.ts +13 -0
- package/dist/ir/converters/expressions/calls/call-site-analysis-unification.d.ts.map +1 -0
- package/dist/ir/converters/expressions/calls/call-site-analysis-unification.js +251 -0
- package/dist/ir/converters/expressions/calls/call-site-analysis-unification.js.map +1 -0
- package/dist/ir/converters/expressions/calls/call-site-analysis-unification.test.d.ts +2 -0
- package/dist/ir/converters/expressions/calls/call-site-analysis-unification.test.d.ts.map +1 -0
- package/dist/ir/converters/expressions/calls/call-site-analysis-unification.test.js +18 -0
- package/dist/ir/converters/expressions/calls/call-site-analysis-unification.test.js.map +1 -0
- package/dist/ir/converters/expressions/calls/call-site-analysis.d.ts +12 -51
- package/dist/ir/converters/expressions/calls/call-site-analysis.d.ts.map +1 -1
- package/dist/ir/converters/expressions/calls/call-site-analysis.js +9 -524
- package/dist/ir/converters/expressions/calls/call-site-analysis.js.map +1 -1
- package/dist/ir/converters/expressions/calls/invocation-finalization.d.ts +56 -0
- package/dist/ir/converters/expressions/calls/invocation-finalization.d.ts.map +1 -0
- package/dist/ir/converters/expressions/calls/invocation-finalization.js +723 -0
- package/dist/ir/converters/expressions/calls/invocation-finalization.js.map +1 -0
- package/dist/ir/converters/expressions/calls/new-converter.d.ts.map +1 -1
- package/dist/ir/converters/expressions/calls/new-converter.js +78 -3
- package/dist/ir/converters/expressions/calls/new-converter.js.map +1 -1
- package/dist/ir/converters/expressions/calls/source-backed-constructor-metadata.d.ts +22 -0
- package/dist/ir/converters/expressions/calls/source-backed-constructor-metadata.d.ts.map +1 -0
- package/dist/ir/converters/expressions/calls/source-backed-constructor-metadata.js +257 -0
- package/dist/ir/converters/expressions/calls/source-backed-constructor-metadata.js.map +1 -0
- package/dist/ir/converters/expressions/collections.d.ts +5 -25
- package/dist/ir/converters/expressions/collections.d.ts.map +1 -1
- package/dist/ir/converters/expressions/collections.js +5 -883
- package/dist/ir/converters/expressions/collections.js.map +1 -1
- package/dist/ir/converters/expressions/dynamic-import.d.ts.map +1 -1
- package/dist/ir/converters/expressions/dynamic-import.js.map +1 -1
- package/dist/ir/converters/expressions/functions.d.ts.map +1 -1
- package/dist/ir/converters/expressions/functions.js +80 -65
- package/dist/ir/converters/expressions/functions.js.map +1 -1
- package/dist/ir/converters/expressions/helpers.js +1 -1
- package/dist/ir/converters/expressions/helpers.js.map +1 -1
- package/dist/ir/converters/expressions/import-meta.d.ts +3 -3
- package/dist/ir/converters/expressions/import-meta.d.ts.map +1 -1
- package/dist/ir/converters/expressions/import-meta.js +22 -8
- package/dist/ir/converters/expressions/import-meta.js.map +1 -1
- package/dist/ir/converters/expressions/literals.d.ts.map +1 -1
- package/dist/ir/converters/expressions/literals.js +31 -6
- package/dist/ir/converters/expressions/literals.js.map +1 -1
- package/dist/ir/converters/expressions/numeric-recovery-cases/call-return-and-intent.test.d.ts +9 -0
- package/dist/ir/converters/expressions/numeric-recovery-cases/call-return-and-intent.test.d.ts.map +1 -0
- package/dist/ir/converters/expressions/numeric-recovery-cases/call-return-and-intent.test.js +124 -0
- package/dist/ir/converters/expressions/numeric-recovery-cases/call-return-and-intent.test.js.map +1 -0
- package/dist/ir/converters/expressions/numeric-recovery-cases/e2e-integration.test.d.ts +8 -0
- package/dist/ir/converters/expressions/numeric-recovery-cases/e2e-integration.test.d.ts.map +1 -0
- package/dist/ir/converters/expressions/numeric-recovery-cases/e2e-integration.test.js +117 -0
- package/dist/ir/converters/expressions/numeric-recovery-cases/e2e-integration.test.js.map +1 -0
- package/dist/ir/converters/expressions/numeric-recovery-cases/property-access-recovery.test.d.ts +8 -0
- package/dist/ir/converters/expressions/numeric-recovery-cases/property-access-recovery.test.d.ts.map +1 -0
- package/dist/ir/converters/expressions/numeric-recovery-cases/property-access-recovery.test.js +170 -0
- package/dist/ir/converters/expressions/numeric-recovery-cases/property-access-recovery.test.js.map +1 -0
- package/dist/ir/converters/expressions/numeric-recovery-cases/test-helpers.d.ts +31 -0
- package/dist/ir/converters/expressions/numeric-recovery-cases/test-helpers.d.ts.map +1 -0
- package/dist/ir/converters/expressions/numeric-recovery-cases/test-helpers.js +183 -0
- package/dist/ir/converters/expressions/numeric-recovery-cases/test-helpers.js.map +1 -0
- package/dist/ir/converters/expressions/numeric-recovery.test.d.ts +3 -16
- package/dist/ir/converters/expressions/numeric-recovery.test.d.ts.map +1 -1
- package/dist/ir/converters/expressions/numeric-recovery.test.js +3 -407
- package/dist/ir/converters/expressions/numeric-recovery.test.js.map +1 -1
- package/dist/ir/converters/expressions/object-literal-helpers.d.ts +12 -0
- package/dist/ir/converters/expressions/object-literal-helpers.d.ts.map +1 -0
- package/dist/ir/converters/expressions/object-literal-helpers.js +12 -0
- package/dist/ir/converters/expressions/object-literal-helpers.js.map +1 -0
- package/dist/ir/converters/expressions/object-literal-synthesis.d.ts +27 -0
- package/dist/ir/converters/expressions/object-literal-synthesis.d.ts.map +1 -0
- package/dist/ir/converters/expressions/object-literal-synthesis.js +459 -0
- package/dist/ir/converters/expressions/object-literal-synthesis.js.map +1 -0
- package/dist/ir/converters/expressions/object-literal-type-helpers.d.ts +27 -0
- package/dist/ir/converters/expressions/object-literal-type-helpers.d.ts.map +1 -0
- package/dist/ir/converters/expressions/object-literal-type-helpers.js +267 -0
- package/dist/ir/converters/expressions/object-literal-type-helpers.js.map +1 -0
- package/dist/ir/converters/expressions/object-literals.d.ts +16 -0
- package/dist/ir/converters/expressions/object-literals.d.ts.map +1 -0
- package/dist/ir/converters/expressions/object-literals.js +317 -0
- package/dist/ir/converters/expressions/object-literals.js.map +1 -0
- package/dist/ir/converters/expressions/operators.d.ts.map +1 -1
- package/dist/ir/converters/expressions/operators.js +33 -19
- package/dist/ir/converters/expressions/operators.js.map +1 -1
- package/dist/ir/converters/expressions/other.d.ts +4 -2
- package/dist/ir/converters/expressions/other.d.ts.map +1 -1
- package/dist/ir/converters/expressions/other.js +32 -10
- package/dist/ir/converters/expressions/other.js.map +1 -1
- package/dist/ir/converters/flow-narrowing.d.ts +6 -25
- package/dist/ir/converters/flow-narrowing.d.ts.map +1 -1
- package/dist/ir/converters/flow-narrowing.js +5 -416
- package/dist/ir/converters/flow-narrowing.js.map +1 -1
- package/dist/ir/converters/heritage-reference-type.d.ts +5 -0
- package/dist/ir/converters/heritage-reference-type.d.ts.map +1 -0
- package/dist/ir/converters/heritage-reference-type.js +22 -0
- package/dist/ir/converters/heritage-reference-type.js.map +1 -0
- package/dist/ir/converters/narrowing-candidates.d.ts +7 -0
- package/dist/ir/converters/narrowing-candidates.d.ts.map +1 -0
- package/dist/ir/converters/narrowing-candidates.js +5 -0
- package/dist/ir/converters/narrowing-candidates.js.map +1 -0
- package/dist/ir/converters/narrowing-collection.d.ts +10 -0
- package/dist/ir/converters/narrowing-collection.d.ts.map +1 -0
- package/dist/ir/converters/narrowing-collection.js +10 -0
- package/dist/ir/converters/narrowing-collection.js.map +1 -0
- package/dist/ir/converters/narrowing-environment.d.ts +13 -0
- package/dist/ir/converters/narrowing-environment.d.ts.map +1 -0
- package/dist/ir/converters/narrowing-environment.js +83 -0
- package/dist/ir/converters/narrowing-environment.js.map +1 -0
- package/dist/ir/converters/narrowing-property-helpers.d.ts +8 -0
- package/dist/ir/converters/narrowing-property-helpers.d.ts.map +1 -0
- package/dist/ir/converters/narrowing-property-helpers.js +57 -0
- package/dist/ir/converters/narrowing-property-helpers.js.map +1 -0
- package/dist/ir/converters/narrowing-resolvers-equality.d.ts +22 -0
- package/dist/ir/converters/narrowing-resolvers-equality.d.ts.map +1 -0
- package/dist/ir/converters/narrowing-resolvers-equality.js +309 -0
- package/dist/ir/converters/narrowing-resolvers-equality.js.map +1 -0
- package/dist/ir/converters/narrowing-resolvers-equality.test.d.ts +2 -0
- package/dist/ir/converters/narrowing-resolvers-equality.test.d.ts.map +1 -0
- package/dist/ir/converters/narrowing-resolvers-equality.test.js +159 -0
- package/dist/ir/converters/narrowing-resolvers-equality.test.js.map +1 -0
- package/dist/ir/converters/narrowing-resolvers-typeof.d.ts +41 -0
- package/dist/ir/converters/narrowing-resolvers-typeof.d.ts.map +1 -0
- package/dist/ir/converters/narrowing-resolvers-typeof.js +251 -0
- package/dist/ir/converters/narrowing-resolvers-typeof.js.map +1 -0
- package/dist/ir/converters/narrowing-resolvers.d.ts +12 -0
- package/dist/ir/converters/narrowing-resolvers.d.ts.map +1 -0
- package/dist/ir/converters/narrowing-resolvers.js +10 -0
- package/dist/ir/converters/narrowing-resolvers.js.map +1 -0
- package/dist/ir/converters/narrowing-truthy.d.ts +19 -0
- package/dist/ir/converters/narrowing-truthy.d.ts.map +1 -0
- package/dist/ir/converters/narrowing-truthy.js +355 -0
- package/dist/ir/converters/narrowing-truthy.js.map +1 -0
- package/dist/ir/converters/reference-type-guards.d.ts +8 -0
- package/dist/ir/converters/reference-type-guards.d.ts.map +1 -0
- package/dist/ir/converters/reference-type-guards.js +51 -0
- package/dist/ir/converters/reference-type-guards.js.map +1 -0
- package/dist/ir/converters/reference-type-guards.test.d.ts +2 -0
- package/dist/ir/converters/reference-type-guards.test.d.ts.map +1 -0
- package/dist/ir/converters/reference-type-guards.test.js +51 -0
- package/dist/ir/converters/reference-type-guards.test.js.map +1 -0
- package/dist/ir/converters/return-expression-types.d.ts +3 -0
- package/dist/ir/converters/return-expression-types.d.ts.map +1 -0
- package/dist/ir/converters/return-expression-types.js +10 -0
- package/dist/ir/converters/return-expression-types.js.map +1 -0
- package/dist/ir/converters/statements/control/blocks.d.ts.map +1 -1
- package/dist/ir/converters/statements/control/blocks.js +75 -3
- package/dist/ir/converters/statements/control/blocks.js.map +1 -1
- package/dist/ir/converters/statements/control/conditionals.d.ts.map +1 -1
- package/dist/ir/converters/statements/control/conditionals.js +2 -12
- package/dist/ir/converters/statements/control/conditionals.js.map +1 -1
- package/dist/ir/converters/statements/control/loops.d.ts.map +1 -1
- package/dist/ir/converters/statements/control/loops.js +18 -4
- package/dist/ir/converters/statements/control/loops.js.map +1 -1
- package/dist/ir/converters/statements/declarations/classes/constructors.d.ts.map +1 -1
- package/dist/ir/converters/statements/declarations/classes/constructors.js +36 -19
- package/dist/ir/converters/statements/declarations/classes/constructors.js.map +1 -1
- package/dist/ir/converters/statements/declarations/classes/member-names.d.ts +5 -0
- package/dist/ir/converters/statements/declarations/classes/member-names.d.ts.map +1 -0
- package/dist/ir/converters/statements/declarations/classes/member-names.js +6 -0
- package/dist/ir/converters/statements/declarations/classes/member-names.js.map +1 -0
- package/dist/ir/converters/statements/declarations/classes/method-declaration.d.ts +11 -0
- package/dist/ir/converters/statements/declarations/classes/method-declaration.d.ts.map +1 -0
- package/dist/ir/converters/statements/declarations/classes/method-declaration.js +54 -0
- package/dist/ir/converters/statements/declarations/classes/method-declaration.js.map +1 -0
- package/dist/ir/converters/statements/declarations/classes/methods.d.ts +2 -15
- package/dist/ir/converters/statements/declarations/classes/methods.d.ts.map +1 -1
- package/dist/ir/converters/statements/declarations/classes/methods.js +2 -810
- package/dist/ir/converters/statements/declarations/classes/methods.js.map +1 -1
- package/dist/ir/converters/statements/declarations/classes/orchestrator.d.ts.map +1 -1
- package/dist/ir/converters/statements/declarations/classes/orchestrator.js +15 -41
- package/dist/ir/converters/statements/declarations/classes/orchestrator.js.map +1 -1
- package/dist/ir/converters/statements/declarations/classes/override-detection.d.ts +4 -1
- package/dist/ir/converters/statements/declarations/classes/override-detection.d.ts.map +1 -1
- package/dist/ir/converters/statements/declarations/classes/override-detection.js +18 -10
- package/dist/ir/converters/statements/declarations/classes/override-detection.js.map +1 -1
- package/dist/ir/converters/statements/declarations/classes/properties.d.ts.map +1 -1
- package/dist/ir/converters/statements/declarations/classes/properties.js +10 -3
- package/dist/ir/converters/statements/declarations/classes/properties.js.map +1 -1
- package/dist/ir/converters/statements/declarations/functions.d.ts.map +1 -1
- package/dist/ir/converters/statements/declarations/functions.js +8 -2
- package/dist/ir/converters/statements/declarations/functions.js.map +1 -1
- package/dist/ir/converters/statements/declarations/interfaces.d.ts.map +1 -1
- package/dist/ir/converters/statements/declarations/interfaces.js +67 -2
- package/dist/ir/converters/statements/declarations/interfaces.js.map +1 -1
- package/dist/ir/converters/statements/declarations/overload-family-builders.d.ts +9 -0
- package/dist/ir/converters/statements/declarations/overload-family-builders.d.ts.map +1 -0
- package/dist/ir/converters/statements/declarations/overload-family-builders.js +21 -0
- package/dist/ir/converters/statements/declarations/overload-family-builders.js.map +1 -0
- package/dist/ir/converters/statements/declarations/type-aliases.d.ts.map +1 -1
- package/dist/ir/converters/statements/declarations/type-aliases.js +12 -1
- package/dist/ir/converters/statements/declarations/type-aliases.js.map +1 -1
- package/dist/ir/converters/statements/declarations/variable-generic-lowering.d.ts +50 -0
- package/dist/ir/converters/statements/declarations/variable-generic-lowering.d.ts.map +1 -0
- package/dist/ir/converters/statements/declarations/variable-generic-lowering.js +281 -0
- package/dist/ir/converters/statements/declarations/variable-generic-lowering.js.map +1 -0
- package/dist/ir/converters/statements/declarations/variable-helpers.d.ts +29 -0
- package/dist/ir/converters/statements/declarations/variable-helpers.d.ts.map +1 -0
- package/dist/ir/converters/statements/declarations/variable-helpers.js +58 -0
- package/dist/ir/converters/statements/declarations/variable-helpers.js.map +1 -0
- package/dist/ir/converters/statements/declarations/variables-generic-function-values.d.ts +21 -0
- package/dist/ir/converters/statements/declarations/variables-generic-function-values.d.ts.map +1 -0
- package/dist/ir/converters/statements/declarations/variables-generic-function-values.js +263 -0
- package/dist/ir/converters/statements/declarations/variables-generic-function-values.js.map +1 -0
- package/dist/ir/converters/statements/declarations/variables.d.ts.map +1 -1
- package/dist/ir/converters/statements/declarations/variables.js +3 -262
- package/dist/ir/converters/statements/declarations/variables.js.map +1 -1
- package/dist/ir/converters/synthetic-types.d.ts.map +1 -1
- package/dist/ir/converters/synthetic-types.js +83 -4
- package/dist/ir/converters/synthetic-types.js.map +1 -1
- package/dist/ir/converters/type-env.d.ts +3 -1
- package/dist/ir/converters/type-env.d.ts.map +1 -1
- package/dist/ir/converters/type-env.js +52 -19
- package/dist/ir/converters/type-env.js.map +1 -1
- package/dist/ir/expression-converter-dispatch.d.ts +21 -0
- package/dist/ir/expression-converter-dispatch.d.ts.map +1 -0
- package/dist/ir/expression-converter-dispatch.js +550 -0
- package/dist/ir/expression-converter-dispatch.js.map +1 -0
- package/dist/ir/expression-converter-helpers.d.ts +27 -0
- package/dist/ir/expression-converter-helpers.d.ts.map +1 -0
- package/dist/ir/expression-converter-helpers.js +172 -0
- package/dist/ir/expression-converter-helpers.js.map +1 -0
- package/dist/ir/expression-converter.d.ts +5 -15
- package/dist/ir/expression-converter.d.ts.map +1 -1
- package/dist/ir/expression-converter.js +5 -410
- package/dist/ir/expression-converter.js.map +1 -1
- package/dist/ir/field-marker.test.js +1 -1
- package/dist/ir/field-marker.test.js.map +1 -1
- package/dist/ir/json-global-typing.test.d.ts +2 -0
- package/dist/ir/json-global-typing.test.d.ts.map +1 -0
- package/dist/ir/json-global-typing.test.js +80 -0
- package/dist/ir/json-global-typing.test.js.map +1 -0
- package/dist/ir/program-context-factory.d.ts +25 -0
- package/dist/ir/program-context-factory.d.ts.map +1 -0
- package/dist/ir/program-context-factory.js +196 -0
- package/dist/ir/program-context-factory.js.map +1 -0
- package/dist/ir/program-context-types.d.ts +147 -0
- package/dist/ir/program-context-types.d.ts.map +1 -0
- package/dist/ir/program-context-types.js +123 -0
- package/dist/ir/program-context-types.js.map +1 -0
- package/dist/ir/program-context.d.ts +6 -122
- package/dist/ir/program-context.d.ts.map +1 -1
- package/dist/ir/program-context.js +5 -347
- package/dist/ir/program-context.js.map +1 -1
- package/dist/ir/program-context.test.js +20 -0
- package/dist/ir/program-context.test.js.map +1 -1
- package/dist/ir/syntax/overload-stubs.d.ts +4 -0
- package/dist/ir/syntax/overload-stubs.d.ts.map +1 -0
- package/dist/ir/syntax/overload-stubs.js +32 -0
- package/dist/ir/syntax/overload-stubs.js.map +1 -0
- package/dist/ir/syntax/property-names.d.ts +6 -0
- package/dist/ir/syntax/property-names.d.ts.map +1 -0
- package/dist/ir/syntax/property-names.js +116 -0
- package/dist/ir/syntax/property-names.js.map +1 -0
- package/dist/ir/type-system/call-resolution-callable-types.d.ts +10 -0
- package/dist/ir/type-system/call-resolution-callable-types.d.ts.map +1 -0
- package/dist/ir/type-system/call-resolution-callable-types.js +288 -0
- package/dist/ir/type-system/call-resolution-callable-types.js.map +1 -0
- package/dist/ir/type-system/call-resolution-candidate-selection.d.ts +9 -0
- package/dist/ir/type-system/call-resolution-candidate-selection.d.ts.map +1 -0
- package/dist/ir/type-system/call-resolution-candidate-selection.js +413 -0
- package/dist/ir/type-system/call-resolution-candidate-selection.js.map +1 -0
- package/dist/ir/type-system/call-resolution-inference.d.ts +12 -0
- package/dist/ir/type-system/call-resolution-inference.d.ts.map +1 -0
- package/dist/ir/type-system/call-resolution-inference.js +12 -0
- package/dist/ir/type-system/call-resolution-inference.js.map +1 -0
- package/dist/ir/type-system/call-resolution-method-substitution.d.ts +12 -0
- package/dist/ir/type-system/call-resolution-method-substitution.d.ts.map +1 -0
- package/dist/ir/type-system/call-resolution-method-substitution.js +115 -0
- package/dist/ir/type-system/call-resolution-method-substitution.js.map +1 -0
- package/dist/ir/type-system/call-resolution-parameters.d.ts +30 -0
- package/dist/ir/type-system/call-resolution-parameters.d.ts.map +1 -0
- package/dist/ir/type-system/call-resolution-parameters.js +167 -0
- package/dist/ir/type-system/call-resolution-parameters.js.map +1 -0
- package/dist/ir/type-system/call-resolution-receiver-substitution.d.ts +12 -0
- package/dist/ir/type-system/call-resolution-receiver-substitution.d.ts.map +1 -0
- package/dist/ir/type-system/call-resolution-receiver-substitution.js +134 -0
- package/dist/ir/type-system/call-resolution-receiver-substitution.js.map +1 -0
- package/dist/ir/type-system/call-resolution-resolve.d.ts +12 -0
- package/dist/ir/type-system/call-resolution-resolve.d.ts.map +1 -0
- package/dist/ir/type-system/call-resolution-resolve.js +275 -0
- package/dist/ir/type-system/call-resolution-resolve.js.map +1 -0
- package/dist/ir/type-system/call-resolution-scoring.d.ts +18 -0
- package/dist/ir/type-system/call-resolution-scoring.d.ts.map +1 -0
- package/dist/ir/type-system/call-resolution-scoring.js +166 -0
- package/dist/ir/type-system/call-resolution-scoring.js.map +1 -0
- package/dist/ir/type-system/call-resolution-signatures-catalog.d.ts +19 -0
- package/dist/ir/type-system/call-resolution-signatures-catalog.d.ts.map +1 -0
- package/dist/ir/type-system/call-resolution-signatures-catalog.js +121 -0
- package/dist/ir/type-system/call-resolution-signatures-catalog.js.map +1 -0
- package/dist/ir/type-system/call-resolution-signatures-catalog.test.d.ts +2 -0
- package/dist/ir/type-system/call-resolution-signatures-catalog.test.d.ts.map +1 -0
- package/dist/ir/type-system/call-resolution-signatures-catalog.test.js +88 -0
- package/dist/ir/type-system/call-resolution-signatures-catalog.test.js.map +1 -0
- package/dist/ir/type-system/call-resolution-signatures-raw.d.ts +21 -0
- package/dist/ir/type-system/call-resolution-signatures-raw.d.ts.map +1 -0
- package/dist/ir/type-system/call-resolution-signatures-raw.js +242 -0
- package/dist/ir/type-system/call-resolution-signatures-raw.js.map +1 -0
- package/dist/ir/type-system/call-resolution-signatures.d.ts +10 -0
- package/dist/ir/type-system/call-resolution-signatures.d.ts.map +1 -0
- package/dist/ir/type-system/call-resolution-signatures.js +10 -0
- package/dist/ir/type-system/call-resolution-signatures.js.map +1 -0
- package/dist/ir/type-system/call-resolution-type-ids.d.ts +43 -0
- package/dist/ir/type-system/call-resolution-type-ids.d.ts.map +1 -0
- package/dist/ir/type-system/call-resolution-type-ids.js +465 -0
- package/dist/ir/type-system/call-resolution-type-ids.js.map +1 -0
- package/dist/ir/type-system/call-resolution-type-ids.test.d.ts +2 -0
- package/dist/ir/type-system/call-resolution-type-ids.test.d.ts.map +1 -0
- package/dist/ir/type-system/call-resolution-type-ids.test.js +63 -0
- package/dist/ir/type-system/call-resolution-type-ids.test.js.map +1 -0
- package/dist/ir/type-system/call-resolution-unification.d.ts +18 -0
- package/dist/ir/type-system/call-resolution-unification.d.ts.map +1 -0
- package/dist/ir/type-system/call-resolution-unification.js +637 -0
- package/dist/ir/type-system/call-resolution-unification.js.map +1 -0
- package/dist/ir/type-system/call-resolution-utilities.d.ts +11 -0
- package/dist/ir/type-system/call-resolution-utilities.d.ts.map +1 -0
- package/dist/ir/type-system/call-resolution-utilities.js +11 -0
- package/dist/ir/type-system/call-resolution-utilities.js.map +1 -0
- package/dist/ir/type-system/inference-declarations-overrides.d.ts +33 -0
- package/dist/ir/type-system/inference-declarations-overrides.d.ts.map +1 -0
- package/dist/ir/type-system/inference-declarations-overrides.js +241 -0
- package/dist/ir/type-system/inference-declarations-overrides.js.map +1 -0
- package/dist/ir/type-system/inference-declarations-types.d.ts +20 -0
- package/dist/ir/type-system/inference-declarations-types.d.ts.map +1 -0
- package/dist/ir/type-system/inference-declarations-types.js +475 -0
- package/dist/ir/type-system/inference-declarations-types.js.map +1 -0
- package/dist/ir/type-system/inference-declarations.d.ts +10 -0
- package/dist/ir/type-system/inference-declarations.d.ts.map +1 -0
- package/dist/ir/type-system/inference-declarations.js +10 -0
- package/dist/ir/type-system/inference-declarations.js.map +1 -0
- package/dist/ir/type-system/inference-expressions-infer.d.ts +25 -0
- package/dist/ir/type-system/inference-expressions-infer.d.ts.map +1 -0
- package/dist/ir/type-system/inference-expressions-infer.js +427 -0
- package/dist/ir/type-system/inference-expressions-infer.js.map +1 -0
- package/dist/ir/type-system/inference-expressions-lambda.d.ts +13 -0
- package/dist/ir/type-system/inference-expressions-lambda.d.ts.map +1 -0
- package/dist/ir/type-system/inference-expressions-lambda.js +101 -0
- package/dist/ir/type-system/inference-expressions-lambda.js.map +1 -0
- package/dist/ir/type-system/inference-expressions.d.ts +10 -0
- package/dist/ir/type-system/inference-expressions.d.ts.map +1 -0
- package/dist/ir/type-system/inference-expressions.js +10 -0
- package/dist/ir/type-system/inference-expressions.js.map +1 -0
- package/dist/ir/type-system/inference-initializers-call.d.ts +37 -0
- package/dist/ir/type-system/inference-initializers-call.d.ts.map +1 -0
- package/dist/ir/type-system/inference-initializers-call.js +242 -0
- package/dist/ir/type-system/inference-initializers-call.js.map +1 -0
- package/dist/ir/type-system/inference-initializers-variable.d.ts +14 -0
- package/dist/ir/type-system/inference-initializers-variable.d.ts.map +1 -0
- package/dist/ir/type-system/inference-initializers-variable.js +178 -0
- package/dist/ir/type-system/inference-initializers-variable.js.map +1 -0
- package/dist/ir/type-system/inference-initializers.d.ts +10 -0
- package/dist/ir/type-system/inference-initializers.d.ts.map +1 -0
- package/dist/ir/type-system/inference-initializers.js +10 -0
- package/dist/ir/type-system/inference-initializers.js.map +1 -0
- package/dist/ir/type-system/inference-member-id.d.ts +21 -0
- package/dist/ir/type-system/inference-member-id.d.ts.map +1 -0
- package/dist/ir/type-system/inference-member-id.js +402 -0
- package/dist/ir/type-system/inference-member-id.js.map +1 -0
- package/dist/ir/type-system/inference-member-lookup.d.ts +15 -0
- package/dist/ir/type-system/inference-member-lookup.d.ts.map +1 -0
- package/dist/ir/type-system/inference-member-lookup.js +567 -0
- package/dist/ir/type-system/inference-member-lookup.js.map +1 -0
- package/dist/ir/type-system/inference-member-resolution.d.ts +10 -0
- package/dist/ir/type-system/inference-member-resolution.d.ts.map +1 -0
- package/dist/ir/type-system/inference-member-resolution.js +10 -0
- package/dist/ir/type-system/inference-member-resolution.js.map +1 -0
- package/dist/ir/type-system/inference-type-preference.d.ts +9 -0
- package/dist/ir/type-system/inference-type-preference.d.ts.map +1 -0
- package/dist/ir/type-system/inference-type-preference.js +67 -0
- package/dist/ir/type-system/inference-type-preference.js.map +1 -0
- package/dist/ir/type-system/inference-utilities.d.ts +48 -0
- package/dist/ir/type-system/inference-utilities.d.ts.map +1 -0
- package/dist/ir/type-system/inference-utilities.js +182 -0
- package/dist/ir/type-system/inference-utilities.js.map +1 -0
- package/dist/ir/type-system/internal/handle-types.d.ts +12 -0
- package/dist/ir/type-system/internal/handle-types.d.ts.map +1 -1
- package/dist/ir/type-system/internal/nominal-env.d.ts +1 -1
- package/dist/ir/type-system/internal/nominal-env.d.ts.map +1 -1
- package/dist/ir/type-system/internal/nominal-env.js +12 -114
- package/dist/ir/type-system/internal/nominal-env.js.map +1 -1
- package/dist/ir/type-system/internal/registry-builder.d.ts +19 -0
- package/dist/ir/type-system/internal/registry-builder.d.ts.map +1 -0
- package/dist/ir/type-system/internal/registry-builder.js +292 -0
- package/dist/ir/type-system/internal/registry-builder.js.map +1 -0
- package/dist/ir/type-system/internal/registry-helpers-extraction.d.ts +69 -0
- package/dist/ir/type-system/internal/registry-helpers-extraction.d.ts.map +1 -0
- package/dist/ir/type-system/internal/registry-helpers-extraction.js +429 -0
- package/dist/ir/type-system/internal/registry-helpers-extraction.js.map +1 -0
- package/dist/ir/type-system/internal/registry-helpers-inference.d.ts +19 -0
- package/dist/ir/type-system/internal/registry-helpers-inference.d.ts.map +1 -0
- package/dist/ir/type-system/internal/registry-helpers-inference.js +237 -0
- package/dist/ir/type-system/internal/registry-helpers-inference.js.map +1 -0
- package/dist/ir/type-system/internal/registry-helpers.d.ts +12 -0
- package/dist/ir/type-system/internal/registry-helpers.d.ts.map +1 -0
- package/dist/ir/type-system/internal/registry-helpers.js +12 -0
- package/dist/ir/type-system/internal/registry-helpers.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/conditional-utility-types-core.d.ts +53 -0
- package/dist/ir/type-system/internal/type-converter/conditional-utility-types-core.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/conditional-utility-types-core.js +281 -0
- package/dist/ir/type-system/internal/type-converter/conditional-utility-types-core.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/conditional-utility-types-extract.d.ts +35 -0
- package/dist/ir/type-system/internal/type-converter/conditional-utility-types-extract.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/conditional-utility-types-extract.js +308 -0
- package/dist/ir/type-system/internal/type-converter/conditional-utility-types-extract.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/conditional-utility-types.d.ts +23 -0
- package/dist/ir/type-system/internal/type-converter/conditional-utility-types.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/conditional-utility-types.js +23 -0
- package/dist/ir/type-system/internal/type-converter/conditional-utility-types.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/direct-alias-expansion.d.ts +5 -0
- package/dist/ir/type-system/internal/type-converter/direct-alias-expansion.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/direct-alias-expansion.js +232 -0
- package/dist/ir/type-system/internal/type-converter/direct-alias-expansion.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/functions.d.ts.map +1 -1
- package/dist/ir/type-system/internal/type-converter/functions.js +21 -0
- package/dist/ir/type-system/internal/type-converter/functions.js.map +1 -1
- package/dist/ir/type-system/internal/type-converter/mapped-utility-expansion.d.ts +37 -0
- package/dist/ir/type-system/internal/type-converter/mapped-utility-expansion.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/mapped-utility-expansion.js +334 -0
- package/dist/ir/type-system/internal/type-converter/mapped-utility-expansion.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/mapped-utility-record.d.ts +27 -0
- package/dist/ir/type-system/internal/type-converter/mapped-utility-record.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/mapped-utility-record.js +174 -0
- package/dist/ir/type-system/internal/type-converter/mapped-utility-record.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/mapped-utility-types.d.ts +10 -0
- package/dist/ir/type-system/internal/type-converter/mapped-utility-types.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/mapped-utility-types.js +10 -0
- package/dist/ir/type-system/internal/type-converter/mapped-utility-types.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/objects.d.ts.map +1 -1
- package/dist/ir/type-system/internal/type-converter/objects.js +11 -6
- package/dist/ir/type-system/internal/type-converter/objects.js.map +1 -1
- package/dist/ir/type-system/internal/type-converter/orchestrator.d.ts +6 -5
- package/dist/ir/type-system/internal/type-converter/orchestrator.d.ts.map +1 -1
- package/dist/ir/type-system/internal/type-converter/orchestrator.js +80 -457
- package/dist/ir/type-system/internal/type-converter/orchestrator.js.map +1 -1
- package/dist/ir/type-system/internal/type-converter/orchestrator.test.js +49 -59
- package/dist/ir/type-system/internal/type-converter/orchestrator.test.js.map +1 -1
- package/dist/ir/type-system/internal/type-converter/primitives.d.ts.map +1 -1
- package/dist/ir/type-system/internal/type-converter/primitives.js +9 -1
- package/dist/ir/type-system/internal/type-converter/primitives.js.map +1 -1
- package/dist/ir/type-system/internal/type-converter/references-alias.d.ts +21 -0
- package/dist/ir/type-system/internal/type-converter/references-alias.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/references-alias.js +267 -0
- package/dist/ir/type-system/internal/type-converter/references-alias.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/references-converter.d.ts +16 -0
- package/dist/ir/type-system/internal/type-converter/references-converter.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/references-converter.js +203 -0
- package/dist/ir/type-system/internal/type-converter/references-converter.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/references-normalize.d.ts +49 -0
- package/dist/ir/type-system/internal/type-converter/references-normalize.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/references-normalize.js +162 -0
- package/dist/ir/type-system/internal/type-converter/references-normalize.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/references-structural-bindings.d.ts +52 -0
- package/dist/ir/type-system/internal/type-converter/references-structural-bindings.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/references-structural-bindings.js +295 -0
- package/dist/ir/type-system/internal/type-converter/references-structural-bindings.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/references-structural-members.d.ts +55 -0
- package/dist/ir/type-system/internal/type-converter/references-structural-members.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/references-structural-members.js +334 -0
- package/dist/ir/type-system/internal/type-converter/references-structural-members.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/references-structural.d.ts +12 -0
- package/dist/ir/type-system/internal/type-converter/references-structural.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/references-structural.js +12 -0
- package/dist/ir/type-system/internal/type-converter/references-structural.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/references.d.ts +8 -9
- package/dist/ir/type-system/internal/type-converter/references.d.ts.map +1 -1
- package/dist/ir/type-system/internal/type-converter/references.js +7 -980
- package/dist/ir/type-system/internal/type-converter/references.js.map +1 -1
- package/dist/ir/type-system/internal/type-converter/type-operators.d.ts +16 -0
- package/dist/ir/type-system/internal/type-converter/type-operators.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/type-operators.js +197 -0
- package/dist/ir/type-system/internal/type-converter/type-operators.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/unions-intersections.d.ts.map +1 -1
- package/dist/ir/type-system/internal/type-converter/unions-intersections.js +2 -4
- package/dist/ir/type-system/internal/type-converter/unions-intersections.js.map +1 -1
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/comprehensive-expansion.test.d.ts +2 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/comprehensive-expansion.test.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/comprehensive-expansion.test.js +246 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/comprehensive-expansion.test.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/conditional-awaited-constructor-instance.test.d.ts +2 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/conditional-awaited-constructor-instance.test.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/conditional-awaited-constructor-instance.test.js +179 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/conditional-awaited-constructor-instance.test.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/conditional-nonnullable-exclude-extract.test.d.ts +2 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/conditional-nonnullable-exclude-extract.test.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/conditional-nonnullable-exclude-extract.test.js +277 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/conditional-nonnullable-exclude-extract.test.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/conditional-return-params.test.d.ts +2 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/conditional-return-params.test.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/conditional-return-params.test.js +163 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/conditional-return-params.test.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/expansion-safety.test.d.ts +2 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/expansion-safety.test.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/expansion-safety.test.js +305 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/expansion-safety.test.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/helpers.d.ts +38 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/helpers.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/helpers.js +127 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/helpers.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/record-expansion.test.d.ts +2 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/record-expansion.test.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/record-expansion.test.js +145 -0
- package/dist/ir/type-system/internal/type-converter/utility-types-cases/record-expansion.test.js.map +1 -0
- package/dist/ir/type-system/internal/type-converter/utility-types.d.ts +6 -76
- package/dist/ir/type-system/internal/type-converter/utility-types.d.ts.map +1 -1
- package/dist/ir/type-system/internal/type-converter/utility-types.js +6 -1031
- package/dist/ir/type-system/internal/type-converter/utility-types.js.map +1 -1
- package/dist/ir/type-system/internal/type-converter/utility-types.test.d.ts +6 -9
- package/dist/ir/type-system/internal/type-converter/utility-types.test.d.ts.map +1 -1
- package/dist/ir/type-system/internal/type-converter/utility-types.test.js +6 -1416
- package/dist/ir/type-system/internal/type-converter/utility-types.test.js.map +1 -1
- package/dist/ir/type-system/internal/type-converter/value-inference.d.ts +13 -0
- package/dist/ir/type-system/internal/type-converter/value-inference.d.ts.map +1 -0
- package/dist/ir/type-system/internal/type-converter/value-inference.js +311 -0
- package/dist/ir/type-system/internal/type-converter/value-inference.js.map +1 -0
- package/dist/ir/type-system/internal/type-registry.d.ts +12 -12
- package/dist/ir/type-system/internal/type-registry.d.ts.map +1 -1
- package/dist/ir/type-system/internal/type-registry.js +4 -529
- package/dist/ir/type-system/internal/type-registry.js.map +1 -1
- package/dist/ir/type-system/internal/universe/catalog-types.d.ts +260 -0
- package/dist/ir/type-system/internal/universe/catalog-types.d.ts.map +1 -0
- package/dist/ir/type-system/internal/universe/catalog-types.js +12 -0
- package/dist/ir/type-system/internal/universe/catalog-types.js.map +1 -0
- package/dist/ir/type-system/internal/universe/clr-catalog.d.ts +7 -5
- package/dist/ir/type-system/internal/universe/clr-catalog.d.ts.map +1 -1
- package/dist/ir/type-system/internal/universe/clr-catalog.js +160 -90
- package/dist/ir/type-system/internal/universe/clr-catalog.js.map +1 -1
- package/dist/ir/type-system/internal/universe/clr-catalog.test.js +166 -72
- package/dist/ir/type-system/internal/universe/clr-catalog.test.js.map +1 -1
- package/dist/ir/type-system/internal/universe/clr-entry-converter.d.ts +7 -47
- package/dist/ir/type-system/internal/universe/clr-entry-converter.d.ts.map +1 -1
- package/dist/ir/type-system/internal/universe/clr-entry-converter.js +6 -694
- package/dist/ir/type-system/internal/universe/clr-entry-converter.js.map +1 -1
- package/dist/ir/type-system/internal/universe/clr-heritage-enrichment.d.ts +10 -0
- package/dist/ir/type-system/internal/universe/clr-heritage-enrichment.d.ts.map +1 -0
- package/dist/ir/type-system/internal/universe/clr-heritage-enrichment.js +168 -0
- package/dist/ir/type-system/internal/universe/clr-heritage-enrichment.js.map +1 -0
- package/dist/ir/type-system/internal/universe/clr-heritage-extraction.d.ts +28 -0
- package/dist/ir/type-system/internal/universe/clr-heritage-extraction.d.ts.map +1 -0
- package/dist/ir/type-system/internal/universe/clr-heritage-extraction.js +307 -0
- package/dist/ir/type-system/internal/universe/clr-heritage-extraction.js.map +1 -0
- package/dist/ir/type-system/internal/universe/clr-heritage-extractor.d.ts +11 -0
- package/dist/ir/type-system/internal/universe/clr-heritage-extractor.d.ts.map +1 -0
- package/dist/ir/type-system/internal/universe/clr-heritage-extractor.js +10 -0
- package/dist/ir/type-system/internal/universe/clr-heritage-extractor.js.map +1 -0
- package/dist/ir/type-system/internal/universe/clr-raw-converter.d.ts +41 -0
- package/dist/ir/type-system/internal/universe/clr-raw-converter.d.ts.map +1 -0
- package/dist/ir/type-system/internal/universe/clr-raw-converter.js +364 -0
- package/dist/ir/type-system/internal/universe/clr-raw-converter.js.map +1 -0
- package/dist/ir/type-system/internal/universe/clr-type-parser.d.ts +3 -41
- package/dist/ir/type-system/internal/universe/clr-type-parser.d.ts.map +1 -1
- package/dist/ir/type-system/internal/universe/clr-type-parser.js +3 -470
- package/dist/ir/type-system/internal/universe/clr-type-parser.js.map +1 -1
- package/dist/ir/type-system/internal/universe/clr-type-parser.test.js +13 -2
- package/dist/ir/type-system/internal/universe/clr-type-parser.test.js.map +1 -1
- package/dist/ir/type-system/internal/universe/clr-type-string-parsing.d.ts +28 -0
- package/dist/ir/type-system/internal/universe/clr-type-string-parsing.d.ts.map +1 -0
- package/dist/ir/type-system/internal/universe/clr-type-string-parsing.js +208 -0
- package/dist/ir/type-system/internal/universe/clr-type-string-parsing.js.map +1 -0
- package/dist/ir/type-system/internal/universe/dts-type-node-conversion.d.ts +28 -0
- package/dist/ir/type-system/internal/universe/dts-type-node-conversion.d.ts.map +1 -0
- package/dist/ir/type-system/internal/universe/dts-type-node-conversion.js +279 -0
- package/dist/ir/type-system/internal/universe/dts-type-node-conversion.js.map +1 -0
- package/dist/ir/type-system/internal/universe/index.d.ts +1 -1
- package/dist/ir/type-system/internal/universe/index.d.ts.map +1 -1
- package/dist/ir/type-system/internal/universe/index.js.map +1 -1
- package/dist/ir/type-system/internal/universe/raw-bindings-types.d.ts +167 -0
- package/dist/ir/type-system/internal/universe/raw-bindings-types.d.ts.map +1 -0
- package/dist/ir/type-system/internal/universe/raw-bindings-types.js +79 -0
- package/dist/ir/type-system/internal/universe/raw-bindings-types.js.map +1 -0
- package/dist/ir/type-system/internal/universe/source-catalog.d.ts +1 -1
- package/dist/ir/type-system/internal/universe/source-catalog.d.ts.map +1 -1
- package/dist/ir/type-system/internal/universe/source-catalog.js.map +1 -1
- package/dist/ir/type-system/internal/universe/types.d.ts +4 -388
- package/dist/ir/type-system/internal/universe/types.d.ts.map +1 -1
- package/dist/ir/type-system/internal/universe/types.js +2 -60
- package/dist/ir/type-system/internal/universe/types.js.map +1 -1
- package/dist/ir/type-system/internal/universe/unified-universe.d.ts +2 -2
- package/dist/ir/type-system/internal/universe/unified-universe.d.ts.map +1 -1
- package/dist/ir/type-system/internal/universe/unified-universe.js +467 -19
- package/dist/ir/type-system/internal/universe/unified-universe.js.map +1 -1
- package/dist/ir/type-system/internal/universe/unified-universe.test.js +7 -2
- package/dist/ir/type-system/internal/universe/unified-universe.test.js.map +1 -1
- package/dist/ir/type-system/iterable-type-shapes.d.ts +8 -0
- package/dist/ir/type-system/iterable-type-shapes.d.ts.map +1 -0
- package/dist/ir/type-system/iterable-type-shapes.js +229 -0
- package/dist/ir/type-system/iterable-type-shapes.js.map +1 -0
- package/dist/ir/type-system/type-alias-expansion.d.ts +4 -0
- package/dist/ir/type-system/type-alias-expansion.d.ts.map +1 -0
- package/dist/ir/type-system/type-alias-expansion.js +27 -0
- package/dist/ir/type-system/type-alias-expansion.js.map +1 -0
- package/dist/ir/type-system/type-system-call-resolution.d.ts +16 -68
- package/dist/ir/type-system/type-system-call-resolution.d.ts.map +1 -1
- package/dist/ir/type-system/type-system-call-resolution.js +17 -1407
- package/dist/ir/type-system/type-system-call-resolution.js.map +1 -1
- package/dist/ir/type-system/type-system-factory.d.ts +24 -0
- package/dist/ir/type-system/type-system-factory.d.ts.map +1 -0
- package/dist/ir/type-system/type-system-factory.js +145 -0
- package/dist/ir/type-system/type-system-factory.js.map +1 -0
- package/dist/ir/type-system/type-system-inference.d.ts +13 -92
- package/dist/ir/type-system/type-system-inference.d.ts.map +1 -1
- package/dist/ir/type-system/type-system-inference.js +18 -1315
- package/dist/ir/type-system/type-system-inference.js.map +1 -1
- package/dist/ir/type-system/type-system-relations.d.ts +1 -0
- package/dist/ir/type-system/type-system-relations.d.ts.map +1 -1
- package/dist/ir/type-system/type-system-relations.js +332 -19
- package/dist/ir/type-system/type-system-relations.js.map +1 -1
- package/dist/ir/type-system/type-system-state-call-types.d.ts +62 -0
- package/dist/ir/type-system/type-system-state-call-types.d.ts.map +1 -0
- package/dist/ir/type-system/type-system-state-call-types.js +2 -0
- package/dist/ir/type-system/type-system-state-call-types.js.map +1 -0
- package/dist/ir/type-system/type-system-state-handle-types.d.ts +134 -0
- package/dist/ir/type-system/type-system-state-handle-types.d.ts.map +1 -0
- package/dist/ir/type-system/type-system-state-handle-types.js +2 -0
- package/dist/ir/type-system/type-system-state-handle-types.js.map +1 -0
- package/dist/ir/type-system/type-system-state-helpers.d.ts +56 -0
- package/dist/ir/type-system/type-system-state-helpers.d.ts.map +1 -0
- package/dist/ir/type-system/type-system-state-helpers.js +291 -0
- package/dist/ir/type-system/type-system-state-helpers.js.map +1 -0
- package/dist/ir/type-system/type-system-state-model.d.ts +33 -0
- package/dist/ir/type-system/type-system-state-model.d.ts.map +1 -0
- package/dist/ir/type-system/type-system-state-model.js +3 -0
- package/dist/ir/type-system/type-system-state-model.js.map +1 -0
- package/dist/ir/type-system/type-system-state-registry-types.d.ts +11 -0
- package/dist/ir/type-system/type-system-state-registry-types.d.ts.map +1 -0
- package/dist/ir/type-system/type-system-state-registry-types.js +17 -0
- package/dist/ir/type-system/type-system-state-registry-types.js.map +1 -0
- package/dist/ir/type-system/type-system-state-types.d.ts +4 -0
- package/dist/ir/type-system/type-system-state-types.d.ts.map +1 -0
- package/dist/ir/type-system/type-system-state-types.js +4 -0
- package/dist/ir/type-system/type-system-state-types.js.map +1 -0
- package/dist/ir/type-system/type-system-state.d.ts +4 -454
- package/dist/ir/type-system/type-system-state.d.ts.map +1 -1
- package/dist/ir/type-system/type-system-state.js +4 -228
- package/dist/ir/type-system/type-system-state.js.map +1 -1
- package/dist/ir/type-system/type-system-types-api.d.ts +341 -0
- package/dist/ir/type-system/type-system-types-api.d.ts.map +1 -0
- package/dist/ir/type-system/type-system-types-api.js +11 -0
- package/dist/ir/type-system/type-system-types-api.js.map +1 -0
- package/dist/ir/type-system/type-system-utilities.d.ts +4 -48
- package/dist/ir/type-system/type-system-utilities.d.ts.map +1 -1
- package/dist/ir/type-system/type-system-utilities.js +4 -347
- package/dist/ir/type-system/type-system-utilities.js.map +1 -1
- package/dist/ir/type-system/type-system.d.ts +8 -313
- package/dist/ir/type-system/type-system.d.ts.map +1 -1
- package/dist/ir/type-system/type-system.js +7 -131
- package/dist/ir/type-system/type-system.js.map +1 -1
- package/dist/ir/type-system/types.d.ts +2 -0
- package/dist/ir/type-system/types.d.ts.map +1 -1
- package/dist/ir/type-system/types.js +5 -0
- package/dist/ir/type-system/types.js.map +1 -1
- package/dist/ir/type-system/utility-type-filter-helpers.d.ts +40 -0
- package/dist/ir/type-system/utility-type-filter-helpers.d.ts.map +1 -0
- package/dist/ir/type-system/utility-type-filter-helpers.js +142 -0
- package/dist/ir/type-system/utility-type-filter-helpers.js.map +1 -0
- package/dist/ir/type-system/utility-type-mapped-helpers.d.ts +34 -0
- package/dist/ir/type-system/utility-type-mapped-helpers.d.ts.map +1 -0
- package/dist/ir/type-system/utility-type-mapped-helpers.js +243 -0
- package/dist/ir/type-system/utility-type-mapped-helpers.js.map +1 -0
- package/dist/ir/types/expressions-core.d.ts +331 -0
- package/dist/ir/types/expressions-core.d.ts.map +1 -0
- package/dist/ir/types/expressions-core.js +5 -0
- package/dist/ir/types/expressions-core.js.map +1 -0
- package/dist/ir/types/expressions-extended.d.ts +232 -0
- package/dist/ir/types/expressions-extended.d.ts.map +1 -0
- package/dist/ir/types/expressions-extended.js +6 -0
- package/dist/ir/types/expressions-extended.js.map +1 -0
- package/dist/ir/types/expressions.d.ts +6 -480
- package/dist/ir/types/expressions.d.ts.map +1 -1
- package/dist/ir/types/expressions.js +5 -1
- package/dist/ir/types/expressions.js.map +1 -1
- package/dist/ir/types/helpers.d.ts +4 -0
- package/dist/ir/types/helpers.d.ts.map +1 -1
- package/dist/ir/types/index.d.ts +4 -2
- package/dist/ir/types/index.d.ts.map +1 -1
- package/dist/ir/types/index.js +2 -1
- package/dist/ir/types/index.js.map +1 -1
- package/dist/ir/types/ir-substitution-builders.d.ts +91 -0
- package/dist/ir/types/ir-substitution-builders.d.ts.map +1 -0
- package/dist/ir/types/ir-substitution-builders.js +340 -0
- package/dist/ir/types/ir-substitution-builders.js.map +1 -0
- package/dist/ir/types/ir-substitution-core.d.ts +55 -0
- package/dist/ir/types/ir-substitution-core.d.ts.map +1 -0
- package/dist/ir/types/ir-substitution-core.js +402 -0
- package/dist/ir/types/ir-substitution-core.js.map +1 -0
- package/dist/ir/types/ir-substitution.d.ts +13 -142
- package/dist/ir/types/ir-substitution.d.ts.map +1 -1
- package/dist/ir/types/ir-substitution.js +9 -565
- package/dist/ir/types/ir-substitution.js.map +1 -1
- package/dist/ir/types/ir-types.d.ts +80 -4
- package/dist/ir/types/ir-types.d.ts.map +1 -1
- package/dist/ir/types/overload-family.d.ts +36 -0
- package/dist/ir/types/overload-family.d.ts.map +1 -0
- package/dist/ir/types/overload-family.js +9 -0
- package/dist/ir/types/overload-family.js.map +1 -0
- package/dist/ir/types/statements.d.ts +8 -1
- package/dist/ir/types/statements.d.ts.map +1 -1
- package/dist/ir/types/type-ops.d.ts +41 -2
- package/dist/ir/types/type-ops.d.ts.map +1 -1
- package/dist/ir/types/type-ops.js +744 -45
- package/dist/ir/types/type-ops.js.map +1 -1
- package/dist/ir/types/type-ops.test.js +443 -1
- package/dist/ir/types/type-ops.test.js.map +1 -1
- package/dist/ir/types.d.ts +2 -2
- package/dist/ir/types.d.ts.map +1 -1
- package/dist/ir/types.js +1 -1
- package/dist/ir/types.js.map +1 -1
- package/dist/ir/validation/anon-type-declaration-synthesis.d.ts +11 -0
- package/dist/ir/validation/anon-type-declaration-synthesis.d.ts.map +1 -0
- package/dist/ir/validation/anon-type-declaration-synthesis.js +11 -0
- package/dist/ir/validation/anon-type-declaration-synthesis.js.map +1 -0
- package/dist/ir/validation/anon-type-ir-rewriting.d.ts +10 -0
- package/dist/ir/validation/anon-type-ir-rewriting.d.ts.map +1 -0
- package/dist/ir/validation/anon-type-ir-rewriting.js +3 -0
- package/dist/ir/validation/anon-type-ir-rewriting.js.map +1 -0
- package/dist/ir/validation/anon-type-lower-expressions.d.ts +10 -0
- package/dist/ir/validation/anon-type-lower-expressions.d.ts.map +1 -0
- package/dist/ir/validation/anon-type-lower-expressions.js +364 -0
- package/dist/ir/validation/anon-type-lower-expressions.js.map +1 -0
- package/dist/ir/validation/anon-type-lower-statements.d.ts +13 -0
- package/dist/ir/validation/anon-type-lower-statements.d.ts.map +1 -0
- package/dist/ir/validation/anon-type-lower-statements.js +270 -0
- package/dist/ir/validation/anon-type-lower-statements.js.map +1 -0
- package/dist/ir/validation/anon-type-lower-types.d.ts +60 -0
- package/dist/ir/validation/anon-type-lower-types.d.ts.map +1 -0
- package/dist/ir/validation/anon-type-lower-types.js +287 -0
- package/dist/ir/validation/anon-type-lower-types.js.map +1 -0
- package/dist/ir/validation/anon-type-naming.d.ts +20 -0
- package/dist/ir/validation/anon-type-naming.d.ts.map +1 -0
- package/dist/ir/validation/anon-type-naming.js +153 -0
- package/dist/ir/validation/anon-type-naming.js.map +1 -0
- package/dist/ir/validation/anon-type-shape-analysis.d.ts +13 -0
- package/dist/ir/validation/anon-type-shape-analysis.d.ts.map +1 -0
- package/dist/ir/validation/anon-type-shape-analysis.js +12 -0
- package/dist/ir/validation/anon-type-shape-analysis.js.map +1 -0
- package/dist/ir/validation/anon-type-shape-collectors.d.ts +39 -0
- package/dist/ir/validation/anon-type-shape-collectors.d.ts.map +1 -0
- package/dist/ir/validation/anon-type-shape-collectors.js +369 -0
- package/dist/ir/validation/anon-type-shape-collectors.js.map +1 -0
- package/dist/ir/validation/anon-type-shape-serialization.d.ts +38 -0
- package/dist/ir/validation/anon-type-shape-serialization.d.ts.map +1 -0
- package/dist/ir/validation/anon-type-shape-serialization.js +241 -0
- package/dist/ir/validation/anon-type-shape-serialization.js.map +1 -0
- package/dist/ir/validation/anon-type-template-inference.d.ts +12 -0
- package/dist/ir/validation/anon-type-template-inference.d.ts.map +1 -0
- package/dist/ir/validation/anon-type-template-inference.js +296 -0
- package/dist/ir/validation/anon-type-template-inference.js.map +1 -0
- package/dist/ir/validation/anonymous-type-lowering-pass.d.ts +7 -1
- package/dist/ir/validation/anonymous-type-lowering-pass.d.ts.map +1 -1
- package/dist/ir/validation/anonymous-type-lowering-pass.js +315 -1166
- package/dist/ir/validation/anonymous-type-lowering-pass.js.map +1 -1
- package/dist/ir/validation/anonymous-type-lowering-regressions-cases/basic-lowering.test.d.ts +2 -0
- package/dist/ir/validation/anonymous-type-lowering-regressions-cases/basic-lowering.test.d.ts.map +1 -0
- package/dist/ir/validation/anonymous-type-lowering-regressions-cases/basic-lowering.test.js +332 -0
- package/dist/ir/validation/anonymous-type-lowering-regressions-cases/basic-lowering.test.js.map +1 -0
- package/dist/ir/validation/anonymous-type-lowering-regressions-cases/cross-module-reuse.test.d.ts +2 -0
- package/dist/ir/validation/anonymous-type-lowering-regressions-cases/cross-module-reuse.test.d.ts.map +1 -0
- package/dist/ir/validation/anonymous-type-lowering-regressions-cases/cross-module-reuse.test.js +255 -0
- package/dist/ir/validation/anonymous-type-lowering-regressions-cases/cross-module-reuse.test.js.map +1 -0
- package/dist/ir/validation/anonymous-type-lowering-regressions-cases/structural-references.test.d.ts +2 -0
- package/dist/ir/validation/anonymous-type-lowering-regressions-cases/structural-references.test.d.ts.map +1 -0
- package/dist/ir/validation/anonymous-type-lowering-regressions-cases/structural-references.test.js +715 -0
- package/dist/ir/validation/anonymous-type-lowering-regressions-cases/structural-references.test.js.map +1 -0
- package/dist/ir/validation/anonymous-type-lowering-regressions-cases/test-helpers.d.ts +4 -0
- package/dist/ir/validation/anonymous-type-lowering-regressions-cases/test-helpers.d.ts.map +1 -0
- package/dist/ir/validation/anonymous-type-lowering-regressions-cases/test-helpers.js +85 -0
- package/dist/ir/validation/anonymous-type-lowering-regressions-cases/test-helpers.js.map +1 -0
- package/dist/ir/validation/anonymous-type-lowering-regressions.test.d.ts +3 -1
- package/dist/ir/validation/anonymous-type-lowering-regressions.test.d.ts.map +1 -1
- package/dist/ir/validation/anonymous-type-lowering-regressions.test.js +3 -120
- package/dist/ir/validation/anonymous-type-lowering-regressions.test.js.map +1 -1
- package/dist/ir/validation/arrow-return-expression-walk.d.ts +13 -0
- package/dist/ir/validation/arrow-return-expression-walk.d.ts.map +1 -0
- package/dist/ir/validation/arrow-return-expression-walk.js +224 -0
- package/dist/ir/validation/arrow-return-expression-walk.js.map +1 -0
- package/dist/ir/validation/arrow-return-finalization-pass.d.ts +3 -17
- package/dist/ir/validation/arrow-return-finalization-pass.d.ts.map +1 -1
- package/dist/ir/validation/arrow-return-finalization-pass.js +2 -418
- package/dist/ir/validation/arrow-return-finalization-pass.js.map +1 -1
- package/dist/ir/validation/arrow-return-statement-walk.d.ts +27 -0
- package/dist/ir/validation/arrow-return-statement-walk.d.ts.map +1 -0
- package/dist/ir/validation/arrow-return-statement-walk.js +206 -0
- package/dist/ir/validation/arrow-return-statement-walk.js.map +1 -0
- package/dist/ir/validation/attribute-collection/arg-extractor.d.ts +8 -2
- package/dist/ir/validation/attribute-collection/arg-extractor.d.ts.map +1 -1
- package/dist/ir/validation/attribute-collection/arg-extractor.js.map +1 -1
- package/dist/ir/validation/attribute-collection/marker-chain-parser.d.ts +21 -0
- package/dist/ir/validation/attribute-collection/marker-chain-parser.d.ts.map +1 -0
- package/dist/ir/validation/attribute-collection/marker-chain-parser.js +261 -0
- package/dist/ir/validation/attribute-collection/marker-chain-parser.js.map +1 -0
- package/dist/ir/validation/attribute-collection/marker-collection.d.ts +28 -0
- package/dist/ir/validation/attribute-collection/marker-collection.d.ts.map +1 -0
- package/dist/ir/validation/attribute-collection/marker-collection.js +343 -0
- package/dist/ir/validation/attribute-collection/marker-collection.js.map +1 -0
- package/dist/ir/validation/attribute-collection/marker-detection.d.ts +25 -0
- package/dist/ir/validation/attribute-collection/marker-detection.d.ts.map +1 -0
- package/dist/ir/validation/attribute-collection/marker-detection.js +214 -0
- package/dist/ir/validation/attribute-collection/marker-detection.js.map +1 -0
- package/dist/ir/validation/attribute-collection/marker-parser.d.ts +7 -24
- package/dist/ir/validation/attribute-collection/marker-parser.d.ts.map +1 -1
- package/dist/ir/validation/attribute-collection/marker-parser.js +7 -400
- package/dist/ir/validation/attribute-collection/marker-parser.js.map +1 -1
- package/dist/ir/validation/attribute-collection/module-rebuild.d.ts +28 -0
- package/dist/ir/validation/attribute-collection/module-rebuild.d.ts.map +1 -0
- package/dist/ir/validation/attribute-collection/module-rebuild.js +176 -0
- package/dist/ir/validation/attribute-collection/module-rebuild.js.map +1 -0
- package/dist/ir/validation/attribute-collection/orchestrator.d.ts +3 -19
- package/dist/ir/validation/attribute-collection/orchestrator.d.ts.map +1 -1
- package/dist/ir/validation/attribute-collection/orchestrator.js +2 -323
- package/dist/ir/validation/attribute-collection/orchestrator.js.map +1 -1
- package/dist/ir/validation/attribute-collection-cases/ctor-add.test.d.ts +5 -0
- package/dist/ir/validation/attribute-collection-cases/ctor-add.test.d.ts.map +1 -0
- package/dist/ir/validation/attribute-collection-cases/ctor-add.test.js +62 -0
- package/dist/ir/validation/attribute-collection-cases/ctor-add.test.js.map +1 -0
- package/dist/ir/validation/attribute-collection-cases/error-cases.test.d.ts +5 -0
- package/dist/ir/validation/attribute-collection-cases/error-cases.test.d.ts.map +1 -0
- package/dist/ir/validation/attribute-collection-cases/error-cases.test.js +246 -0
- package/dist/ir/validation/attribute-collection-cases/error-cases.test.js.map +1 -0
- package/dist/ir/validation/attribute-collection-cases/function-and-misc.test.d.ts +6 -0
- package/dist/ir/validation/attribute-collection-cases/function-and-misc.test.d.ts.map +1 -0
- package/dist/ir/validation/attribute-collection-cases/function-and-misc.test.js +77 -0
- package/dist/ir/validation/attribute-collection-cases/function-and-misc.test.js.map +1 -0
- package/dist/ir/validation/attribute-collection-cases/helpers.d.ts +186 -0
- package/dist/ir/validation/attribute-collection-cases/helpers.d.ts.map +1 -0
- package/dist/ir/validation/attribute-collection-cases/helpers.js +239 -0
- package/dist/ir/validation/attribute-collection-cases/helpers.js.map +1 -0
- package/dist/ir/validation/attribute-collection-cases/method-selector.test.d.ts +5 -0
- package/dist/ir/validation/attribute-collection-cases/method-selector.test.d.ts.map +1 -0
- package/dist/ir/validation/attribute-collection-cases/method-selector.test.js +371 -0
- package/dist/ir/validation/attribute-collection-cases/method-selector.test.js.map +1 -0
- package/dist/ir/validation/attribute-collection-cases/prop-selector.test.d.ts +5 -0
- package/dist/ir/validation/attribute-collection-cases/prop-selector.test.d.ts.map +1 -0
- package/dist/ir/validation/attribute-collection-cases/prop-selector.test.js +209 -0
- package/dist/ir/validation/attribute-collection-cases/prop-selector.test.js.map +1 -0
- package/dist/ir/validation/attribute-collection-cases/type-add.test.d.ts +5 -0
- package/dist/ir/validation/attribute-collection-cases/type-add.test.d.ts.map +1 -0
- package/dist/ir/validation/attribute-collection-cases/type-add.test.js +330 -0
- package/dist/ir/validation/attribute-collection-cases/type-add.test.js.map +1 -0
- package/dist/ir/validation/attribute-collection-pass.d.ts +5 -4
- package/dist/ir/validation/attribute-collection-pass.d.ts.map +1 -1
- package/dist/ir/validation/attribute-collection-pass.js +5 -4
- package/dist/ir/validation/attribute-collection-pass.js.map +1 -1
- package/dist/ir/validation/attribute-collection-pass.test.d.ts +8 -1
- package/dist/ir/validation/attribute-collection-pass.test.d.ts.map +1 -1
- package/dist/ir/validation/attribute-collection-pass.test.js +8 -1331
- package/dist/ir/validation/attribute-collection-pass.test.js.map +1 -1
- package/dist/ir/validation/call-resolution-refresh-pass.d.ts +8 -0
- package/dist/ir/validation/call-resolution-refresh-pass.d.ts.map +1 -0
- package/dist/ir/validation/call-resolution-refresh-pass.js +616 -0
- package/dist/ir/validation/call-resolution-refresh-pass.js.map +1 -0
- package/dist/ir/validation/char-validation-expressions.d.ts +13 -0
- package/dist/ir/validation/char-validation-expressions.d.ts.map +1 -0
- package/dist/ir/validation/char-validation-expressions.js +362 -0
- package/dist/ir/validation/char-validation-expressions.js.map +1 -0
- package/dist/ir/validation/char-validation-pass.d.ts +7 -22
- package/dist/ir/validation/char-validation-pass.d.ts.map +1 -1
- package/dist/ir/validation/char-validation-pass.js +6 -504
- package/dist/ir/validation/char-validation-pass.js.map +1 -1
- package/dist/ir/validation/char-validation-types.d.ts +28 -0
- package/dist/ir/validation/char-validation-types.d.ts.map +1 -0
- package/dist/ir/validation/char-validation-types.js +144 -0
- package/dist/ir/validation/char-validation-types.js.map +1 -0
- package/dist/ir/validation/index.d.ts +3 -0
- package/dist/ir/validation/index.d.ts.map +1 -1
- package/dist/ir/validation/index.js +3 -0
- package/dist/ir/validation/index.js.map +1 -1
- package/dist/ir/validation/known-builtin-reference-types.d.ts +12 -0
- package/dist/ir/validation/known-builtin-reference-types.d.ts.map +1 -0
- package/dist/ir/validation/known-builtin-reference-types.js +29 -0
- package/dist/ir/validation/known-builtin-reference-types.js.map +1 -0
- package/dist/ir/validation/numeric-classification.d.ts +105 -0
- package/dist/ir/validation/numeric-classification.d.ts.map +1 -0
- package/dist/ir/validation/numeric-classification.js +368 -0
- package/dist/ir/validation/numeric-classification.js.map +1 -0
- package/dist/ir/validation/numeric-coercion-pass.d.ts +3 -50
- package/dist/ir/validation/numeric-coercion-pass.d.ts.map +1 -1
- package/dist/ir/validation/numeric-coercion-pass.js +3 -777
- package/dist/ir/validation/numeric-coercion-pass.js.map +1 -1
- package/dist/ir/validation/numeric-expression-validation.d.ts +26 -0
- package/dist/ir/validation/numeric-expression-validation.d.ts.map +1 -0
- package/dist/ir/validation/numeric-expression-validation.js +253 -0
- package/dist/ir/validation/numeric-expression-validation.js.map +1 -0
- package/dist/ir/validation/numeric-invariants-cases/array-index-proofs.test.d.ts +11 -0
- package/dist/ir/validation/numeric-invariants-cases/array-index-proofs.test.d.ts.map +1 -0
- package/dist/ir/validation/numeric-invariants-cases/array-index-proofs.test.js +185 -0
- package/dist/ir/validation/numeric-invariants-cases/array-index-proofs.test.js.map +1 -0
- package/dist/ir/validation/numeric-invariants-cases/arrow-function-proofs.test.d.ts +16 -0
- package/dist/ir/validation/numeric-invariants-cases/arrow-function-proofs.test.d.ts.map +1 -0
- package/dist/ir/validation/numeric-invariants-cases/arrow-function-proofs.test.js +364 -0
- package/dist/ir/validation/numeric-invariants-cases/arrow-function-proofs.test.js.map +1 -0
- package/dist/ir/validation/numeric-invariants-cases/binary-promotion.test.d.ts +9 -0
- package/dist/ir/validation/numeric-invariants-cases/binary-promotion.test.d.ts.map +1 -0
- package/dist/ir/validation/numeric-invariants-cases/binary-promotion.test.js +119 -0
- package/dist/ir/validation/numeric-invariants-cases/binary-promotion.test.js.map +1 -0
- package/dist/ir/validation/numeric-invariants-cases/helpers.d.ts +60 -0
- package/dist/ir/validation/numeric-invariants-cases/helpers.d.ts.map +1 -0
- package/dist/ir/validation/numeric-invariants-cases/helpers.js +163 -0
- package/dist/ir/validation/numeric-invariants-cases/helpers.js.map +1 -0
- package/dist/ir/validation/numeric-invariants-cases/literal-range-validation.test.d.ts +8 -0
- package/dist/ir/validation/numeric-invariants-cases/literal-range-validation.test.d.ts.map +1 -0
- package/dist/ir/validation/numeric-invariants-cases/literal-range-validation.test.js +110 -0
- package/dist/ir/validation/numeric-invariants-cases/literal-range-validation.test.js.map +1 -0
- package/dist/ir/validation/numeric-invariants-cases/narrowing-intent.test.d.ts +12 -0
- package/dist/ir/validation/numeric-invariants-cases/narrowing-intent.test.d.ts.map +1 -0
- package/dist/ir/validation/numeric-invariants-cases/narrowing-intent.test.js +188 -0
- package/dist/ir/validation/numeric-invariants-cases/narrowing-intent.test.js.map +1 -0
- package/dist/ir/validation/numeric-invariants.test.d.ts +5 -14
- package/dist/ir/validation/numeric-invariants.test.d.ts.map +1 -1
- package/dist/ir/validation/numeric-invariants.test.js +5 -932
- package/dist/ir/validation/numeric-invariants.test.js.map +1 -1
- package/dist/ir/validation/numeric-proof-analysis.d.ts +9 -0
- package/dist/ir/validation/numeric-proof-analysis.d.ts.map +1 -0
- package/dist/ir/validation/numeric-proof-analysis.js +8 -0
- package/dist/ir/validation/numeric-proof-analysis.js.map +1 -0
- package/dist/ir/validation/numeric-proof-expression-walk.d.ts +18 -0
- package/dist/ir/validation/numeric-proof-expression-walk.d.ts.map +1 -0
- package/dist/ir/validation/numeric-proof-expression-walk.js +331 -0
- package/dist/ir/validation/numeric-proof-expression-walk.js.map +1 -0
- package/dist/ir/validation/numeric-proof-guard-facts.d.ts +29 -0
- package/dist/ir/validation/numeric-proof-guard-facts.d.ts.map +1 -0
- package/dist/ir/validation/numeric-proof-guard-facts.js +213 -0
- package/dist/ir/validation/numeric-proof-guard-facts.js.map +1 -0
- package/dist/ir/validation/numeric-proof-inference.d.ts +33 -0
- package/dist/ir/validation/numeric-proof-inference.d.ts.map +1 -0
- package/dist/ir/validation/numeric-proof-inference.js +222 -0
- package/dist/ir/validation/numeric-proof-inference.js.map +1 -0
- package/dist/ir/validation/numeric-proof-pass.d.ts +5 -25
- package/dist/ir/validation/numeric-proof-pass.d.ts.map +1 -1
- package/dist/ir/validation/numeric-proof-pass.js +5 -1164
- package/dist/ir/validation/numeric-proof-pass.js.map +1 -1
- package/dist/ir/validation/numeric-proof-proving.d.ts +21 -0
- package/dist/ir/validation/numeric-proof-proving.d.ts.map +1 -0
- package/dist/ir/validation/numeric-proof-proving.js +261 -0
- package/dist/ir/validation/numeric-proof-proving.js.map +1 -0
- package/dist/ir/validation/numeric-proof-statement-walk.d.ts +37 -0
- package/dist/ir/validation/numeric-proof-statement-walk.d.ts.map +1 -0
- package/dist/ir/validation/numeric-proof-statement-walk.js +295 -0
- package/dist/ir/validation/numeric-proof-statement-walk.js.map +1 -0
- package/dist/ir/validation/numeric-proof-walk.d.ts +10 -0
- package/dist/ir/validation/numeric-proof-walk.d.ts.map +1 -0
- package/dist/ir/validation/numeric-proof-walk.js +9 -0
- package/dist/ir/validation/numeric-proof-walk.js.map +1 -0
- package/dist/ir/validation/numeric-statement-processing.d.ts +39 -0
- package/dist/ir/validation/numeric-statement-processing.d.ts.map +1 -0
- package/dist/ir/validation/numeric-statement-processing.js +229 -0
- package/dist/ir/validation/numeric-statement-processing.js.map +1 -0
- package/dist/ir/validation/numeric-validation.d.ts +13 -0
- package/dist/ir/validation/numeric-validation.d.ts.map +1 -0
- package/dist/ir/validation/numeric-validation.js +12 -0
- package/dist/ir/validation/numeric-validation.js.map +1 -0
- package/dist/ir/validation/overload-collection-cases/basic.test.d.ts +2 -0
- package/dist/ir/validation/overload-collection-cases/basic.test.d.ts.map +1 -0
- package/dist/ir/validation/overload-collection-cases/basic.test.js +103 -0
- package/dist/ir/validation/overload-collection-cases/basic.test.js.map +1 -0
- package/dist/ir/validation/overload-collection-cases/consistency.test.d.ts +2 -0
- package/dist/ir/validation/overload-collection-cases/consistency.test.d.ts.map +1 -0
- package/dist/ir/validation/overload-collection-cases/consistency.test.js +79 -0
- package/dist/ir/validation/overload-collection-cases/consistency.test.js.map +1 -0
- package/dist/ir/validation/overload-collection-cases/error-cases.test.d.ts +2 -0
- package/dist/ir/validation/overload-collection-cases/error-cases.test.d.ts.map +1 -0
- package/dist/ir/validation/overload-collection-cases/error-cases.test.js +24 -0
- package/dist/ir/validation/overload-collection-cases/error-cases.test.js.map +1 -0
- package/dist/ir/validation/overload-collection-cases/helpers.d.ts +107 -0
- package/dist/ir/validation/overload-collection-cases/helpers.d.ts.map +1 -0
- package/dist/ir/validation/overload-collection-cases/helpers.js +142 -0
- package/dist/ir/validation/overload-collection-cases/helpers.js.map +1 -0
- package/dist/ir/validation/overload-collection-pass.d.ts +16 -0
- package/dist/ir/validation/overload-collection-pass.d.ts.map +1 -0
- package/dist/ir/validation/overload-collection-pass.js +930 -0
- package/dist/ir/validation/overload-collection-pass.js.map +1 -0
- package/dist/ir/validation/overload-collection-pass.test.d.ts +4 -0
- package/dist/ir/validation/overload-collection-pass.test.d.ts.map +1 -0
- package/dist/ir/validation/overload-collection-pass.test.js +4 -0
- package/dist/ir/validation/overload-collection-pass.test.js.map +1 -0
- package/dist/ir/validation/overload-family-consistency-pass.d.ts +9 -0
- package/dist/ir/validation/overload-family-consistency-pass.d.ts.map +1 -0
- package/dist/ir/validation/overload-family-consistency-pass.js +161 -0
- package/dist/ir/validation/overload-family-consistency-pass.js.map +1 -0
- package/dist/ir/validation/rest-type-synthesis-helpers.d.ts +52 -0
- package/dist/ir/validation/rest-type-synthesis-helpers.d.ts.map +1 -0
- package/dist/ir/validation/rest-type-synthesis-helpers.js +250 -0
- package/dist/ir/validation/rest-type-synthesis-helpers.js.map +1 -0
- package/dist/ir/validation/rest-type-synthesis-pass.d.ts +6 -20
- package/dist/ir/validation/rest-type-synthesis-pass.d.ts.map +1 -1
- package/dist/ir/validation/rest-type-synthesis-pass.js +5 -461
- package/dist/ir/validation/rest-type-synthesis-pass.js.map +1 -1
- package/dist/ir/validation/rest-type-synthesis-processing.d.ts +14 -0
- package/dist/ir/validation/rest-type-synthesis-processing.d.ts.map +1 -0
- package/dist/ir/validation/rest-type-synthesis-processing.js +220 -0
- package/dist/ir/validation/rest-type-synthesis-processing.js.map +1 -0
- package/dist/ir/validation/soundness-gate-cases/any-type-and-primitives.test.d.ts +12 -0
- package/dist/ir/validation/soundness-gate-cases/any-type-and-primitives.test.d.ts.map +1 -0
- package/dist/ir/validation/soundness-gate-cases/any-type-and-primitives.test.js +99 -0
- package/dist/ir/validation/soundness-gate-cases/any-type-and-primitives.test.js.map +1 -0
- package/dist/ir/validation/soundness-gate-cases/computed-member-access.test.d.ts +10 -0
- package/dist/ir/validation/soundness-gate-cases/computed-member-access.test.d.ts.map +1 -0
- package/dist/ir/validation/soundness-gate-cases/computed-member-access.test.js +139 -0
- package/dist/ir/validation/soundness-gate-cases/computed-member-access.test.js.map +1 -0
- package/dist/ir/validation/soundness-gate-cases/inference-diagnostics.test.d.ts +10 -0
- package/dist/ir/validation/soundness-gate-cases/inference-diagnostics.test.d.ts.map +1 -0
- package/dist/ir/validation/soundness-gate-cases/inference-diagnostics.test.js +123 -0
- package/dist/ir/validation/soundness-gate-cases/inference-diagnostics.test.js.map +1 -0
- package/dist/ir/validation/soundness-gate-cases/reference-type-resolution.test.d.ts +15 -0
- package/dist/ir/validation/soundness-gate-cases/reference-type-resolution.test.d.ts.map +1 -0
- package/dist/ir/validation/soundness-gate-cases/reference-type-resolution.test.js +292 -0
- package/dist/ir/validation/soundness-gate-cases/reference-type-resolution.test.js.map +1 -0
- package/dist/ir/validation/soundness-gate-cases/test-helpers.d.ts +12 -0
- package/dist/ir/validation/soundness-gate-cases/test-helpers.d.ts.map +1 -0
- package/dist/ir/validation/soundness-gate-cases/test-helpers.js +36 -0
- package/dist/ir/validation/soundness-gate-cases/test-helpers.js.map +1 -0
- package/dist/ir/validation/soundness-gate-cases/type-params-and-intrinsics.test.d.ts +11 -0
- package/dist/ir/validation/soundness-gate-cases/type-params-and-intrinsics.test.d.ts.map +1 -0
- package/dist/ir/validation/soundness-gate-cases/type-params-and-intrinsics.test.js +249 -0
- package/dist/ir/validation/soundness-gate-cases/type-params-and-intrinsics.test.js.map +1 -0
- package/dist/ir/validation/soundness-gate-expression-validation.d.ts +3 -0
- package/dist/ir/validation/soundness-gate-expression-validation.d.ts.map +1 -0
- package/dist/ir/validation/soundness-gate-expression-validation.js +205 -0
- package/dist/ir/validation/soundness-gate-expression-validation.js.map +1 -0
- package/dist/ir/validation/soundness-gate-shared.d.ts +26 -0
- package/dist/ir/validation/soundness-gate-shared.d.ts.map +1 -0
- package/dist/ir/validation/soundness-gate-shared.js +46 -0
- package/dist/ir/validation/soundness-gate-shared.js.map +1 -0
- package/dist/ir/validation/soundness-gate-statement-validation.d.ts +5 -0
- package/dist/ir/validation/soundness-gate-statement-validation.d.ts.map +1 -0
- package/dist/ir/validation/soundness-gate-statement-validation.js +199 -0
- package/dist/ir/validation/soundness-gate-statement-validation.js.map +1 -0
- package/dist/ir/validation/soundness-gate-type-validation.d.ts +9 -0
- package/dist/ir/validation/soundness-gate-type-validation.d.ts.map +1 -0
- package/dist/ir/validation/soundness-gate-type-validation.js +149 -0
- package/dist/ir/validation/soundness-gate-type-validation.js.map +1 -0
- package/dist/ir/validation/soundness-gate.d.ts +2 -18
- package/dist/ir/validation/soundness-gate.d.ts.map +1 -1
- package/dist/ir/validation/soundness-gate.js +15 -608
- package/dist/ir/validation/soundness-gate.js.map +1 -1
- package/dist/ir/validation/soundness-gate.test.d.ts +5 -12
- package/dist/ir/validation/soundness-gate.test.d.ts.map +1 -1
- package/dist/ir/validation/soundness-gate.test.js +5 -696
- package/dist/ir/validation/soundness-gate.test.js.map +1 -1
- package/dist/ir/validation/virtual-marking-pass.d.ts +10 -2
- package/dist/ir/validation/virtual-marking-pass.d.ts.map +1 -1
- package/dist/ir/validation/virtual-marking-pass.js +347 -59
- package/dist/ir/validation/virtual-marking-pass.js.map +1 -1
- package/dist/ir/validation/virtual-marking-pass.test.d.ts +2 -0
- package/dist/ir/validation/virtual-marking-pass.test.d.ts.map +1 -0
- package/dist/ir/validation/virtual-marking-pass.test.js +314 -0
- package/dist/ir/validation/virtual-marking-pass.test.js.map +1 -0
- package/dist/ir/validation/yield-expression-lowering.d.ts +13 -0
- package/dist/ir/validation/yield-expression-lowering.d.ts.map +1 -0
- package/dist/ir/validation/yield-expression-lowering.js +13 -0
- package/dist/ir/validation/yield-expression-lowering.js.map +1 -0
- package/dist/ir/validation/yield-lowering-cases/assignment-yield.test.d.ts +14 -0
- package/dist/ir/validation/yield-lowering-cases/assignment-yield.test.d.ts.map +1 -0
- package/dist/ir/validation/yield-lowering-cases/assignment-yield.test.js +383 -0
- package/dist/ir/validation/yield-lowering-cases/assignment-yield.test.js.map +1 -0
- package/dist/ir/validation/yield-lowering-cases/basic-yield.test.d.ts +12 -0
- package/dist/ir/validation/yield-lowering-cases/basic-yield.test.d.ts.map +1 -0
- package/dist/ir/validation/yield-lowering-cases/basic-yield.test.js +120 -0
- package/dist/ir/validation/yield-lowering-cases/basic-yield.test.js.map +1 -0
- package/dist/ir/validation/yield-lowering-cases/control-flow.test.d.ts +13 -0
- package/dist/ir/validation/yield-lowering-cases/control-flow.test.d.ts.map +1 -0
- package/dist/ir/validation/yield-lowering-cases/control-flow.test.js +284 -0
- package/dist/ir/validation/yield-lowering-cases/control-flow.test.js.map +1 -0
- package/dist/ir/validation/yield-lowering-cases/destructuring-and-unsupported.test.d.ts +13 -0
- package/dist/ir/validation/yield-lowering-cases/destructuring-and-unsupported.test.d.ts.map +1 -0
- package/dist/ir/validation/yield-lowering-cases/destructuring-and-unsupported.test.js +334 -0
- package/dist/ir/validation/yield-lowering-cases/destructuring-and-unsupported.test.js.map +1 -0
- package/dist/ir/validation/yield-lowering-cases/for-loop-initializer.test.d.ts +16 -0
- package/dist/ir/validation/yield-lowering-cases/for-loop-initializer.test.d.ts.map +1 -0
- package/dist/ir/validation/yield-lowering-cases/for-loop-initializer.test.js +321 -0
- package/dist/ir/validation/yield-lowering-cases/for-loop-initializer.test.js.map +1 -0
- package/dist/ir/validation/yield-lowering-cases/helpers.d.ts +32 -0
- package/dist/ir/validation/yield-lowering-cases/helpers.d.ts.map +1 -0
- package/dist/ir/validation/yield-lowering-cases/helpers.js +76 -0
- package/dist/ir/validation/yield-lowering-cases/helpers.js.map +1 -0
- package/dist/ir/validation/yield-lowering-cases/nested-yield-in-statements.test.d.ts +13 -0
- package/dist/ir/validation/yield-lowering-cases/nested-yield-in-statements.test.d.ts.map +1 -0
- package/dist/ir/validation/yield-lowering-cases/nested-yield-in-statements.test.js +221 -0
- package/dist/ir/validation/yield-lowering-cases/nested-yield-in-statements.test.js.map +1 -0
- package/dist/ir/validation/yield-lowering-cases/non-generator-and-modules.test.d.ts +11 -0
- package/dist/ir/validation/yield-lowering-cases/non-generator-and-modules.test.d.ts.map +1 -0
- package/dist/ir/validation/yield-lowering-cases/non-generator-and-modules.test.js +136 -0
- package/dist/ir/validation/yield-lowering-cases/non-generator-and-modules.test.js.map +1 -0
- package/dist/ir/validation/yield-lowering-cases/pipeline-contract-and-return.test.d.ts +14 -0
- package/dist/ir/validation/yield-lowering-cases/pipeline-contract-and-return.test.d.ts.map +1 -0
- package/dist/ir/validation/yield-lowering-cases/pipeline-contract-and-return.test.js +219 -0
- package/dist/ir/validation/yield-lowering-cases/pipeline-contract-and-return.test.js.map +1 -0
- package/dist/ir/validation/yield-lowering-helpers.d.ts +63 -0
- package/dist/ir/validation/yield-lowering-helpers.d.ts.map +1 -0
- package/dist/ir/validation/yield-lowering-helpers.js +240 -0
- package/dist/ir/validation/yield-lowering-helpers.js.map +1 -0
- package/dist/ir/validation/yield-lowering-pass.d.ts +7 -1
- package/dist/ir/validation/yield-lowering-pass.d.ts.map +1 -1
- package/dist/ir/validation/yield-lowering-pass.js +8 -1418
- package/dist/ir/validation/yield-lowering-pass.js.map +1 -1
- package/dist/ir/validation/yield-lowering-pass.test.d.ts +8 -11
- package/dist/ir/validation/yield-lowering-pass.test.d.ts.map +1 -1
- package/dist/ir/validation/yield-lowering-pass.test.js +8 -1975
- package/dist/ir/validation/yield-lowering-pass.test.js.map +1 -1
- package/dist/ir/validation/yield-main-expression-lowering.d.ts +20 -0
- package/dist/ir/validation/yield-main-expression-lowering.d.ts.map +1 -0
- package/dist/ir/validation/yield-main-expression-lowering.js +381 -0
- package/dist/ir/validation/yield-main-expression-lowering.js.map +1 -0
- package/dist/ir/validation/yield-member-access-lowering.d.ts +21 -0
- package/dist/ir/validation/yield-member-access-lowering.d.ts.map +1 -0
- package/dist/ir/validation/yield-member-access-lowering.js +58 -0
- package/dist/ir/validation/yield-member-access-lowering.js.map +1 -0
- package/dist/ir/validation/yield-module-processing.d.ts +25 -0
- package/dist/ir/validation/yield-module-processing.d.ts.map +1 -0
- package/dist/ir/validation/yield-module-processing.js +180 -0
- package/dist/ir/validation/yield-module-processing.js.map +1 -0
- package/dist/ir/validation/yield-statement-loops.d.ts +51 -0
- package/dist/ir/validation/yield-statement-loops.d.ts.map +1 -0
- package/dist/ir/validation/yield-statement-loops.js +344 -0
- package/dist/ir/validation/yield-statement-loops.js.map +1 -0
- package/dist/ir/validation/yield-statement-lowering.d.ts +18 -0
- package/dist/ir/validation/yield-statement-lowering.d.ts.map +1 -0
- package/dist/ir/validation/yield-statement-lowering.js +48 -0
- package/dist/ir/validation/yield-statement-lowering.js.map +1 -0
- package/dist/ir/validation/yield-statement-simple.d.ts +33 -0
- package/dist/ir/validation/yield-statement-simple.d.ts.map +1 -0
- package/dist/ir/validation/yield-statement-simple.js +268 -0
- package/dist/ir/validation/yield-statement-simple.js.map +1 -0
- package/dist/program/binding-loader.d.ts.map +1 -1
- package/dist/program/binding-loader.js +1099 -6
- package/dist/program/binding-loader.js.map +1 -1
- package/dist/program/binding-payload-invariants.test.d.ts +2 -0
- package/dist/program/binding-payload-invariants.test.d.ts.map +1 -0
- package/dist/program/binding-payload-invariants.test.js +55 -0
- package/dist/program/binding-payload-invariants.test.js.map +1 -0
- package/dist/program/binding-registry-loading.d.ts +51 -0
- package/dist/program/binding-registry-loading.d.ts.map +1 -0
- package/dist/program/binding-registry-loading.js +816 -0
- package/dist/program/binding-registry-loading.js.map +1 -0
- package/dist/program/binding-registry-resolution-extension.d.ts +26 -0
- package/dist/program/binding-registry-resolution-extension.d.ts.map +1 -0
- package/dist/program/binding-registry-resolution-extension.js +161 -0
- package/dist/program/binding-registry-resolution-extension.js.map +1 -0
- package/dist/program/binding-registry-resolution-member.d.ts +46 -0
- package/dist/program/binding-registry-resolution-member.d.ts.map +1 -0
- package/dist/program/binding-registry-resolution-member.js +252 -0
- package/dist/program/binding-registry-resolution-member.js.map +1 -0
- package/dist/program/binding-registry-resolution.d.ts +13 -0
- package/dist/program/binding-registry-resolution.d.ts.map +1 -0
- package/dist/program/binding-registry-resolution.js +12 -0
- package/dist/program/binding-registry-resolution.js.map +1 -0
- package/dist/program/binding-registry.d.ts +34 -22
- package/dist/program/binding-registry.d.ts.map +1 -1
- package/dist/program/binding-registry.js +111 -562
- package/dist/program/binding-registry.js.map +1 -1
- package/dist/program/binding-types.d.ts +34 -3
- package/dist/program/binding-types.d.ts.map +1 -1
- package/dist/program/binding-types.js +82 -6
- package/dist/program/binding-types.js.map +1 -1
- package/dist/program/bindings-cases/dotnet-payload-boundaries.test.d.ts +2 -0
- package/dist/program/bindings-cases/dotnet-payload-boundaries.test.d.ts.map +1 -0
- package/dist/program/bindings-cases/dotnet-payload-boundaries.test.js +115 -0
- package/dist/program/bindings-cases/dotnet-payload-boundaries.test.js.map +1 -0
- package/dist/program/bindings-cases/hierarchical-and-type-semantics.test.d.ts +6 -0
- package/dist/program/bindings-cases/hierarchical-and-type-semantics.test.d.ts.map +1 -0
- package/dist/program/bindings-cases/hierarchical-and-type-semantics.test.js +573 -0
- package/dist/program/bindings-cases/hierarchical-and-type-semantics.test.js.map +1 -0
- package/dist/program/bindings-cases/load-bindings.test.d.ts +7 -0
- package/dist/program/bindings-cases/load-bindings.test.d.ts.map +1 -0
- package/dist/program/bindings-cases/load-bindings.test.js +545 -0
- package/dist/program/bindings-cases/load-bindings.test.js.map +1 -0
- package/dist/program/bindings-cases/registry-basics.test.d.ts +6 -0
- package/dist/program/bindings-cases/registry-basics.test.d.ts.map +1 -0
- package/dist/program/bindings-cases/registry-basics.test.js +201 -0
- package/dist/program/bindings-cases/registry-basics.test.js.map +1 -0
- package/dist/program/bindings-cases/registry-member-resolution.test.d.ts +8 -0
- package/dist/program/bindings-cases/registry-member-resolution.test.d.ts.map +1 -0
- package/dist/program/bindings-cases/registry-member-resolution.test.js +301 -0
- package/dist/program/bindings-cases/registry-member-resolution.test.js.map +1 -0
- package/dist/program/bindings.d.ts +2 -1
- package/dist/program/bindings.d.ts.map +1 -1
- package/dist/program/bindings.js +1 -0
- package/dist/program/bindings.js.map +1 -1
- package/dist/program/bindings.test.d.ts +12 -2
- package/dist/program/bindings.test.d.ts.map +1 -1
- package/dist/program/bindings.test.js +12 -989
- package/dist/program/bindings.test.js.map +1 -1
- package/dist/program/core-declarations.d.ts +16 -0
- package/dist/program/core-declarations.d.ts.map +1 -0
- package/dist/program/core-declarations.js +126 -0
- package/dist/program/core-declarations.js.map +1 -0
- package/dist/program/creation-cases/authoritative-type-roots.test.d.ts +6 -0
- package/dist/program/creation-cases/authoritative-type-roots.test.d.ts.map +1 -0
- package/dist/program/creation-cases/authoritative-type-roots.test.js +136 -0
- package/dist/program/creation-cases/authoritative-type-roots.test.js.map +1 -0
- package/dist/program/creation-cases/compiler-options.test.d.ts +5 -0
- package/dist/program/creation-cases/compiler-options.test.d.ts.map +1 -0
- package/dist/program/creation-cases/compiler-options.test.js +77 -0
- package/dist/program/creation-cases/compiler-options.test.js.map +1 -0
- package/dist/program/creation-cases/core-type-checking.test.d.ts +6 -0
- package/dist/program/creation-cases/core-type-checking.test.d.ts.map +1 -0
- package/dist/program/creation-cases/core-type-checking.test.js +66 -0
- package/dist/program/creation-cases/core-type-checking.test.js.map +1 -0
- package/dist/program/creation-cases/js-surface-globals.test.d.ts +6 -0
- package/dist/program/creation-cases/js-surface-globals.test.d.ts.map +1 -0
- package/dist/program/creation-cases/js-surface-globals.test.js +236 -0
- package/dist/program/creation-cases/js-surface-globals.test.js.map +1 -0
- package/dist/program/creation-cases/module-bindings.test.d.ts +2 -0
- package/dist/program/creation-cases/module-bindings.test.d.ts.map +1 -0
- package/dist/program/creation-cases/module-bindings.test.js +253 -0
- package/dist/program/creation-cases/module-bindings.test.js.map +1 -0
- package/dist/program/creation-cases/package-resolution.test.d.ts +6 -0
- package/dist/program/creation-cases/package-resolution.test.d.ts.map +1 -0
- package/dist/program/creation-cases/package-resolution.test.js +116 -0
- package/dist/program/creation-cases/package-resolution.test.js.map +1 -0
- package/dist/program/creation-cases/surface-isolation.test.d.ts +6 -0
- package/dist/program/creation-cases/surface-isolation.test.d.ts.map +1 -0
- package/dist/program/creation-cases/surface-isolation.test.js +196 -0
- package/dist/program/creation-cases/surface-isolation.test.js.map +1 -0
- package/dist/program/creation-cases/test-package-helpers.d.ts +6 -0
- package/dist/program/creation-cases/test-package-helpers.d.ts.map +1 -0
- package/dist/program/creation-cases/test-package-helpers.js +26 -0
- package/dist/program/creation-cases/test-package-helpers.js.map +1 -0
- package/dist/program/creation.d.ts +3 -14
- package/dist/program/creation.d.ts.map +1 -1
- package/dist/program/creation.js +3 -780
- package/dist/program/creation.js.map +1 -1
- package/dist/program/creation.test.d.ts +10 -2
- package/dist/program/creation.test.d.ts.map +1 -1
- package/dist/program/creation.test.js +10 -932
- package/dist/program/creation.test.js.map +1 -1
- package/dist/program/declaration-module-aliases.d.ts +13 -0
- package/dist/program/declaration-module-aliases.d.ts.map +1 -0
- package/dist/program/declaration-module-aliases.js +144 -0
- package/dist/program/declaration-module-aliases.js.map +1 -0
- package/dist/program/dependency-graph.d.ts +3 -1
- package/dist/program/dependency-graph.d.ts.map +1 -1
- package/dist/program/dependency-graph.js +211 -23
- package/dist/program/dependency-graph.js.map +1 -1
- package/dist/program/dependency-graph.test.js +307 -85
- package/dist/program/dependency-graph.test.js.map +1 -1
- package/dist/program/diagnostics.d.ts +1 -1
- package/dist/program/diagnostics.d.ts.map +1 -1
- package/dist/program/diagnostics.js +2 -48
- package/dist/program/diagnostics.js.map +1 -1
- package/dist/program/diagnostics.test.js +9 -24
- package/dist/program/diagnostics.test.js.map +1 -1
- package/dist/program/dotnet-binding-payload.d.ts +12 -0
- package/dist/program/dotnet-binding-payload.d.ts.map +1 -0
- package/dist/program/dotnet-binding-payload.js +71 -0
- package/dist/program/dotnet-binding-payload.js.map +1 -0
- package/dist/program/fixture-fast-coverage.test.d.ts +2 -0
- package/dist/program/fixture-fast-coverage.test.d.ts.map +1 -0
- package/dist/program/fixture-fast-coverage.test.js +225 -0
- package/dist/program/fixture-fast-coverage.test.js.map +1 -0
- package/dist/program/index.d.ts +1 -1
- package/dist/program/index.d.ts.map +1 -1
- package/dist/program/index.js +1 -1
- package/dist/program/index.js.map +1 -1
- package/dist/program/json-deserialize-overload-resolution.test.d.ts +2 -0
- package/dist/program/json-deserialize-overload-resolution.test.d.ts.map +1 -0
- package/dist/program/json-deserialize-overload-resolution.test.js +57 -0
- package/dist/program/json-deserialize-overload-resolution.test.js.map +1 -0
- package/dist/program/metadata.d.ts.map +1 -1
- package/dist/program/metadata.js +24 -8
- package/dist/program/metadata.js.map +1 -1
- package/dist/program/metadata.test.js +30 -82
- package/dist/program/metadata.test.js.map +1 -1
- package/dist/program/module-resolution.d.ts +29 -0
- package/dist/program/module-resolution.d.ts.map +1 -0
- package/dist/program/module-resolution.js +257 -0
- package/dist/program/module-resolution.js.map +1 -0
- package/dist/program/package-roots.d.ts +3 -1
- package/dist/program/package-roots.d.ts.map +1 -1
- package/dist/program/package-roots.js +159 -21
- package/dist/program/package-roots.js.map +1 -1
- package/dist/program/package-roots.test.js +81 -25
- package/dist/program/package-roots.test.js.map +1 -1
- package/dist/program/program-assembly.d.ts +12 -0
- package/dist/program/program-assembly.d.ts.map +1 -0
- package/dist/program/program-assembly.js +409 -0
- package/dist/program/program-assembly.js.map +1 -0
- package/dist/program/program-factory.d.ts +9 -0
- package/dist/program/program-factory.d.ts.map +1 -0
- package/dist/program/program-factory.js +9 -0
- package/dist/program/program-factory.js.map +1 -0
- package/dist/program/program-input-discovery.d.ts +19 -0
- package/dist/program/program-input-discovery.d.ts.map +1 -0
- package/dist/program/program-input-discovery.js +379 -0
- package/dist/program/program-input-discovery.js.map +1 -0
- package/dist/program/program-input-discovery.test.d.ts +2 -0
- package/dist/program/program-input-discovery.test.d.ts.map +1 -0
- package/dist/program/program-input-discovery.test.js +342 -0
- package/dist/program/program-input-discovery.test.js.map +1 -0
- package/dist/program/source-binding-imports.d.ts +7 -0
- package/dist/program/source-binding-imports.d.ts.map +1 -0
- package/dist/program/source-binding-imports.js +80 -0
- package/dist/program/source-binding-imports.js.map +1 -0
- package/dist/program/source-binding-imports.test.d.ts +2 -0
- package/dist/program/source-binding-imports.test.d.ts.map +1 -0
- package/dist/program/source-binding-imports.test.js +58 -0
- package/dist/program/source-binding-imports.test.js.map +1 -0
- package/dist/program/source-file-identity.d.ts +13 -0
- package/dist/program/source-file-identity.d.ts.map +1 -0
- package/dist/program/source-file-identity.js +127 -0
- package/dist/program/source-file-identity.js.map +1 -0
- package/dist/program/source-package-metadata.d.ts +14 -0
- package/dist/program/source-package-metadata.d.ts.map +1 -0
- package/dist/program/source-package-metadata.js +227 -0
- package/dist/program/source-package-metadata.js.map +1 -0
- package/dist/program/tsbindgen-instance-receiver-substitution.test.d.ts +2 -0
- package/dist/program/tsbindgen-instance-receiver-substitution.test.d.ts.map +1 -0
- package/dist/program/tsbindgen-instance-receiver-substitution.test.js +194 -0
- package/dist/program/tsbindgen-instance-receiver-substitution.test.js.map +1 -0
- package/dist/program/types.d.ts +3 -2
- package/dist/program/types.d.ts.map +1 -1
- package/dist/program/xunit-equal-overload-resolution.test.d.ts +2 -0
- package/dist/program/xunit-equal-overload-resolution.test.d.ts.map +1 -0
- package/dist/program/xunit-equal-overload-resolution.test.js +205 -0
- package/dist/program/xunit-equal-overload-resolution.test.js.map +1 -0
- package/dist/program.d.ts +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/resolver/clr-bindings-package-resolution.d.ts +28 -0
- package/dist/resolver/clr-bindings-package-resolution.d.ts.map +1 -0
- package/dist/resolver/clr-bindings-package-resolution.js +120 -0
- package/dist/resolver/clr-bindings-package-resolution.js.map +1 -0
- package/dist/resolver/clr-bindings-resolve-logic.d.ts +40 -0
- package/dist/resolver/clr-bindings-resolve-logic.d.ts.map +1 -0
- package/dist/resolver/clr-bindings-resolve-logic.js +192 -0
- package/dist/resolver/clr-bindings-resolve-logic.js.map +1 -0
- package/dist/resolver/clr-bindings-resolver.d.ts +9 -69
- package/dist/resolver/clr-bindings-resolver.d.ts.map +1 -1
- package/dist/resolver/clr-bindings-resolver.js +4 -436
- package/dist/resolver/clr-bindings-resolver.js.map +1 -1
- package/dist/resolver/dynamic-import.test.js +20 -11
- package/dist/resolver/dynamic-import.test.js.map +1 -1
- package/dist/resolver/import-resolution.d.ts +3 -0
- package/dist/resolver/import-resolution.d.ts.map +1 -1
- package/dist/resolver/import-resolution.js +120 -33
- package/dist/resolver/import-resolution.js.map +1 -1
- package/dist/resolver/source-package-resolution.d.ts +18 -0
- package/dist/resolver/source-package-resolution.d.ts.map +1 -1
- package/dist/resolver/source-package-resolution.js +141 -14
- package/dist/resolver/source-package-resolution.js.map +1 -1
- package/dist/resolver/source-package-resolution.test.js +27 -52
- package/dist/resolver/source-package-resolution.test.js.map +1 -1
- package/dist/resolver-cases/namespace-and-classname.test.d.ts +5 -0
- package/dist/resolver-cases/namespace-and-classname.test.d.ts.map +1 -0
- package/dist/resolver-cases/namespace-and-classname.test.js +32 -0
- package/dist/resolver-cases/namespace-and-classname.test.js.map +1 -0
- package/dist/resolver-cases/resolve-import.test.d.ts +5 -0
- package/dist/resolver-cases/resolve-import.test.d.ts.map +1 -0
- package/dist/resolver-cases/resolve-import.test.js +460 -0
- package/dist/resolver-cases/resolve-import.test.js.map +1 -0
- package/dist/resolver.test.d.ts +2 -4
- package/dist/resolver.test.d.ts.map +1 -1
- package/dist/resolver.test.js +2 -289
- package/dist/resolver.test.js.map +1 -1
- package/dist/surface/profiles.d.ts +1 -1
- package/dist/surface/profiles.d.ts.map +1 -1
- package/dist/surface/profiles.js +146 -53
- package/dist/surface/profiles.js.map +1 -1
- package/dist/surface/profiles.test.js +97 -108
- package/dist/surface/profiles.test.js.map +1 -1
- package/dist/testing/filesystem-fixtures.d.ts +7 -0
- package/dist/testing/filesystem-fixtures.d.ts.map +1 -0
- package/dist/testing/filesystem-fixtures.js +80 -0
- package/dist/testing/filesystem-fixtures.js.map +1 -0
- package/dist/types/diagnostic.d.ts +1 -1
- package/dist/types/diagnostic.d.ts.map +1 -1
- package/dist/types/diagnostic.js.map +1 -1
- package/dist/validation/contextual-type-analysis.d.ts +12 -0
- package/dist/validation/contextual-type-analysis.d.ts.map +1 -0
- package/dist/validation/contextual-type-analysis.js +11 -0
- package/dist/validation/contextual-type-analysis.js.map +1 -0
- package/dist/validation/contextual-type-checks.d.ts +35 -0
- package/dist/validation/contextual-type-checks.d.ts.map +1 -0
- package/dist/validation/contextual-type-checks.js +214 -0
- package/dist/validation/contextual-type-checks.js.map +1 -0
- package/dist/validation/exports.d.ts.map +1 -1
- package/dist/validation/exports.js +14 -15
- package/dist/validation/exports.js.map +1 -1
- package/dist/validation/features-cases/promise-chaining.test.d.ts +2 -0
- package/dist/validation/features-cases/promise-chaining.test.d.ts.map +1 -0
- package/dist/validation/features-cases/promise-chaining.test.js +113 -0
- package/dist/validation/features-cases/promise-chaining.test.js.map +1 -0
- package/dist/validation/features-cases/test-helpers.d.ts +11 -0
- package/dist/validation/features-cases/test-helpers.d.ts.map +1 -0
- package/dist/validation/features-cases/test-helpers.js +125 -0
- package/dist/validation/features-cases/test-helpers.js.map +1 -0
- package/dist/validation/features-cases/tsn2001-unsupported-syntax.test.d.ts +2 -0
- package/dist/validation/features-cases/tsn2001-unsupported-syntax.test.d.ts.map +1 -0
- package/dist/validation/features-cases/tsn2001-unsupported-syntax.test.js +158 -0
- package/dist/validation/features-cases/tsn2001-unsupported-syntax.test.js.map +1 -0
- package/dist/validation/features-cases/tsn5001-function-length.test.d.ts +2 -0
- package/dist/validation/features-cases/tsn5001-function-length.test.d.ts.map +1 -0
- package/dist/validation/features-cases/tsn5001-function-length.test.js +104 -0
- package/dist/validation/features-cases/tsn5001-function-length.test.js.map +1 -0
- package/dist/validation/features.d.ts.map +1 -1
- package/dist/validation/features.js +223 -0
- package/dist/validation/features.js.map +1 -1
- package/dist/validation/features.test.d.ts +3 -1
- package/dist/validation/features.test.d.ts.map +1 -1
- package/dist/validation/features.test.js +3 -386
- package/dist/validation/features.test.js.map +1 -1
- package/dist/validation/imports.d.ts.map +1 -1
- package/dist/validation/imports.js +37 -3
- package/dist/validation/imports.js.map +1 -1
- package/dist/validation/imports.test.js +45 -9
- package/dist/validation/imports.test.js.map +1 -1
- package/dist/validation/static-safety-arrow-rules.d.ts +11 -0
- package/dist/validation/static-safety-arrow-rules.d.ts.map +1 -0
- package/dist/validation/static-safety-arrow-rules.js +54 -0
- package/dist/validation/static-safety-arrow-rules.js.map +1 -0
- package/dist/validation/static-safety-dictionary-keys.d.ts +10 -0
- package/dist/validation/static-safety-dictionary-keys.d.ts.map +1 -0
- package/dist/validation/static-safety-dictionary-keys.js +32 -0
- package/dist/validation/static-safety-dictionary-keys.js.map +1 -0
- package/dist/validation/static-safety-rules.d.ts +27 -0
- package/dist/validation/static-safety-rules.d.ts.map +1 -0
- package/dist/validation/static-safety-rules.js +231 -0
- package/dist/validation/static-safety-rules.js.map +1 -0
- package/dist/validation/static-safety.d.ts +4 -7
- package/dist/validation/static-safety.d.ts.map +1 -1
- package/dist/validation/static-safety.js +3 -673
- package/dist/validation/static-safety.js.map +1 -1
- package/dist/validation/synthesis-eligibility.d.ts +31 -0
- package/dist/validation/synthesis-eligibility.d.ts.map +1 -0
- package/dist/validation/synthesis-eligibility.js +161 -0
- package/dist/validation/synthesis-eligibility.js.map +1 -0
- package/dist/validator-cases/any-and-object-literals.test.d.ts +10 -0
- package/dist/validator-cases/any-and-object-literals.test.d.ts.map +1 -0
- package/dist/validator-cases/any-and-object-literals.test.js +271 -0
- package/dist/validator-cases/any-and-object-literals.test.js.map +1 -0
- package/dist/validator-cases/generic-validation.test.d.ts +11 -0
- package/dist/validator-cases/generic-validation.test.d.ts.map +1 -0
- package/dist/validator-cases/generic-validation.test.js +282 -0
- package/dist/validator-cases/generic-validation.test.js.map +1 -0
- package/dist/validator-cases/helpers.d.ts +9 -0
- package/dist/validator-cases/helpers.d.ts.map +1 -0
- package/dist/validator-cases/helpers.js +46 -0
- package/dist/validator-cases/helpers.js.map +1 -0
- package/dist/validator-cases/parameters-and-dict-keys.test.d.ts +10 -0
- package/dist/validator-cases/parameters-and-dict-keys.test.d.ts.map +1 -0
- package/dist/validator-cases/parameters-and-dict-keys.test.js +280 -0
- package/dist/validator-cases/parameters-and-dict-keys.test.js.map +1 -0
- package/dist/validator-cases/utility-types.test.d.ts +12 -0
- package/dist/validator-cases/utility-types.test.d.ts.map +1 -0
- package/dist/validator-cases/utility-types.test.js +323 -0
- package/dist/validator-cases/utility-types.test.js.map +1 -0
- package/dist/validator-maximus-cases/array-and-literal-inference.test.d.ts +2 -0
- package/dist/validator-maximus-cases/array-and-literal-inference.test.d.ts.map +1 -0
- package/dist/validator-maximus-cases/array-and-literal-inference.test.js +221 -0
- package/dist/validator-maximus-cases/array-and-literal-inference.test.js.map +1 -0
- package/dist/validator-maximus-cases/deterministic-typing.test.d.ts +2 -0
- package/dist/validator-maximus-cases/deterministic-typing.test.d.ts.map +1 -0
- package/dist/validator-maximus-cases/deterministic-typing.test.js +432 -0
- package/dist/validator-maximus-cases/deterministic-typing.test.js.map +1 -0
- package/dist/validator-maximus-cases/dictionary-and-object-literal.test.d.ts +2 -0
- package/dist/validator-maximus-cases/dictionary-and-object-literal.test.d.ts.map +1 -0
- package/dist/validator-maximus-cases/dictionary-and-object-literal.test.js +273 -0
- package/dist/validator-maximus-cases/dictionary-and-object-literal.test.js.map +1 -0
- package/dist/validator-maximus-cases/feature-gating.test.d.ts +2 -0
- package/dist/validator-maximus-cases/feature-gating.test.d.ts.map +1 -0
- package/dist/validator-maximus-cases/feature-gating.test.js +181 -0
- package/dist/validator-maximus-cases/feature-gating.test.js.map +1 -0
- package/dist/validator-maximus-cases/generic-function-values.test.d.ts +2 -0
- package/dist/validator-maximus-cases/generic-function-values.test.d.ts.map +1 -0
- package/dist/validator-maximus-cases/generic-function-values.test.js +346 -0
- package/dist/validator-maximus-cases/generic-function-values.test.js.map +1 -0
- package/dist/validator-maximus-cases/helpers.d.ts +9 -0
- package/dist/validator-maximus-cases/helpers.d.ts.map +1 -0
- package/dist/validator-maximus-cases/helpers.js +113 -0
- package/dist/validator-maximus-cases/helpers.js.map +1 -0
- package/dist/validator-maximus-cases/type-syntax.test.d.ts +2 -0
- package/dist/validator-maximus-cases/type-syntax.test.d.ts.map +1 -0
- package/dist/validator-maximus-cases/type-syntax.test.js +157 -0
- package/dist/validator-maximus-cases/type-syntax.test.js.map +1 -0
- package/dist/validator.maximus.test.d.ts +6 -1
- package/dist/validator.maximus.test.d.ts.map +1 -1
- package/dist/validator.maximus.test.js +6 -1417
- package/dist/validator.maximus.test.js.map +1 -1
- package/dist/validator.test.d.ts +4 -10
- package/dist/validator.test.d.ts.map +1 -1
- package/dist/validator.test.js +4 -1086
- package/dist/validator.test.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,1976 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* - Non-generator function handling (no transformation)
|
|
10
|
-
*/
|
|
11
|
-
import { describe, it } from "mocha";
|
|
12
|
-
import { expect } from "chai";
|
|
13
|
-
import { runYieldLoweringPass } from "./yield-lowering-pass.js";
|
|
14
|
-
/**
|
|
15
|
-
* Assert value is not null/undefined and return it typed as non-null.
|
|
16
|
-
*/
|
|
17
|
-
const assertDefined = (value, msg) => {
|
|
18
|
-
if (value === null || value === undefined) {
|
|
19
|
-
throw new Error(msg ?? "Expected value to be defined");
|
|
20
|
-
}
|
|
21
|
-
return value;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Helper to create a minimal generator function module
|
|
25
|
-
*/
|
|
26
|
-
const createGeneratorModule = (body, options = {}) => ({
|
|
27
|
-
kind: "module",
|
|
28
|
-
filePath: "/src/test.ts",
|
|
29
|
-
namespace: "Test",
|
|
30
|
-
className: "test",
|
|
31
|
-
isStaticContainer: true,
|
|
32
|
-
imports: [],
|
|
33
|
-
body: [
|
|
34
|
-
{
|
|
35
|
-
kind: "functionDeclaration",
|
|
36
|
-
name: "testGen",
|
|
37
|
-
parameters: [],
|
|
38
|
-
returnType: options.returnType ?? {
|
|
39
|
-
kind: "referenceType",
|
|
40
|
-
name: "Generator",
|
|
41
|
-
typeArguments: [
|
|
42
|
-
{ kind: "primitiveType", name: "number" },
|
|
43
|
-
{ kind: "voidType" },
|
|
44
|
-
{ kind: "primitiveType", name: "number" },
|
|
45
|
-
],
|
|
46
|
-
},
|
|
47
|
-
body: { kind: "blockStatement", statements: body },
|
|
48
|
-
isAsync: false,
|
|
49
|
-
isGenerator: options.isGenerator ?? true,
|
|
50
|
-
isExported: true,
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
exports: [],
|
|
54
|
-
});
|
|
55
|
-
/**
|
|
56
|
-
* Helper to create a yield expression
|
|
57
|
-
*/
|
|
58
|
-
const createYield = (value, delegate = false) => ({
|
|
59
|
-
kind: "yield",
|
|
60
|
-
expression: value,
|
|
61
|
-
delegate,
|
|
62
|
-
});
|
|
63
|
-
/**
|
|
64
|
-
* Helper to extract the function body from a module
|
|
65
|
-
*/
|
|
66
|
-
const getGeneratorBody = (module) => {
|
|
67
|
-
const func = module.body[0];
|
|
68
|
-
if (func?.kind === "functionDeclaration") {
|
|
69
|
-
return func.body.statements;
|
|
70
|
-
}
|
|
71
|
-
return [];
|
|
72
|
-
};
|
|
73
|
-
const getTempNameFromSingleDeclarator = (stmt) => {
|
|
74
|
-
expect(stmt.kind).to.equal("variableDeclaration");
|
|
75
|
-
const decl = stmt
|
|
76
|
-
.declarations[0];
|
|
77
|
-
expect(decl?.name.kind).to.equal("identifierPattern");
|
|
78
|
-
return (decl?.name ?? {
|
|
79
|
-
name: "",
|
|
80
|
-
}).name;
|
|
81
|
-
};
|
|
82
|
-
describe("Yield Lowering Pass", () => {
|
|
83
|
-
describe("Basic Yield Transformation", () => {
|
|
84
|
-
it("should transform simple yield expr into yieldStatement", () => {
|
|
85
|
-
const module = createGeneratorModule([
|
|
86
|
-
{
|
|
87
|
-
kind: "expressionStatement",
|
|
88
|
-
expression: createYield({ kind: "literal", value: 42 }),
|
|
89
|
-
},
|
|
90
|
-
]);
|
|
91
|
-
const result = runYieldLoweringPass([module]);
|
|
92
|
-
expect(result.ok).to.be.true;
|
|
93
|
-
expect(result.diagnostics).to.have.length(0);
|
|
94
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
95
|
-
expect(body).to.have.length(1);
|
|
96
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
97
|
-
const yieldStmt = body[0];
|
|
98
|
-
expect(yieldStmt.delegate).to.be.false;
|
|
99
|
-
expect(yieldStmt.output?.kind).to.equal("literal");
|
|
100
|
-
expect(yieldStmt.receiveTarget).to.be.undefined;
|
|
101
|
-
});
|
|
102
|
-
it("should transform bare yield (no value)", () => {
|
|
103
|
-
const module = createGeneratorModule([
|
|
104
|
-
{
|
|
105
|
-
kind: "expressionStatement",
|
|
106
|
-
expression: createYield(),
|
|
107
|
-
},
|
|
108
|
-
]);
|
|
109
|
-
const result = runYieldLoweringPass([module]);
|
|
110
|
-
expect(result.ok).to.be.true;
|
|
111
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
112
|
-
const yieldStmt = body[0];
|
|
113
|
-
expect(yieldStmt.kind).to.equal("yieldStatement");
|
|
114
|
-
expect(yieldStmt.output).to.be.undefined;
|
|
115
|
-
});
|
|
116
|
-
it("should transform yield* delegation", () => {
|
|
117
|
-
const module = createGeneratorModule([
|
|
118
|
-
{
|
|
119
|
-
kind: "expressionStatement",
|
|
120
|
-
expression: createYield({ kind: "identifier", name: "otherGen" }, true),
|
|
121
|
-
},
|
|
122
|
-
]);
|
|
123
|
-
const result = runYieldLoweringPass([module]);
|
|
124
|
-
expect(result.ok).to.be.true;
|
|
125
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
126
|
-
const yieldStmt = body[0];
|
|
127
|
-
expect(yieldStmt.delegate).to.be.true;
|
|
128
|
-
expect(yieldStmt.output?.kind).to.equal("identifier");
|
|
129
|
-
});
|
|
130
|
-
});
|
|
131
|
-
describe("Bidirectional Pattern: const x = yield value", () => {
|
|
132
|
-
it("should transform variable declaration with yield initializer", () => {
|
|
133
|
-
const module = createGeneratorModule([
|
|
134
|
-
{
|
|
135
|
-
kind: "variableDeclaration",
|
|
136
|
-
declarationKind: "const",
|
|
137
|
-
isExported: false,
|
|
138
|
-
declarations: [
|
|
139
|
-
{
|
|
140
|
-
kind: "variableDeclarator",
|
|
141
|
-
name: { kind: "identifierPattern", name: "received" },
|
|
142
|
-
type: { kind: "primitiveType", name: "number" },
|
|
143
|
-
initializer: createYield({ kind: "literal", value: 10 }),
|
|
144
|
-
},
|
|
145
|
-
],
|
|
146
|
-
},
|
|
147
|
-
]);
|
|
148
|
-
const result = runYieldLoweringPass([module]);
|
|
149
|
-
expect(result.ok).to.be.true;
|
|
150
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
151
|
-
expect(body).to.have.length(1);
|
|
152
|
-
const yieldStmt = body[0];
|
|
153
|
-
expect(yieldStmt.kind).to.equal("yieldStatement");
|
|
154
|
-
expect(yieldStmt.receiveTarget?.kind).to.equal("identifierPattern");
|
|
155
|
-
expect(yieldStmt.receiveTarget.name).to.equal("received");
|
|
156
|
-
expect(yieldStmt.output?.kind).to.equal("literal");
|
|
157
|
-
});
|
|
158
|
-
it("should handle multiple declarations with yield", () => {
|
|
159
|
-
const module = createGeneratorModule([
|
|
160
|
-
{
|
|
161
|
-
kind: "variableDeclaration",
|
|
162
|
-
declarationKind: "const",
|
|
163
|
-
isExported: false,
|
|
164
|
-
declarations: [
|
|
165
|
-
{
|
|
166
|
-
kind: "variableDeclarator",
|
|
167
|
-
name: { kind: "identifierPattern", name: "a" },
|
|
168
|
-
type: { kind: "primitiveType", name: "number" },
|
|
169
|
-
initializer: createYield({ kind: "literal", value: 1 }),
|
|
170
|
-
},
|
|
171
|
-
{
|
|
172
|
-
kind: "variableDeclarator",
|
|
173
|
-
name: { kind: "identifierPattern", name: "b" },
|
|
174
|
-
type: { kind: "primitiveType", name: "number" },
|
|
175
|
-
initializer: createYield({ kind: "literal", value: 2 }),
|
|
176
|
-
},
|
|
177
|
-
],
|
|
178
|
-
},
|
|
179
|
-
]);
|
|
180
|
-
const result = runYieldLoweringPass([module]);
|
|
181
|
-
expect(result.ok).to.be.true;
|
|
182
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
183
|
-
// Should produce two yieldStatements
|
|
184
|
-
expect(body).to.have.length(2);
|
|
185
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
186
|
-
expect(body[1]?.kind).to.equal("yieldStatement");
|
|
187
|
-
});
|
|
188
|
-
});
|
|
189
|
-
describe("Bidirectional Pattern: x = yield value", () => {
|
|
190
|
-
it("should transform assignment with yield on right side", () => {
|
|
191
|
-
const module = createGeneratorModule([
|
|
192
|
-
{
|
|
193
|
-
kind: "expressionStatement",
|
|
194
|
-
expression: {
|
|
195
|
-
kind: "assignment",
|
|
196
|
-
operator: "=",
|
|
197
|
-
left: { kind: "identifierPattern", name: "x" },
|
|
198
|
-
right: createYield({ kind: "literal", value: 5 }),
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
]);
|
|
202
|
-
const result = runYieldLoweringPass([module]);
|
|
203
|
-
expect(result.ok).to.be.true;
|
|
204
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
205
|
-
const yieldStmt = body[0];
|
|
206
|
-
expect(yieldStmt.kind).to.equal("yieldStatement");
|
|
207
|
-
expect(yieldStmt.receiveTarget?.kind).to.equal("identifierPattern");
|
|
208
|
-
});
|
|
209
|
-
it("should transform compound assignment with yield", () => {
|
|
210
|
-
const module = createGeneratorModule([
|
|
211
|
-
{
|
|
212
|
-
kind: "expressionStatement",
|
|
213
|
-
expression: {
|
|
214
|
-
kind: "assignment",
|
|
215
|
-
operator: "+=",
|
|
216
|
-
left: { kind: "identifierPattern", name: "x" },
|
|
217
|
-
right: createYield({ kind: "literal", value: 5 }),
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
]);
|
|
221
|
-
const result = runYieldLoweringPass([module]);
|
|
222
|
-
expect(result.ok).to.be.true;
|
|
223
|
-
expect(result.diagnostics).to.have.length(0);
|
|
224
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
225
|
-
expect(body).to.have.length(2);
|
|
226
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
227
|
-
expect(body[1]?.kind).to.equal("expressionStatement");
|
|
228
|
-
const assignmentStmt = body[1];
|
|
229
|
-
expect(assignmentStmt.expression.kind).to.equal("assignment");
|
|
230
|
-
if (assignmentStmt.expression.kind === "assignment") {
|
|
231
|
-
expect(assignmentStmt.expression.operator).to.equal("+=");
|
|
232
|
-
expect(assignmentStmt.expression.right.kind).to.equal("identifier");
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
it("should transform compound assignment to member target with yield", () => {
|
|
236
|
-
const module = createGeneratorModule([
|
|
237
|
-
{
|
|
238
|
-
kind: "expressionStatement",
|
|
239
|
-
expression: {
|
|
240
|
-
kind: "assignment",
|
|
241
|
-
operator: "+=",
|
|
242
|
-
left: {
|
|
243
|
-
kind: "memberAccess",
|
|
244
|
-
object: { kind: "identifier", name: "obj" },
|
|
245
|
-
property: "count",
|
|
246
|
-
isOptional: false,
|
|
247
|
-
isComputed: false,
|
|
248
|
-
},
|
|
249
|
-
right: createYield({ kind: "literal", value: 5 }),
|
|
250
|
-
},
|
|
251
|
-
},
|
|
252
|
-
]);
|
|
253
|
-
const result = runYieldLoweringPass([module]);
|
|
254
|
-
expect(result.ok).to.be.true;
|
|
255
|
-
expect(result.diagnostics).to.have.length(0);
|
|
256
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
257
|
-
expect(body).to.have.length(3);
|
|
258
|
-
expect(body[0]?.kind).to.equal("variableDeclaration");
|
|
259
|
-
expect(body[1]?.kind).to.equal("yieldStatement");
|
|
260
|
-
expect(body[2]?.kind).to.equal("expressionStatement");
|
|
261
|
-
const assignmentStmt = body[2];
|
|
262
|
-
expect(assignmentStmt.expression.kind).to.equal("assignment");
|
|
263
|
-
if (assignmentStmt.expression.kind === "assignment") {
|
|
264
|
-
expect(assignmentStmt.expression.left.kind).to.equal("memberAccess");
|
|
265
|
-
if (assignmentStmt.expression.left.kind === "memberAccess") {
|
|
266
|
-
expect(assignmentStmt.expression.left.object.kind).to.equal("identifier");
|
|
267
|
-
expect(assignmentStmt.expression.left.property).to.equal("count");
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
it("should transform compound assignment to computed member target with yield", () => {
|
|
272
|
-
const module = createGeneratorModule([
|
|
273
|
-
{
|
|
274
|
-
kind: "expressionStatement",
|
|
275
|
-
expression: {
|
|
276
|
-
kind: "assignment",
|
|
277
|
-
operator: "+=",
|
|
278
|
-
left: {
|
|
279
|
-
kind: "memberAccess",
|
|
280
|
-
object: { kind: "identifier", name: "obj" },
|
|
281
|
-
property: { kind: "identifier", name: "key" },
|
|
282
|
-
isOptional: false,
|
|
283
|
-
isComputed: true,
|
|
284
|
-
},
|
|
285
|
-
right: createYield({ kind: "literal", value: 5 }),
|
|
286
|
-
},
|
|
287
|
-
},
|
|
288
|
-
]);
|
|
289
|
-
const result = runYieldLoweringPass([module]);
|
|
290
|
-
expect(result.ok).to.be.true;
|
|
291
|
-
expect(result.diagnostics).to.have.length(0);
|
|
292
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
293
|
-
expect(body).to.have.length(4);
|
|
294
|
-
expect(body[0]?.kind).to.equal("variableDeclaration");
|
|
295
|
-
expect(body[1]?.kind).to.equal("variableDeclaration");
|
|
296
|
-
expect(body[2]?.kind).to.equal("yieldStatement");
|
|
297
|
-
expect(body[3]?.kind).to.equal("expressionStatement");
|
|
298
|
-
});
|
|
299
|
-
it("should transform compound assignment when target evaluation contains yield", () => {
|
|
300
|
-
const module = createGeneratorModule([
|
|
301
|
-
{
|
|
302
|
-
kind: "expressionStatement",
|
|
303
|
-
expression: {
|
|
304
|
-
kind: "assignment",
|
|
305
|
-
operator: "+=",
|
|
306
|
-
left: {
|
|
307
|
-
kind: "memberAccess",
|
|
308
|
-
object: createYield({ kind: "identifier", name: "obj" }),
|
|
309
|
-
property: "count",
|
|
310
|
-
isOptional: false,
|
|
311
|
-
isComputed: false,
|
|
312
|
-
},
|
|
313
|
-
right: createYield({ kind: "literal", value: 5 }),
|
|
314
|
-
},
|
|
315
|
-
},
|
|
316
|
-
]);
|
|
317
|
-
const result = runYieldLoweringPass([module]);
|
|
318
|
-
expect(result.ok).to.be.true;
|
|
319
|
-
expect(result.diagnostics).to.have.length(0);
|
|
320
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
321
|
-
expect(body).to.have.length(4);
|
|
322
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
323
|
-
expect(body[1]?.kind).to.equal("variableDeclaration");
|
|
324
|
-
expect(body[2]?.kind).to.equal("yieldStatement");
|
|
325
|
-
expect(body[3]?.kind).to.equal("expressionStatement");
|
|
326
|
-
});
|
|
327
|
-
it("should transform compound assignment when computed property contains yield", () => {
|
|
328
|
-
const module = createGeneratorModule([
|
|
329
|
-
{
|
|
330
|
-
kind: "expressionStatement",
|
|
331
|
-
expression: {
|
|
332
|
-
kind: "assignment",
|
|
333
|
-
operator: "+=",
|
|
334
|
-
left: {
|
|
335
|
-
kind: "memberAccess",
|
|
336
|
-
object: { kind: "identifier", name: "obj" },
|
|
337
|
-
property: createYield({ kind: "identifier", name: "key" }),
|
|
338
|
-
isOptional: false,
|
|
339
|
-
isComputed: true,
|
|
340
|
-
},
|
|
341
|
-
right: createYield({ kind: "literal", value: 5 }),
|
|
342
|
-
},
|
|
343
|
-
},
|
|
344
|
-
]);
|
|
345
|
-
const result = runYieldLoweringPass([module]);
|
|
346
|
-
expect(result.ok).to.be.true;
|
|
347
|
-
expect(result.diagnostics).to.have.length(0);
|
|
348
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
349
|
-
expect(body).to.have.length(5);
|
|
350
|
-
expect(body[0]?.kind).to.equal("variableDeclaration");
|
|
351
|
-
expect(body[1]?.kind).to.equal("yieldStatement");
|
|
352
|
-
expect(body[2]?.kind).to.equal("variableDeclaration");
|
|
353
|
-
expect(body[3]?.kind).to.equal("yieldStatement");
|
|
354
|
-
expect(body[4]?.kind).to.equal("expressionStatement");
|
|
355
|
-
});
|
|
356
|
-
it("should transform assignment with identifier expression target", () => {
|
|
357
|
-
const module = createGeneratorModule([
|
|
358
|
-
{
|
|
359
|
-
kind: "expressionStatement",
|
|
360
|
-
expression: {
|
|
361
|
-
kind: "assignment",
|
|
362
|
-
operator: "=",
|
|
363
|
-
left: { kind: "identifier", name: "x" },
|
|
364
|
-
right: createYield({ kind: "literal", value: 5 }),
|
|
365
|
-
},
|
|
366
|
-
},
|
|
367
|
-
]);
|
|
368
|
-
const result = runYieldLoweringPass([module]);
|
|
369
|
-
expect(result.ok).to.be.true;
|
|
370
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
371
|
-
const yieldStmt = body[0];
|
|
372
|
-
expect(yieldStmt.kind).to.equal("yieldStatement");
|
|
373
|
-
expect(yieldStmt.receiveTarget?.kind).to.equal("identifierPattern");
|
|
374
|
-
expect(yieldStmt.receiveTarget.name).to.equal("x");
|
|
375
|
-
});
|
|
376
|
-
it("should transform assignment to member target with yield", () => {
|
|
377
|
-
const module = createGeneratorModule([
|
|
378
|
-
{
|
|
379
|
-
kind: "expressionStatement",
|
|
380
|
-
expression: {
|
|
381
|
-
kind: "assignment",
|
|
382
|
-
operator: "=",
|
|
383
|
-
left: {
|
|
384
|
-
kind: "memberAccess",
|
|
385
|
-
object: { kind: "identifier", name: "obj" },
|
|
386
|
-
property: "count",
|
|
387
|
-
isOptional: false,
|
|
388
|
-
isComputed: false,
|
|
389
|
-
},
|
|
390
|
-
right: createYield({ kind: "literal", value: 5 }),
|
|
391
|
-
},
|
|
392
|
-
},
|
|
393
|
-
]);
|
|
394
|
-
const result = runYieldLoweringPass([module]);
|
|
395
|
-
expect(result.ok).to.be.true;
|
|
396
|
-
expect(result.diagnostics).to.have.length(0);
|
|
397
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
398
|
-
expect(body).to.have.length(3);
|
|
399
|
-
expect(body[0]?.kind).to.equal("variableDeclaration");
|
|
400
|
-
expect(body[1]?.kind).to.equal("yieldStatement");
|
|
401
|
-
expect(body[2]?.kind).to.equal("expressionStatement");
|
|
402
|
-
});
|
|
403
|
-
it("should transform assignment to computed member target with yield", () => {
|
|
404
|
-
const module = createGeneratorModule([
|
|
405
|
-
{
|
|
406
|
-
kind: "expressionStatement",
|
|
407
|
-
expression: {
|
|
408
|
-
kind: "assignment",
|
|
409
|
-
operator: "=",
|
|
410
|
-
left: {
|
|
411
|
-
kind: "memberAccess",
|
|
412
|
-
object: { kind: "identifier", name: "obj" },
|
|
413
|
-
property: { kind: "identifier", name: "key" },
|
|
414
|
-
isOptional: false,
|
|
415
|
-
isComputed: true,
|
|
416
|
-
},
|
|
417
|
-
right: createYield({ kind: "literal", value: 5 }),
|
|
418
|
-
},
|
|
419
|
-
},
|
|
420
|
-
]);
|
|
421
|
-
const result = runYieldLoweringPass([module]);
|
|
422
|
-
expect(result.ok).to.be.true;
|
|
423
|
-
expect(result.diagnostics).to.have.length(0);
|
|
424
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
425
|
-
expect(body).to.have.length(4);
|
|
426
|
-
expect(body[0]?.kind).to.equal("variableDeclaration");
|
|
427
|
-
expect(body[1]?.kind).to.equal("variableDeclaration");
|
|
428
|
-
expect(body[2]?.kind).to.equal("yieldStatement");
|
|
429
|
-
expect(body[3]?.kind).to.equal("expressionStatement");
|
|
430
|
-
});
|
|
431
|
-
it("should transform assignment when target object contains yield", () => {
|
|
432
|
-
const module = createGeneratorModule([
|
|
433
|
-
{
|
|
434
|
-
kind: "expressionStatement",
|
|
435
|
-
expression: {
|
|
436
|
-
kind: "assignment",
|
|
437
|
-
operator: "=",
|
|
438
|
-
left: {
|
|
439
|
-
kind: "memberAccess",
|
|
440
|
-
object: createYield({ kind: "identifier", name: "obj" }),
|
|
441
|
-
property: "count",
|
|
442
|
-
isOptional: false,
|
|
443
|
-
isComputed: false,
|
|
444
|
-
},
|
|
445
|
-
right: createYield({ kind: "literal", value: 5 }),
|
|
446
|
-
},
|
|
447
|
-
},
|
|
448
|
-
]);
|
|
449
|
-
const result = runYieldLoweringPass([module]);
|
|
450
|
-
expect(result.ok).to.be.true;
|
|
451
|
-
expect(result.diagnostics).to.have.length(0);
|
|
452
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
453
|
-
expect(body).to.have.length(4);
|
|
454
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
455
|
-
expect(body[1]?.kind).to.equal("variableDeclaration");
|
|
456
|
-
expect(body[2]?.kind).to.equal("yieldStatement");
|
|
457
|
-
expect(body[3]?.kind).to.equal("expressionStatement");
|
|
458
|
-
});
|
|
459
|
-
it("should transform assignment when computed property contains yield", () => {
|
|
460
|
-
const module = createGeneratorModule([
|
|
461
|
-
{
|
|
462
|
-
kind: "expressionStatement",
|
|
463
|
-
expression: {
|
|
464
|
-
kind: "assignment",
|
|
465
|
-
operator: "=",
|
|
466
|
-
left: {
|
|
467
|
-
kind: "memberAccess",
|
|
468
|
-
object: { kind: "identifier", name: "obj" },
|
|
469
|
-
property: createYield({ kind: "identifier", name: "key" }),
|
|
470
|
-
isOptional: false,
|
|
471
|
-
isComputed: true,
|
|
472
|
-
},
|
|
473
|
-
right: createYield({ kind: "literal", value: 5 }),
|
|
474
|
-
},
|
|
475
|
-
},
|
|
476
|
-
]);
|
|
477
|
-
const result = runYieldLoweringPass([module]);
|
|
478
|
-
expect(result.ok).to.be.true;
|
|
479
|
-
expect(result.diagnostics).to.have.length(0);
|
|
480
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
481
|
-
expect(body).to.have.length(5);
|
|
482
|
-
expect(body[0]?.kind).to.equal("variableDeclaration");
|
|
483
|
-
expect(body[1]?.kind).to.equal("yieldStatement");
|
|
484
|
-
expect(body[2]?.kind).to.equal("variableDeclaration");
|
|
485
|
-
expect(body[3]?.kind).to.equal("yieldStatement");
|
|
486
|
-
expect(body[4]?.kind).to.equal("expressionStatement");
|
|
487
|
-
});
|
|
488
|
-
it("should transform assignment when target object and right expression both contain yield", () => {
|
|
489
|
-
const module = createGeneratorModule([
|
|
490
|
-
{
|
|
491
|
-
kind: "expressionStatement",
|
|
492
|
-
expression: {
|
|
493
|
-
kind: "assignment",
|
|
494
|
-
operator: "=",
|
|
495
|
-
left: {
|
|
496
|
-
kind: "memberAccess",
|
|
497
|
-
object: createYield({ kind: "identifier", name: "obj" }),
|
|
498
|
-
property: "count",
|
|
499
|
-
isOptional: false,
|
|
500
|
-
isComputed: false,
|
|
501
|
-
},
|
|
502
|
-
right: {
|
|
503
|
-
kind: "binary",
|
|
504
|
-
operator: "+",
|
|
505
|
-
left: createYield({ kind: "literal", value: 5 }),
|
|
506
|
-
right: { kind: "literal", value: 1 },
|
|
507
|
-
},
|
|
508
|
-
},
|
|
509
|
-
},
|
|
510
|
-
]);
|
|
511
|
-
const result = runYieldLoweringPass([module]);
|
|
512
|
-
expect(result.ok).to.be.true;
|
|
513
|
-
expect(result.diagnostics).to.have.length(0);
|
|
514
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
515
|
-
expect(body).to.have.length(4);
|
|
516
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
517
|
-
expect(body[1]?.kind).to.equal("variableDeclaration");
|
|
518
|
-
expect(body[2]?.kind).to.equal("yieldStatement");
|
|
519
|
-
expect(body[3]?.kind).to.equal("expressionStatement");
|
|
520
|
-
});
|
|
521
|
-
it("should transform assignment when computed property and right expression both contain yield", () => {
|
|
522
|
-
const module = createGeneratorModule([
|
|
523
|
-
{
|
|
524
|
-
kind: "expressionStatement",
|
|
525
|
-
expression: {
|
|
526
|
-
kind: "assignment",
|
|
527
|
-
operator: "=",
|
|
528
|
-
left: {
|
|
529
|
-
kind: "memberAccess",
|
|
530
|
-
object: { kind: "identifier", name: "obj" },
|
|
531
|
-
property: createYield({ kind: "identifier", name: "key" }),
|
|
532
|
-
isOptional: false,
|
|
533
|
-
isComputed: true,
|
|
534
|
-
},
|
|
535
|
-
right: {
|
|
536
|
-
kind: "binary",
|
|
537
|
-
operator: "+",
|
|
538
|
-
left: createYield({ kind: "literal", value: 5 }),
|
|
539
|
-
right: { kind: "literal", value: 1 },
|
|
540
|
-
},
|
|
541
|
-
},
|
|
542
|
-
},
|
|
543
|
-
]);
|
|
544
|
-
const result = runYieldLoweringPass([module]);
|
|
545
|
-
expect(result.ok).to.be.true;
|
|
546
|
-
expect(result.diagnostics).to.have.length(0);
|
|
547
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
548
|
-
expect(body).to.have.length(5);
|
|
549
|
-
expect(body[0]?.kind).to.equal("variableDeclaration");
|
|
550
|
-
expect(body[1]?.kind).to.equal("yieldStatement");
|
|
551
|
-
expect(body[2]?.kind).to.equal("variableDeclaration");
|
|
552
|
-
expect(body[3]?.kind).to.equal("yieldStatement");
|
|
553
|
-
expect(body[4]?.kind).to.equal("expressionStatement");
|
|
554
|
-
});
|
|
555
|
-
});
|
|
556
|
-
describe("Destructuring Patterns", () => {
|
|
557
|
-
it("should transform array destructuring with yield", () => {
|
|
558
|
-
const module = createGeneratorModule([
|
|
559
|
-
{
|
|
560
|
-
kind: "variableDeclaration",
|
|
561
|
-
declarationKind: "const",
|
|
562
|
-
isExported: false,
|
|
563
|
-
declarations: [
|
|
564
|
-
{
|
|
565
|
-
kind: "variableDeclarator",
|
|
566
|
-
name: {
|
|
567
|
-
kind: "arrayPattern",
|
|
568
|
-
elements: [
|
|
569
|
-
{ pattern: { kind: "identifierPattern", name: "a" } },
|
|
570
|
-
{ pattern: { kind: "identifierPattern", name: "b" } },
|
|
571
|
-
],
|
|
572
|
-
},
|
|
573
|
-
initializer: createYield({ kind: "literal", value: null }),
|
|
574
|
-
},
|
|
575
|
-
],
|
|
576
|
-
},
|
|
577
|
-
]);
|
|
578
|
-
const result = runYieldLoweringPass([module]);
|
|
579
|
-
expect(result.ok).to.be.true;
|
|
580
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
581
|
-
const yieldStmt = body[0];
|
|
582
|
-
expect(yieldStmt.receiveTarget?.kind).to.equal("arrayPattern");
|
|
583
|
-
});
|
|
584
|
-
it("should transform object destructuring with yield", () => {
|
|
585
|
-
const module = createGeneratorModule([
|
|
586
|
-
{
|
|
587
|
-
kind: "variableDeclaration",
|
|
588
|
-
declarationKind: "const",
|
|
589
|
-
isExported: false,
|
|
590
|
-
declarations: [
|
|
591
|
-
{
|
|
592
|
-
kind: "variableDeclarator",
|
|
593
|
-
name: {
|
|
594
|
-
kind: "objectPattern",
|
|
595
|
-
properties: [
|
|
596
|
-
{
|
|
597
|
-
kind: "property",
|
|
598
|
-
key: "x",
|
|
599
|
-
value: { kind: "identifierPattern", name: "x" },
|
|
600
|
-
shorthand: true,
|
|
601
|
-
},
|
|
602
|
-
],
|
|
603
|
-
},
|
|
604
|
-
initializer: createYield({ kind: "literal", value: null }),
|
|
605
|
-
},
|
|
606
|
-
],
|
|
607
|
-
},
|
|
608
|
-
]);
|
|
609
|
-
const result = runYieldLoweringPass([module]);
|
|
610
|
-
expect(result.ok).to.be.true;
|
|
611
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
612
|
-
const yieldStmt = body[0];
|
|
613
|
-
expect(yieldStmt.receiveTarget?.kind).to.equal("objectPattern");
|
|
614
|
-
});
|
|
615
|
-
});
|
|
616
|
-
describe("Unsupported Patterns (TSN6101)", () => {
|
|
617
|
-
it("should lower yield inside member-access assignment target chains", () => {
|
|
618
|
-
const module = createGeneratorModule([
|
|
619
|
-
{
|
|
620
|
-
kind: "expressionStatement",
|
|
621
|
-
expression: {
|
|
622
|
-
kind: "assignment",
|
|
623
|
-
operator: "=",
|
|
624
|
-
left: {
|
|
625
|
-
kind: "memberAccess",
|
|
626
|
-
object: {
|
|
627
|
-
kind: "assignment",
|
|
628
|
-
operator: "=",
|
|
629
|
-
left: {
|
|
630
|
-
kind: "memberAccess",
|
|
631
|
-
object: createYield({ kind: "identifier", name: "tmpObj" }),
|
|
632
|
-
property: "inner",
|
|
633
|
-
isOptional: false,
|
|
634
|
-
isComputed: false,
|
|
635
|
-
},
|
|
636
|
-
right: { kind: "literal", value: 1 },
|
|
637
|
-
},
|
|
638
|
-
property: "count",
|
|
639
|
-
isOptional: false,
|
|
640
|
-
isComputed: false,
|
|
641
|
-
},
|
|
642
|
-
right: { kind: "literal", value: 2 },
|
|
643
|
-
},
|
|
644
|
-
},
|
|
645
|
-
]);
|
|
646
|
-
const result = runYieldLoweringPass([module]);
|
|
647
|
-
expect(result.ok).to.be.true;
|
|
648
|
-
expect(result.diagnostics).to.have.length(0);
|
|
649
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
650
|
-
expect(body).to.have.length(3);
|
|
651
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
652
|
-
expect(body[1]?.kind).to.equal("variableDeclaration");
|
|
653
|
-
expect(body[2]?.kind).to.equal("expressionStatement");
|
|
654
|
-
const finalExpr = body[2].expression;
|
|
655
|
-
expect(finalExpr.kind).to.equal("assignment");
|
|
656
|
-
if (finalExpr.kind === "assignment") {
|
|
657
|
-
expect(finalExpr.left.kind).to.equal("memberAccess");
|
|
658
|
-
}
|
|
659
|
-
});
|
|
660
|
-
it("should emit TSN6101 when yield appears in a non-lowerable assignment target", () => {
|
|
661
|
-
const module = createGeneratorModule([
|
|
662
|
-
{
|
|
663
|
-
kind: "expressionStatement",
|
|
664
|
-
expression: {
|
|
665
|
-
kind: "assignment",
|
|
666
|
-
operator: "=",
|
|
667
|
-
left: {
|
|
668
|
-
kind: "binary",
|
|
669
|
-
operator: "+",
|
|
670
|
-
left: createYield({ kind: "identifier", name: "lhs" }),
|
|
671
|
-
right: { kind: "literal", value: 1 },
|
|
672
|
-
},
|
|
673
|
-
right: { kind: "literal", value: 2 },
|
|
674
|
-
},
|
|
675
|
-
},
|
|
676
|
-
]);
|
|
677
|
-
const result = runYieldLoweringPass([module]);
|
|
678
|
-
expect(result.ok).to.be.false;
|
|
679
|
-
expect(result.diagnostics.length).to.be.greaterThan(0);
|
|
680
|
-
expect(result.diagnostics[0]?.code).to.equal("TSN6101");
|
|
681
|
-
});
|
|
682
|
-
it("should emit TSN6101 when yield appears in switch case test expression", () => {
|
|
683
|
-
const module = createGeneratorModule([
|
|
684
|
-
{
|
|
685
|
-
kind: "switchStatement",
|
|
686
|
-
expression: { kind: "identifier", name: "value" },
|
|
687
|
-
cases: [
|
|
688
|
-
{
|
|
689
|
-
kind: "switchCase",
|
|
690
|
-
test: createYield({ kind: "literal", value: 1 }),
|
|
691
|
-
statements: [{ kind: "breakStatement" }],
|
|
692
|
-
},
|
|
693
|
-
],
|
|
694
|
-
},
|
|
695
|
-
]);
|
|
696
|
-
const result = runYieldLoweringPass([module]);
|
|
697
|
-
expect(result.ok).to.be.false;
|
|
698
|
-
expect(result.diagnostics.length).to.be.greaterThan(0);
|
|
699
|
-
expect(result.diagnostics.some((d) => d.code === "TSN6101")).to.equal(true);
|
|
700
|
-
});
|
|
701
|
-
it("should transform yield in call argument", () => {
|
|
702
|
-
const module = createGeneratorModule([
|
|
703
|
-
{
|
|
704
|
-
kind: "expressionStatement",
|
|
705
|
-
expression: {
|
|
706
|
-
kind: "call",
|
|
707
|
-
callee: { kind: "identifier", name: "foo" },
|
|
708
|
-
arguments: [createYield({ kind: "literal", value: 1 })],
|
|
709
|
-
isOptional: false,
|
|
710
|
-
},
|
|
711
|
-
},
|
|
712
|
-
]);
|
|
713
|
-
const result = runYieldLoweringPass([module]);
|
|
714
|
-
expect(result.ok).to.be.true;
|
|
715
|
-
expect(result.diagnostics).to.have.length(0);
|
|
716
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
717
|
-
expect(body).to.have.length(2);
|
|
718
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
719
|
-
expect(body[1]?.kind).to.equal("expressionStatement");
|
|
720
|
-
});
|
|
721
|
-
it("should transform nested yield in initializer", () => {
|
|
722
|
-
const module = createGeneratorModule([
|
|
723
|
-
{
|
|
724
|
-
kind: "variableDeclaration",
|
|
725
|
-
declarationKind: "const",
|
|
726
|
-
isExported: false,
|
|
727
|
-
declarations: [
|
|
728
|
-
{
|
|
729
|
-
kind: "variableDeclarator",
|
|
730
|
-
name: { kind: "identifierPattern", name: "x" },
|
|
731
|
-
type: { kind: "primitiveType", name: "number" },
|
|
732
|
-
initializer: {
|
|
733
|
-
kind: "binary",
|
|
734
|
-
operator: "+",
|
|
735
|
-
left: createYield({ kind: "literal", value: 1 }),
|
|
736
|
-
right: { kind: "literal", value: 2 },
|
|
737
|
-
},
|
|
738
|
-
},
|
|
739
|
-
],
|
|
740
|
-
},
|
|
741
|
-
]);
|
|
742
|
-
const result = runYieldLoweringPass([module]);
|
|
743
|
-
expect(result.ok).to.be.true;
|
|
744
|
-
expect(result.diagnostics).to.have.length(0);
|
|
745
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
746
|
-
expect(body).to.have.length(2);
|
|
747
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
748
|
-
expect(body[1]?.kind).to.equal("variableDeclaration");
|
|
749
|
-
});
|
|
750
|
-
it("should transform yield in conditional expression condition", () => {
|
|
751
|
-
const module = createGeneratorModule([
|
|
752
|
-
{
|
|
753
|
-
kind: "variableDeclaration",
|
|
754
|
-
declarationKind: "const",
|
|
755
|
-
isExported: false,
|
|
756
|
-
declarations: [
|
|
757
|
-
{
|
|
758
|
-
kind: "variableDeclarator",
|
|
759
|
-
name: { kind: "identifierPattern", name: "x" },
|
|
760
|
-
initializer: {
|
|
761
|
-
kind: "conditional",
|
|
762
|
-
condition: createYield({ kind: "literal", value: true }),
|
|
763
|
-
whenTrue: { kind: "literal", value: 1 },
|
|
764
|
-
whenFalse: { kind: "literal", value: 2 },
|
|
765
|
-
inferredType: { kind: "primitiveType", name: "number" },
|
|
766
|
-
},
|
|
767
|
-
},
|
|
768
|
-
],
|
|
769
|
-
},
|
|
770
|
-
]);
|
|
771
|
-
const result = runYieldLoweringPass([module]);
|
|
772
|
-
expect(result.ok).to.be.true;
|
|
773
|
-
expect(result.diagnostics).to.have.length(0);
|
|
774
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
775
|
-
expect(body).to.have.length(4);
|
|
776
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
777
|
-
expect(body[1]?.kind).to.equal("variableDeclaration");
|
|
778
|
-
expect(body[2]?.kind).to.equal("ifStatement");
|
|
779
|
-
expect(body[3]?.kind).to.equal("variableDeclaration");
|
|
780
|
-
});
|
|
781
|
-
it("should transform yield in conditional expression branches lazily", () => {
|
|
782
|
-
const module = createGeneratorModule([
|
|
783
|
-
{
|
|
784
|
-
kind: "variableDeclaration",
|
|
785
|
-
declarationKind: "const",
|
|
786
|
-
isExported: false,
|
|
787
|
-
declarations: [
|
|
788
|
-
{
|
|
789
|
-
kind: "variableDeclarator",
|
|
790
|
-
name: { kind: "identifierPattern", name: "x" },
|
|
791
|
-
initializer: {
|
|
792
|
-
kind: "conditional",
|
|
793
|
-
condition: { kind: "literal", value: true },
|
|
794
|
-
whenTrue: createYield({ kind: "literal", value: 1 }),
|
|
795
|
-
whenFalse: createYield({ kind: "literal", value: 2 }),
|
|
796
|
-
inferredType: { kind: "primitiveType", name: "number" },
|
|
797
|
-
},
|
|
798
|
-
},
|
|
799
|
-
],
|
|
800
|
-
},
|
|
801
|
-
]);
|
|
802
|
-
const result = runYieldLoweringPass([module]);
|
|
803
|
-
expect(result.ok).to.be.true;
|
|
804
|
-
expect(result.diagnostics).to.have.length(0);
|
|
805
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
806
|
-
expect(body).to.have.length(3);
|
|
807
|
-
expect(body[0]?.kind).to.equal("variableDeclaration");
|
|
808
|
-
expect(body[1]?.kind).to.equal("ifStatement");
|
|
809
|
-
expect(body[2]?.kind).to.equal("variableDeclaration");
|
|
810
|
-
const loweredIf = body[1];
|
|
811
|
-
expect(loweredIf.thenStatement.kind).to.equal("blockStatement");
|
|
812
|
-
expect(loweredIf.elseStatement?.kind).to.equal("blockStatement");
|
|
813
|
-
const thenStatements = loweredIf.thenStatement.kind === "blockStatement"
|
|
814
|
-
? loweredIf.thenStatement.statements
|
|
815
|
-
: [];
|
|
816
|
-
const elseStatements = loweredIf.elseStatement?.kind === "blockStatement"
|
|
817
|
-
? loweredIf.elseStatement.statements
|
|
818
|
-
: [];
|
|
819
|
-
expect(thenStatements[0]?.kind).to.equal("yieldStatement");
|
|
820
|
-
expect(thenStatements[1]?.kind).to.equal("expressionStatement");
|
|
821
|
-
expect(elseStatements[0]?.kind).to.equal("yieldStatement");
|
|
822
|
-
expect(elseStatements[1]?.kind).to.equal("expressionStatement");
|
|
823
|
-
});
|
|
824
|
-
it("should transform return yield expression into yield+generatorReturn", () => {
|
|
825
|
-
const module = createGeneratorModule([
|
|
826
|
-
{
|
|
827
|
-
kind: "returnStatement",
|
|
828
|
-
expression: createYield({ kind: "literal", value: 1 }),
|
|
829
|
-
},
|
|
830
|
-
]);
|
|
831
|
-
const result = runYieldLoweringPass([module]);
|
|
832
|
-
expect(result.ok).to.be.true;
|
|
833
|
-
expect(result.diagnostics).to.have.length(0);
|
|
834
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
835
|
-
expect(body).to.have.length(2);
|
|
836
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
837
|
-
expect(body[1]?.kind).to.equal("generatorReturnStatement");
|
|
838
|
-
});
|
|
839
|
-
it("should transform throw yield expression into yield+throw", () => {
|
|
840
|
-
const module = createGeneratorModule([
|
|
841
|
-
{
|
|
842
|
-
kind: "throwStatement",
|
|
843
|
-
expression: createYield({ kind: "identifier", name: "err" }),
|
|
844
|
-
},
|
|
845
|
-
]);
|
|
846
|
-
const result = runYieldLoweringPass([module]);
|
|
847
|
-
expect(result.ok).to.be.true;
|
|
848
|
-
expect(result.diagnostics).to.have.length(0);
|
|
849
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
850
|
-
expect(body).to.have.length(2);
|
|
851
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
852
|
-
expect(body[1]?.kind).to.equal("throwStatement");
|
|
853
|
-
});
|
|
854
|
-
it("should transform nested yield in return expression", () => {
|
|
855
|
-
const module = createGeneratorModule([
|
|
856
|
-
{
|
|
857
|
-
kind: "returnStatement",
|
|
858
|
-
expression: {
|
|
859
|
-
kind: "binary",
|
|
860
|
-
operator: "+",
|
|
861
|
-
left: createYield({ kind: "literal", value: 1 }),
|
|
862
|
-
right: { kind: "literal", value: 2 },
|
|
863
|
-
},
|
|
864
|
-
},
|
|
865
|
-
]);
|
|
866
|
-
const result = runYieldLoweringPass([module]);
|
|
867
|
-
expect(result.ok).to.be.true;
|
|
868
|
-
expect(result.diagnostics).to.have.length(0);
|
|
869
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
870
|
-
expect(body).to.have.length(2);
|
|
871
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
872
|
-
expect(body[1]?.kind).to.equal("generatorReturnStatement");
|
|
873
|
-
});
|
|
874
|
-
it("should transform for-loop assignment initializer with yield", () => {
|
|
875
|
-
const module = createGeneratorModule([
|
|
876
|
-
{
|
|
877
|
-
kind: "forStatement",
|
|
878
|
-
initializer: {
|
|
879
|
-
kind: "assignment",
|
|
880
|
-
operator: "=",
|
|
881
|
-
left: { kind: "identifierPattern", name: "x" },
|
|
882
|
-
right: createYield({ kind: "literal", value: 1 }),
|
|
883
|
-
},
|
|
884
|
-
condition: { kind: "literal", value: true },
|
|
885
|
-
body: { kind: "blockStatement", statements: [] },
|
|
886
|
-
},
|
|
887
|
-
]);
|
|
888
|
-
const result = runYieldLoweringPass([module]);
|
|
889
|
-
expect(result.ok).to.be.true;
|
|
890
|
-
expect(result.diagnostics).to.have.length(0);
|
|
891
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
892
|
-
expect(body).to.have.length(2);
|
|
893
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
894
|
-
expect(body[1]?.kind).to.equal("forStatement");
|
|
895
|
-
const loweredFor = body[1];
|
|
896
|
-
expect(loweredFor.initializer).to.equal(undefined);
|
|
897
|
-
});
|
|
898
|
-
it("should transform for-loop member assignment initializer with yield", () => {
|
|
899
|
-
const module = createGeneratorModule([
|
|
900
|
-
{
|
|
901
|
-
kind: "forStatement",
|
|
902
|
-
initializer: {
|
|
903
|
-
kind: "assignment",
|
|
904
|
-
operator: "=",
|
|
905
|
-
left: {
|
|
906
|
-
kind: "memberAccess",
|
|
907
|
-
object: { kind: "identifier", name: "obj" },
|
|
908
|
-
property: "count",
|
|
909
|
-
isOptional: false,
|
|
910
|
-
isComputed: false,
|
|
911
|
-
},
|
|
912
|
-
right: createYield({ kind: "literal", value: 1 }),
|
|
913
|
-
},
|
|
914
|
-
condition: { kind: "literal", value: true },
|
|
915
|
-
body: { kind: "blockStatement", statements: [] },
|
|
916
|
-
},
|
|
917
|
-
]);
|
|
918
|
-
const result = runYieldLoweringPass([module]);
|
|
919
|
-
expect(result.ok).to.be.true;
|
|
920
|
-
expect(result.diagnostics).to.have.length(0);
|
|
921
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
922
|
-
expect(body).to.have.length(4);
|
|
923
|
-
expect(body[0]?.kind).to.equal("variableDeclaration");
|
|
924
|
-
expect(body[1]?.kind).to.equal("yieldStatement");
|
|
925
|
-
expect(body[2]?.kind).to.equal("expressionStatement");
|
|
926
|
-
expect(body[3]?.kind).to.equal("forStatement");
|
|
927
|
-
const objectTempName = getTempNameFromSingleDeclarator(assertDefined(body[0]));
|
|
928
|
-
const receiveName = body[1].receiveTarget;
|
|
929
|
-
const assignExpr = body[2].expression;
|
|
930
|
-
expect(assignExpr.left.kind).to.equal("memberAccess");
|
|
931
|
-
const left = assignExpr.left;
|
|
932
|
-
expect(left.object.kind).to.equal("identifier");
|
|
933
|
-
expect(left.object.name).to.equal(objectTempName);
|
|
934
|
-
expect(left.property).to.equal("count");
|
|
935
|
-
expect(assignExpr.right.kind).to.equal("identifier");
|
|
936
|
-
expect(assignExpr.right.name).to.equal(receiveName.name);
|
|
937
|
-
const loweredFor = body[3];
|
|
938
|
-
expect(loweredFor.initializer).to.equal(undefined);
|
|
939
|
-
});
|
|
940
|
-
it("should transform for-loop computed member assignment initializer with yield", () => {
|
|
941
|
-
const module = createGeneratorModule([
|
|
942
|
-
{
|
|
943
|
-
kind: "forStatement",
|
|
944
|
-
initializer: {
|
|
945
|
-
kind: "assignment",
|
|
946
|
-
operator: "=",
|
|
947
|
-
left: {
|
|
948
|
-
kind: "memberAccess",
|
|
949
|
-
object: { kind: "identifier", name: "obj" },
|
|
950
|
-
property: { kind: "identifier", name: "key" },
|
|
951
|
-
isOptional: false,
|
|
952
|
-
isComputed: true,
|
|
953
|
-
},
|
|
954
|
-
right: createYield({ kind: "literal", value: 1 }),
|
|
955
|
-
},
|
|
956
|
-
condition: { kind: "literal", value: true },
|
|
957
|
-
body: { kind: "blockStatement", statements: [] },
|
|
958
|
-
},
|
|
959
|
-
]);
|
|
960
|
-
const result = runYieldLoweringPass([module]);
|
|
961
|
-
expect(result.ok).to.be.true;
|
|
962
|
-
expect(result.diagnostics).to.have.length(0);
|
|
963
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
964
|
-
expect(body).to.have.length(5);
|
|
965
|
-
expect(body[0]?.kind).to.equal("variableDeclaration");
|
|
966
|
-
expect(body[1]?.kind).to.equal("variableDeclaration");
|
|
967
|
-
expect(body[2]?.kind).to.equal("yieldStatement");
|
|
968
|
-
expect(body[3]?.kind).to.equal("expressionStatement");
|
|
969
|
-
expect(body[4]?.kind).to.equal("forStatement");
|
|
970
|
-
const objectTempName = getTempNameFromSingleDeclarator(assertDefined(body[0]));
|
|
971
|
-
const propertyTempName = getTempNameFromSingleDeclarator(assertDefined(body[1]));
|
|
972
|
-
const receiveName = body[2].receiveTarget;
|
|
973
|
-
const assignExpr = body[3].expression;
|
|
974
|
-
expect(assignExpr.left.kind).to.equal("memberAccess");
|
|
975
|
-
const left = assignExpr.left;
|
|
976
|
-
expect(left.object.kind).to.equal("identifier");
|
|
977
|
-
expect(left.object.name).to.equal(objectTempName);
|
|
978
|
-
expect(typeof left.property).to.not.equal("string");
|
|
979
|
-
expect(left.property.kind).to.equal("identifier");
|
|
980
|
-
expect(left.property.name).to.equal(propertyTempName);
|
|
981
|
-
expect(assignExpr.right.kind).to.equal("identifier");
|
|
982
|
-
expect(assignExpr.right.name).to.equal(receiveName.name);
|
|
983
|
-
const loweredFor = body[4];
|
|
984
|
-
expect(loweredFor.initializer).to.equal(undefined);
|
|
985
|
-
});
|
|
986
|
-
it("should transform for-loop member assignment initializer when object evaluation contains yield", () => {
|
|
987
|
-
const module = createGeneratorModule([
|
|
988
|
-
{
|
|
989
|
-
kind: "forStatement",
|
|
990
|
-
initializer: {
|
|
991
|
-
kind: "assignment",
|
|
992
|
-
operator: "=",
|
|
993
|
-
left: {
|
|
994
|
-
kind: "memberAccess",
|
|
995
|
-
object: createYield({ kind: "identifier", name: "obj" }),
|
|
996
|
-
property: "count",
|
|
997
|
-
isOptional: false,
|
|
998
|
-
isComputed: false,
|
|
999
|
-
},
|
|
1000
|
-
right: createYield({ kind: "literal", value: 1 }),
|
|
1001
|
-
},
|
|
1002
|
-
condition: { kind: "literal", value: true },
|
|
1003
|
-
body: { kind: "blockStatement", statements: [] },
|
|
1004
|
-
},
|
|
1005
|
-
]);
|
|
1006
|
-
const result = runYieldLoweringPass([module]);
|
|
1007
|
-
expect(result.ok).to.be.true;
|
|
1008
|
-
expect(result.diagnostics).to.have.length(0);
|
|
1009
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1010
|
-
expect(body).to.have.length(5);
|
|
1011
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
1012
|
-
expect(body[1]?.kind).to.equal("variableDeclaration");
|
|
1013
|
-
expect(body[2]?.kind).to.equal("yieldStatement");
|
|
1014
|
-
expect(body[3]?.kind).to.equal("expressionStatement");
|
|
1015
|
-
expect(body[4]?.kind).to.equal("forStatement");
|
|
1016
|
-
const objectTempName = getTempNameFromSingleDeclarator(assertDefined(body[1]));
|
|
1017
|
-
const objectYieldReceive = body[0].receiveTarget;
|
|
1018
|
-
const objectTempInit = body[1].declarations[0]?.initializer;
|
|
1019
|
-
expect(objectTempInit.kind).to.equal("identifier");
|
|
1020
|
-
expect(objectTempInit.name).to.equal(objectYieldReceive.name);
|
|
1021
|
-
const assignExpr = body[3].expression;
|
|
1022
|
-
expect(assignExpr.left.kind).to.equal("memberAccess");
|
|
1023
|
-
const left = assignExpr.left;
|
|
1024
|
-
expect(left.object.kind).to.equal("identifier");
|
|
1025
|
-
expect(left.object.name).to.equal(objectTempName);
|
|
1026
|
-
});
|
|
1027
|
-
it("should transform for-loop member assignment initializer when computed property contains yield", () => {
|
|
1028
|
-
const module = createGeneratorModule([
|
|
1029
|
-
{
|
|
1030
|
-
kind: "forStatement",
|
|
1031
|
-
initializer: {
|
|
1032
|
-
kind: "assignment",
|
|
1033
|
-
operator: "=",
|
|
1034
|
-
left: {
|
|
1035
|
-
kind: "memberAccess",
|
|
1036
|
-
object: { kind: "identifier", name: "obj" },
|
|
1037
|
-
property: createYield({ kind: "identifier", name: "key" }),
|
|
1038
|
-
isOptional: false,
|
|
1039
|
-
isComputed: true,
|
|
1040
|
-
},
|
|
1041
|
-
right: createYield({ kind: "literal", value: 1 }),
|
|
1042
|
-
},
|
|
1043
|
-
condition: { kind: "literal", value: true },
|
|
1044
|
-
body: { kind: "blockStatement", statements: [] },
|
|
1045
|
-
},
|
|
1046
|
-
]);
|
|
1047
|
-
const result = runYieldLoweringPass([module]);
|
|
1048
|
-
expect(result.ok).to.be.true;
|
|
1049
|
-
expect(result.diagnostics).to.have.length(0);
|
|
1050
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1051
|
-
expect(body).to.have.length(6);
|
|
1052
|
-
expect(body[0]?.kind).to.equal("variableDeclaration");
|
|
1053
|
-
expect(body[1]?.kind).to.equal("yieldStatement");
|
|
1054
|
-
expect(body[2]?.kind).to.equal("variableDeclaration");
|
|
1055
|
-
expect(body[3]?.kind).to.equal("yieldStatement");
|
|
1056
|
-
expect(body[4]?.kind).to.equal("expressionStatement");
|
|
1057
|
-
expect(body[5]?.kind).to.equal("forStatement");
|
|
1058
|
-
const objectTempName = getTempNameFromSingleDeclarator(assertDefined(body[0]));
|
|
1059
|
-
const propertyTempName = getTempNameFromSingleDeclarator(assertDefined(body[2]));
|
|
1060
|
-
const propertyYieldReceive = body[1].receiveTarget;
|
|
1061
|
-
const propertyTempInit = body[2].declarations[0]?.initializer;
|
|
1062
|
-
expect(propertyTempInit.kind).to.equal("identifier");
|
|
1063
|
-
expect(propertyTempInit.name).to.equal(propertyYieldReceive.name);
|
|
1064
|
-
const assignExpr = body[4].expression;
|
|
1065
|
-
expect(assignExpr.left.kind).to.equal("memberAccess");
|
|
1066
|
-
const left = assignExpr.left;
|
|
1067
|
-
expect(left.object.kind).to.equal("identifier");
|
|
1068
|
-
expect(left.object.name).to.equal(objectTempName);
|
|
1069
|
-
expect(typeof left.property).to.not.equal("string");
|
|
1070
|
-
expect(left.property.kind).to.equal("identifier");
|
|
1071
|
-
expect(left.property.name).to.equal(propertyTempName);
|
|
1072
|
-
});
|
|
1073
|
-
it("should transform for-loop member assignment initializer when target object and value expression both contain yield", () => {
|
|
1074
|
-
const module = createGeneratorModule([
|
|
1075
|
-
{
|
|
1076
|
-
kind: "forStatement",
|
|
1077
|
-
initializer: {
|
|
1078
|
-
kind: "assignment",
|
|
1079
|
-
operator: "=",
|
|
1080
|
-
left: {
|
|
1081
|
-
kind: "memberAccess",
|
|
1082
|
-
object: createYield({ kind: "identifier", name: "obj" }),
|
|
1083
|
-
property: "count",
|
|
1084
|
-
isOptional: false,
|
|
1085
|
-
isComputed: false,
|
|
1086
|
-
},
|
|
1087
|
-
right: {
|
|
1088
|
-
kind: "binary",
|
|
1089
|
-
operator: "+",
|
|
1090
|
-
left: createYield({ kind: "literal", value: 1 }),
|
|
1091
|
-
right: { kind: "literal", value: 2 },
|
|
1092
|
-
},
|
|
1093
|
-
},
|
|
1094
|
-
condition: { kind: "literal", value: true },
|
|
1095
|
-
body: { kind: "blockStatement", statements: [] },
|
|
1096
|
-
},
|
|
1097
|
-
]);
|
|
1098
|
-
const result = runYieldLoweringPass([module]);
|
|
1099
|
-
expect(result.ok).to.be.true;
|
|
1100
|
-
expect(result.diagnostics).to.have.length(0);
|
|
1101
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1102
|
-
expect(body).to.have.length(5);
|
|
1103
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
1104
|
-
expect(body[1]?.kind).to.equal("variableDeclaration");
|
|
1105
|
-
expect(body[2]?.kind).to.equal("yieldStatement");
|
|
1106
|
-
expect(body[3]?.kind).to.equal("expressionStatement");
|
|
1107
|
-
expect(body[4]?.kind).to.equal("forStatement");
|
|
1108
|
-
});
|
|
1109
|
-
it("should transform for-loop member assignment initializer when computed property and value expression both contain yield", () => {
|
|
1110
|
-
const module = createGeneratorModule([
|
|
1111
|
-
{
|
|
1112
|
-
kind: "forStatement",
|
|
1113
|
-
initializer: {
|
|
1114
|
-
kind: "assignment",
|
|
1115
|
-
operator: "=",
|
|
1116
|
-
left: {
|
|
1117
|
-
kind: "memberAccess",
|
|
1118
|
-
object: { kind: "identifier", name: "obj" },
|
|
1119
|
-
property: createYield({ kind: "identifier", name: "key" }),
|
|
1120
|
-
isOptional: false,
|
|
1121
|
-
isComputed: true,
|
|
1122
|
-
},
|
|
1123
|
-
right: {
|
|
1124
|
-
kind: "binary",
|
|
1125
|
-
operator: "+",
|
|
1126
|
-
left: createYield({ kind: "literal", value: 1 }),
|
|
1127
|
-
right: { kind: "literal", value: 2 },
|
|
1128
|
-
},
|
|
1129
|
-
},
|
|
1130
|
-
condition: { kind: "literal", value: true },
|
|
1131
|
-
body: { kind: "blockStatement", statements: [] },
|
|
1132
|
-
},
|
|
1133
|
-
]);
|
|
1134
|
-
const result = runYieldLoweringPass([module]);
|
|
1135
|
-
expect(result.ok).to.be.true;
|
|
1136
|
-
expect(result.diagnostics).to.have.length(0);
|
|
1137
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1138
|
-
expect(body).to.have.length(6);
|
|
1139
|
-
expect(body[0]?.kind).to.equal("variableDeclaration");
|
|
1140
|
-
expect(body[1]?.kind).to.equal("yieldStatement");
|
|
1141
|
-
expect(body[2]?.kind).to.equal("variableDeclaration");
|
|
1142
|
-
expect(body[3]?.kind).to.equal("yieldStatement");
|
|
1143
|
-
expect(body[4]?.kind).to.equal("expressionStatement");
|
|
1144
|
-
expect(body[5]?.kind).to.equal("forStatement");
|
|
1145
|
-
});
|
|
1146
|
-
it("should transform nested yield in for-loop assignment initializer", () => {
|
|
1147
|
-
const module = createGeneratorModule([
|
|
1148
|
-
{
|
|
1149
|
-
kind: "forStatement",
|
|
1150
|
-
initializer: {
|
|
1151
|
-
kind: "assignment",
|
|
1152
|
-
operator: "=",
|
|
1153
|
-
left: { kind: "identifierPattern", name: "x" },
|
|
1154
|
-
right: {
|
|
1155
|
-
kind: "binary",
|
|
1156
|
-
operator: "+",
|
|
1157
|
-
left: createYield({ kind: "literal", value: 1 }),
|
|
1158
|
-
right: { kind: "literal", value: 2 },
|
|
1159
|
-
},
|
|
1160
|
-
},
|
|
1161
|
-
condition: { kind: "literal", value: true },
|
|
1162
|
-
body: { kind: "blockStatement", statements: [] },
|
|
1163
|
-
},
|
|
1164
|
-
]);
|
|
1165
|
-
const result = runYieldLoweringPass([module]);
|
|
1166
|
-
expect(result.ok).to.be.true;
|
|
1167
|
-
expect(result.diagnostics).to.have.length(0);
|
|
1168
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1169
|
-
expect(body).to.have.length(2);
|
|
1170
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
1171
|
-
expect(body[1]?.kind).to.equal("forStatement");
|
|
1172
|
-
const loweredFor = body[1];
|
|
1173
|
-
expect(loweredFor.initializer?.kind).to.equal("assignment");
|
|
1174
|
-
});
|
|
1175
|
-
it("should transform direct yield in for-loop declaration initializer", () => {
|
|
1176
|
-
const module = createGeneratorModule([
|
|
1177
|
-
{
|
|
1178
|
-
kind: "forStatement",
|
|
1179
|
-
initializer: {
|
|
1180
|
-
kind: "variableDeclaration",
|
|
1181
|
-
declarationKind: "let",
|
|
1182
|
-
isExported: false,
|
|
1183
|
-
declarations: [
|
|
1184
|
-
{
|
|
1185
|
-
kind: "variableDeclarator",
|
|
1186
|
-
name: { kind: "identifierPattern", name: "x" },
|
|
1187
|
-
type: { kind: "primitiveType", name: "number" },
|
|
1188
|
-
initializer: createYield({ kind: "literal", value: 1 }),
|
|
1189
|
-
},
|
|
1190
|
-
],
|
|
1191
|
-
},
|
|
1192
|
-
condition: { kind: "literal", value: true },
|
|
1193
|
-
body: { kind: "blockStatement", statements: [] },
|
|
1194
|
-
},
|
|
1195
|
-
]);
|
|
1196
|
-
const result = runYieldLoweringPass([module]);
|
|
1197
|
-
expect(result.ok).to.be.true;
|
|
1198
|
-
expect(result.diagnostics).to.have.length(0);
|
|
1199
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1200
|
-
expect(body).to.have.length(2);
|
|
1201
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
1202
|
-
expect(body[1]?.kind).to.equal("forStatement");
|
|
1203
|
-
const loweredFor = body[1];
|
|
1204
|
-
expect(loweredFor.initializer?.kind).to.equal("variableDeclaration");
|
|
1205
|
-
const initDecl = loweredFor.initializer;
|
|
1206
|
-
expect(initDecl.declarations[0]?.initializer?.kind).to.equal("identifier");
|
|
1207
|
-
});
|
|
1208
|
-
it("should transform nested yield in for-loop declaration initializer", () => {
|
|
1209
|
-
const module = createGeneratorModule([
|
|
1210
|
-
{
|
|
1211
|
-
kind: "forStatement",
|
|
1212
|
-
initializer: {
|
|
1213
|
-
kind: "variableDeclaration",
|
|
1214
|
-
declarationKind: "let",
|
|
1215
|
-
isExported: false,
|
|
1216
|
-
declarations: [
|
|
1217
|
-
{
|
|
1218
|
-
kind: "variableDeclarator",
|
|
1219
|
-
name: { kind: "identifierPattern", name: "x" },
|
|
1220
|
-
type: { kind: "primitiveType", name: "number" },
|
|
1221
|
-
initializer: {
|
|
1222
|
-
kind: "binary",
|
|
1223
|
-
operator: "+",
|
|
1224
|
-
left: createYield({ kind: "literal", value: 1 }),
|
|
1225
|
-
right: { kind: "literal", value: 2 },
|
|
1226
|
-
},
|
|
1227
|
-
},
|
|
1228
|
-
],
|
|
1229
|
-
},
|
|
1230
|
-
condition: { kind: "literal", value: true },
|
|
1231
|
-
body: { kind: "blockStatement", statements: [] },
|
|
1232
|
-
},
|
|
1233
|
-
]);
|
|
1234
|
-
const result = runYieldLoweringPass([module]);
|
|
1235
|
-
expect(result.ok).to.be.true;
|
|
1236
|
-
expect(result.diagnostics).to.have.length(0);
|
|
1237
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1238
|
-
expect(body).to.have.length(2);
|
|
1239
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
1240
|
-
expect(body[1]?.kind).to.equal("forStatement");
|
|
1241
|
-
const loweredFor = body[1];
|
|
1242
|
-
expect(loweredFor.initializer?.kind).to.equal("variableDeclaration");
|
|
1243
|
-
const initDecl = loweredFor.initializer;
|
|
1244
|
-
expect(initDecl.declarations[0]?.initializer?.kind).to.equal("binary");
|
|
1245
|
-
});
|
|
1246
|
-
it("should transform nested yield in for loop condition", () => {
|
|
1247
|
-
const module = createGeneratorModule([
|
|
1248
|
-
{
|
|
1249
|
-
kind: "forStatement",
|
|
1250
|
-
condition: {
|
|
1251
|
-
kind: "logical",
|
|
1252
|
-
operator: "&&",
|
|
1253
|
-
left: createYield({ kind: "literal", value: true }),
|
|
1254
|
-
right: { kind: "literal", value: true },
|
|
1255
|
-
},
|
|
1256
|
-
body: { kind: "blockStatement", statements: [] },
|
|
1257
|
-
},
|
|
1258
|
-
]);
|
|
1259
|
-
const result = runYieldLoweringPass([module]);
|
|
1260
|
-
expect(result.ok).to.be.true;
|
|
1261
|
-
expect(result.diagnostics).to.have.length(0);
|
|
1262
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1263
|
-
expect(body).to.have.length(1);
|
|
1264
|
-
expect(body[0]?.kind).to.equal("forStatement");
|
|
1265
|
-
});
|
|
1266
|
-
it("should transform nested yield in for loop update", () => {
|
|
1267
|
-
const module = createGeneratorModule([
|
|
1268
|
-
{
|
|
1269
|
-
kind: "forStatement",
|
|
1270
|
-
condition: { kind: "literal", value: true },
|
|
1271
|
-
update: {
|
|
1272
|
-
kind: "assignment",
|
|
1273
|
-
operator: "=",
|
|
1274
|
-
left: { kind: "identifierPattern", name: "i" },
|
|
1275
|
-
right: {
|
|
1276
|
-
kind: "binary",
|
|
1277
|
-
operator: "+",
|
|
1278
|
-
left: createYield({ kind: "literal", value: 1 }),
|
|
1279
|
-
right: { kind: "literal", value: 2 },
|
|
1280
|
-
},
|
|
1281
|
-
},
|
|
1282
|
-
body: { kind: "blockStatement", statements: [] },
|
|
1283
|
-
},
|
|
1284
|
-
]);
|
|
1285
|
-
const result = runYieldLoweringPass([module]);
|
|
1286
|
-
expect(result.ok).to.be.true;
|
|
1287
|
-
expect(result.diagnostics).to.have.length(0);
|
|
1288
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1289
|
-
expect(body).to.have.length(2);
|
|
1290
|
-
expect(body[0]?.kind).to.equal("variableDeclaration");
|
|
1291
|
-
expect(body[1]?.kind).to.equal("forStatement");
|
|
1292
|
-
});
|
|
1293
|
-
it("should transform nested yield in if condition", () => {
|
|
1294
|
-
const module = createGeneratorModule([
|
|
1295
|
-
{
|
|
1296
|
-
kind: "ifStatement",
|
|
1297
|
-
condition: {
|
|
1298
|
-
kind: "binary",
|
|
1299
|
-
operator: "+",
|
|
1300
|
-
left: createYield({ kind: "literal", value: 1 }),
|
|
1301
|
-
right: { kind: "literal", value: 2 },
|
|
1302
|
-
},
|
|
1303
|
-
thenStatement: { kind: "blockStatement", statements: [] },
|
|
1304
|
-
},
|
|
1305
|
-
]);
|
|
1306
|
-
const result = runYieldLoweringPass([module]);
|
|
1307
|
-
expect(result.ok).to.be.true;
|
|
1308
|
-
expect(result.diagnostics).to.have.length(0);
|
|
1309
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1310
|
-
expect(body).to.have.length(2);
|
|
1311
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
1312
|
-
expect(body[1]?.kind).to.equal("ifStatement");
|
|
1313
|
-
});
|
|
1314
|
-
it("should transform nested yield in while condition", () => {
|
|
1315
|
-
const module = createGeneratorModule([
|
|
1316
|
-
{
|
|
1317
|
-
kind: "whileStatement",
|
|
1318
|
-
condition: {
|
|
1319
|
-
kind: "logical",
|
|
1320
|
-
operator: "&&",
|
|
1321
|
-
left: createYield({ kind: "literal", value: true }),
|
|
1322
|
-
right: { kind: "literal", value: true },
|
|
1323
|
-
},
|
|
1324
|
-
body: { kind: "blockStatement", statements: [] },
|
|
1325
|
-
},
|
|
1326
|
-
]);
|
|
1327
|
-
const result = runYieldLoweringPass([module]);
|
|
1328
|
-
expect(result.ok).to.be.true;
|
|
1329
|
-
expect(result.diagnostics).to.have.length(0);
|
|
1330
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1331
|
-
expect(body).to.have.length(1);
|
|
1332
|
-
expect(body[0]?.kind).to.equal("whileStatement");
|
|
1333
|
-
});
|
|
1334
|
-
it("should transform nested yield in for-of expression", () => {
|
|
1335
|
-
const module = createGeneratorModule([
|
|
1336
|
-
{
|
|
1337
|
-
kind: "forOfStatement",
|
|
1338
|
-
variable: { kind: "identifierPattern", name: "x" },
|
|
1339
|
-
expression: {
|
|
1340
|
-
kind: "binary",
|
|
1341
|
-
operator: "+",
|
|
1342
|
-
left: createYield({ kind: "literal", value: 1 }),
|
|
1343
|
-
right: { kind: "literal", value: 2 },
|
|
1344
|
-
},
|
|
1345
|
-
body: { kind: "blockStatement", statements: [] },
|
|
1346
|
-
isAwait: false,
|
|
1347
|
-
},
|
|
1348
|
-
]);
|
|
1349
|
-
const result = runYieldLoweringPass([module]);
|
|
1350
|
-
expect(result.ok).to.be.true;
|
|
1351
|
-
expect(result.diagnostics).to.have.length(0);
|
|
1352
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1353
|
-
expect(body).to.have.length(2);
|
|
1354
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
1355
|
-
expect(body[1]?.kind).to.equal("forOfStatement");
|
|
1356
|
-
});
|
|
1357
|
-
it("should transform nested yield in for-in expression", () => {
|
|
1358
|
-
const module = createGeneratorModule([
|
|
1359
|
-
{
|
|
1360
|
-
kind: "forInStatement",
|
|
1361
|
-
variable: { kind: "identifierPattern", name: "k" },
|
|
1362
|
-
expression: {
|
|
1363
|
-
kind: "binary",
|
|
1364
|
-
operator: "+",
|
|
1365
|
-
left: createYield({ kind: "literal", value: 1 }),
|
|
1366
|
-
right: { kind: "literal", value: 2 },
|
|
1367
|
-
},
|
|
1368
|
-
body: { kind: "blockStatement", statements: [] },
|
|
1369
|
-
},
|
|
1370
|
-
]);
|
|
1371
|
-
const result = runYieldLoweringPass([module]);
|
|
1372
|
-
expect(result.ok).to.be.true;
|
|
1373
|
-
expect(result.diagnostics).to.have.length(0);
|
|
1374
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1375
|
-
expect(body).to.have.length(2);
|
|
1376
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
1377
|
-
expect(body[1]?.kind).to.equal("forInStatement");
|
|
1378
|
-
});
|
|
1379
|
-
});
|
|
1380
|
-
describe("Control Flow Structures", () => {
|
|
1381
|
-
it("should transform direct yield in if condition", () => {
|
|
1382
|
-
const module = createGeneratorModule([
|
|
1383
|
-
{
|
|
1384
|
-
kind: "ifStatement",
|
|
1385
|
-
condition: createYield({ kind: "literal", value: true }),
|
|
1386
|
-
thenStatement: {
|
|
1387
|
-
kind: "blockStatement",
|
|
1388
|
-
statements: [
|
|
1389
|
-
{
|
|
1390
|
-
kind: "expressionStatement",
|
|
1391
|
-
expression: { kind: "literal", value: 1 },
|
|
1392
|
-
},
|
|
1393
|
-
],
|
|
1394
|
-
},
|
|
1395
|
-
},
|
|
1396
|
-
]);
|
|
1397
|
-
const result = runYieldLoweringPass([module]);
|
|
1398
|
-
expect(result.ok).to.be.true;
|
|
1399
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1400
|
-
expect(body).to.have.length(2);
|
|
1401
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
1402
|
-
expect(body[1]?.kind).to.equal("ifStatement");
|
|
1403
|
-
});
|
|
1404
|
-
it("should transform yield inside if statement", () => {
|
|
1405
|
-
const module = createGeneratorModule([
|
|
1406
|
-
{
|
|
1407
|
-
kind: "ifStatement",
|
|
1408
|
-
condition: { kind: "literal", value: true },
|
|
1409
|
-
thenStatement: {
|
|
1410
|
-
kind: "blockStatement",
|
|
1411
|
-
statements: [
|
|
1412
|
-
{
|
|
1413
|
-
kind: "expressionStatement",
|
|
1414
|
-
expression: createYield({ kind: "literal", value: 1 }),
|
|
1415
|
-
},
|
|
1416
|
-
],
|
|
1417
|
-
},
|
|
1418
|
-
},
|
|
1419
|
-
]);
|
|
1420
|
-
const result = runYieldLoweringPass([module]);
|
|
1421
|
-
expect(result.ok).to.be.true;
|
|
1422
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1423
|
-
const ifStmt = body[0];
|
|
1424
|
-
const thenBlock = ifStmt.thenStatement;
|
|
1425
|
-
expect(thenBlock.statements[0]?.kind).to.equal("yieldStatement");
|
|
1426
|
-
});
|
|
1427
|
-
it("should transform yield inside while loop", () => {
|
|
1428
|
-
const module = createGeneratorModule([
|
|
1429
|
-
{
|
|
1430
|
-
kind: "whileStatement",
|
|
1431
|
-
condition: { kind: "literal", value: true },
|
|
1432
|
-
body: {
|
|
1433
|
-
kind: "blockStatement",
|
|
1434
|
-
statements: [
|
|
1435
|
-
{
|
|
1436
|
-
kind: "expressionStatement",
|
|
1437
|
-
expression: createYield({ kind: "identifier", name: "i" }),
|
|
1438
|
-
},
|
|
1439
|
-
],
|
|
1440
|
-
},
|
|
1441
|
-
},
|
|
1442
|
-
]);
|
|
1443
|
-
const result = runYieldLoweringPass([module]);
|
|
1444
|
-
expect(result.ok).to.be.true;
|
|
1445
|
-
});
|
|
1446
|
-
it("should transform direct yield in for loop condition", () => {
|
|
1447
|
-
const module = createGeneratorModule([
|
|
1448
|
-
{
|
|
1449
|
-
kind: "forStatement",
|
|
1450
|
-
condition: createYield({ kind: "literal", value: true }),
|
|
1451
|
-
update: {
|
|
1452
|
-
kind: "update",
|
|
1453
|
-
operator: "++",
|
|
1454
|
-
expression: { kind: "identifier", name: "i" },
|
|
1455
|
-
prefix: false,
|
|
1456
|
-
},
|
|
1457
|
-
body: { kind: "blockStatement", statements: [] },
|
|
1458
|
-
},
|
|
1459
|
-
]);
|
|
1460
|
-
const result = runYieldLoweringPass([module]);
|
|
1461
|
-
expect(result.ok).to.be.true;
|
|
1462
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1463
|
-
expect(body).to.have.length(1);
|
|
1464
|
-
const forStmt = body[0];
|
|
1465
|
-
expect(forStmt.condition?.kind).to.equal("literal");
|
|
1466
|
-
expect(forStmt.body.kind).to.equal("blockStatement");
|
|
1467
|
-
const forBody = forStmt.body;
|
|
1468
|
-
expect(forBody.statements[0]?.kind).to.equal("yieldStatement");
|
|
1469
|
-
expect(forBody.statements[1]?.kind).to.equal("ifStatement");
|
|
1470
|
-
});
|
|
1471
|
-
it("should transform direct yield in for loop update", () => {
|
|
1472
|
-
const module = createGeneratorModule([
|
|
1473
|
-
{
|
|
1474
|
-
kind: "forStatement",
|
|
1475
|
-
condition: {
|
|
1476
|
-
kind: "binary",
|
|
1477
|
-
operator: "<",
|
|
1478
|
-
left: { kind: "identifier", name: "i" },
|
|
1479
|
-
right: { kind: "literal", value: 3 },
|
|
1480
|
-
},
|
|
1481
|
-
update: createYield({ kind: "literal", value: 1 }),
|
|
1482
|
-
body: { kind: "blockStatement", statements: [] },
|
|
1483
|
-
},
|
|
1484
|
-
]);
|
|
1485
|
-
const result = runYieldLoweringPass([module]);
|
|
1486
|
-
expect(result.ok).to.be.true;
|
|
1487
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1488
|
-
expect(body).to.have.length(2);
|
|
1489
|
-
expect(body[0]?.kind).to.equal("variableDeclaration");
|
|
1490
|
-
const forStmt = body[1];
|
|
1491
|
-
expect(forStmt.condition?.kind).to.equal("literal");
|
|
1492
|
-
expect(forStmt.update).to.equal(undefined);
|
|
1493
|
-
expect(forStmt.body.kind).to.equal("blockStatement");
|
|
1494
|
-
const forBody = forStmt.body;
|
|
1495
|
-
expect(forBody.statements[0]?.kind).to.equal("ifStatement");
|
|
1496
|
-
expect(forBody.statements[1]?.kind).to.equal("expressionStatement");
|
|
1497
|
-
expect(forBody.statements[2]?.kind).to.equal("ifStatement");
|
|
1498
|
-
});
|
|
1499
|
-
it("should transform direct yield in both for loop condition and update", () => {
|
|
1500
|
-
const module = createGeneratorModule([
|
|
1501
|
-
{
|
|
1502
|
-
kind: "forStatement",
|
|
1503
|
-
condition: createYield({ kind: "literal", value: true }),
|
|
1504
|
-
update: createYield({ kind: "literal", value: 1 }),
|
|
1505
|
-
body: {
|
|
1506
|
-
kind: "blockStatement",
|
|
1507
|
-
statements: [{ kind: "continueStatement" }],
|
|
1508
|
-
},
|
|
1509
|
-
},
|
|
1510
|
-
]);
|
|
1511
|
-
const result = runYieldLoweringPass([module]);
|
|
1512
|
-
expect(result.ok).to.be.true;
|
|
1513
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1514
|
-
expect(body).to.have.length(2);
|
|
1515
|
-
expect(body[0]?.kind).to.equal("variableDeclaration");
|
|
1516
|
-
const forStmt = body[1];
|
|
1517
|
-
expect(forStmt.condition?.kind).to.equal("literal");
|
|
1518
|
-
expect(forStmt.update).to.equal(undefined);
|
|
1519
|
-
const forBody = forStmt.body;
|
|
1520
|
-
expect(forBody.statements[0]?.kind).to.equal("ifStatement");
|
|
1521
|
-
expect(forBody.statements[2]?.kind).to.equal("yieldStatement");
|
|
1522
|
-
expect(forBody.statements[3]?.kind).to.equal("ifStatement");
|
|
1523
|
-
});
|
|
1524
|
-
it("should transform direct yield in while condition", () => {
|
|
1525
|
-
const module = createGeneratorModule([
|
|
1526
|
-
{
|
|
1527
|
-
kind: "whileStatement",
|
|
1528
|
-
condition: createYield({ kind: "literal", value: true }),
|
|
1529
|
-
body: {
|
|
1530
|
-
kind: "blockStatement",
|
|
1531
|
-
statements: [
|
|
1532
|
-
{
|
|
1533
|
-
kind: "expressionStatement",
|
|
1534
|
-
expression: { kind: "literal", value: 1 },
|
|
1535
|
-
},
|
|
1536
|
-
],
|
|
1537
|
-
},
|
|
1538
|
-
},
|
|
1539
|
-
]);
|
|
1540
|
-
const result = runYieldLoweringPass([module]);
|
|
1541
|
-
expect(result.ok).to.be.true;
|
|
1542
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1543
|
-
expect(body).to.have.length(1);
|
|
1544
|
-
const whileStmt = body[0];
|
|
1545
|
-
expect(whileStmt.condition.kind).to.equal("literal");
|
|
1546
|
-
if (whileStmt.condition.kind === "literal") {
|
|
1547
|
-
expect(whileStmt.condition.value).to.equal(true);
|
|
1548
|
-
}
|
|
1549
|
-
expect(whileStmt.body.kind).to.equal("blockStatement");
|
|
1550
|
-
const whileBody = whileStmt.body;
|
|
1551
|
-
expect(whileBody.statements[0]?.kind).to.equal("yieldStatement");
|
|
1552
|
-
expect(whileBody.statements[1]?.kind).to.equal("ifStatement");
|
|
1553
|
-
});
|
|
1554
|
-
it("should transform direct yield in for-of expression", () => {
|
|
1555
|
-
const module = createGeneratorModule([
|
|
1556
|
-
{
|
|
1557
|
-
kind: "forOfStatement",
|
|
1558
|
-
variable: { kind: "identifierPattern", name: "x" },
|
|
1559
|
-
expression: createYield({ kind: "array", elements: [] }),
|
|
1560
|
-
body: { kind: "blockStatement", statements: [] },
|
|
1561
|
-
isAwait: false,
|
|
1562
|
-
},
|
|
1563
|
-
]);
|
|
1564
|
-
const result = runYieldLoweringPass([module]);
|
|
1565
|
-
expect(result.ok).to.be.true;
|
|
1566
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1567
|
-
expect(body).to.have.length(2);
|
|
1568
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
1569
|
-
expect(body[1]?.kind).to.equal("forOfStatement");
|
|
1570
|
-
});
|
|
1571
|
-
it("should transform direct yield in for-in expression", () => {
|
|
1572
|
-
const module = createGeneratorModule([
|
|
1573
|
-
{
|
|
1574
|
-
kind: "forInStatement",
|
|
1575
|
-
variable: { kind: "identifierPattern", name: "k" },
|
|
1576
|
-
expression: createYield({ kind: "object", properties: [] }),
|
|
1577
|
-
body: { kind: "blockStatement", statements: [] },
|
|
1578
|
-
},
|
|
1579
|
-
]);
|
|
1580
|
-
const result = runYieldLoweringPass([module]);
|
|
1581
|
-
expect(result.ok).to.be.true;
|
|
1582
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1583
|
-
expect(body).to.have.length(2);
|
|
1584
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
1585
|
-
expect(body[1]?.kind).to.equal("forInStatement");
|
|
1586
|
-
});
|
|
1587
|
-
it("should transform yield inside switch case", () => {
|
|
1588
|
-
const module = createGeneratorModule([
|
|
1589
|
-
{
|
|
1590
|
-
kind: "switchStatement",
|
|
1591
|
-
expression: { kind: "identifier", name: "x" },
|
|
1592
|
-
cases: [
|
|
1593
|
-
{
|
|
1594
|
-
kind: "switchCase",
|
|
1595
|
-
test: { kind: "literal", value: 1 },
|
|
1596
|
-
statements: [
|
|
1597
|
-
{
|
|
1598
|
-
kind: "expressionStatement",
|
|
1599
|
-
expression: createYield({ kind: "literal", value: 10 }),
|
|
1600
|
-
},
|
|
1601
|
-
],
|
|
1602
|
-
},
|
|
1603
|
-
],
|
|
1604
|
-
},
|
|
1605
|
-
]);
|
|
1606
|
-
const result = runYieldLoweringPass([module]);
|
|
1607
|
-
expect(result.ok).to.be.true;
|
|
1608
|
-
});
|
|
1609
|
-
it("should transform direct yield in switch expression", () => {
|
|
1610
|
-
const module = createGeneratorModule([
|
|
1611
|
-
{
|
|
1612
|
-
kind: "switchStatement",
|
|
1613
|
-
expression: createYield({ kind: "literal", value: 1 }),
|
|
1614
|
-
cases: [
|
|
1615
|
-
{
|
|
1616
|
-
kind: "switchCase",
|
|
1617
|
-
test: { kind: "literal", value: 1 },
|
|
1618
|
-
statements: [{ kind: "breakStatement" }],
|
|
1619
|
-
},
|
|
1620
|
-
],
|
|
1621
|
-
},
|
|
1622
|
-
]);
|
|
1623
|
-
const result = runYieldLoweringPass([module]);
|
|
1624
|
-
expect(result.ok).to.be.true;
|
|
1625
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1626
|
-
expect(body).to.have.length(2);
|
|
1627
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
1628
|
-
expect(body[1]?.kind).to.equal("switchStatement");
|
|
1629
|
-
});
|
|
1630
|
-
it("should transform yield inside try block", () => {
|
|
1631
|
-
const module = createGeneratorModule([
|
|
1632
|
-
{
|
|
1633
|
-
kind: "tryStatement",
|
|
1634
|
-
tryBlock: {
|
|
1635
|
-
kind: "blockStatement",
|
|
1636
|
-
statements: [
|
|
1637
|
-
{
|
|
1638
|
-
kind: "expressionStatement",
|
|
1639
|
-
expression: createYield({ kind: "literal", value: 1 }),
|
|
1640
|
-
},
|
|
1641
|
-
],
|
|
1642
|
-
},
|
|
1643
|
-
},
|
|
1644
|
-
]);
|
|
1645
|
-
const result = runYieldLoweringPass([module]);
|
|
1646
|
-
expect(result.ok).to.be.true;
|
|
1647
|
-
});
|
|
1648
|
-
});
|
|
1649
|
-
describe("Non-Generator Functions", () => {
|
|
1650
|
-
it("should not transform yield expressions in non-generator functions", () => {
|
|
1651
|
-
// This shouldn't happen in practice (TS would reject it),
|
|
1652
|
-
// but the pass should handle it gracefully
|
|
1653
|
-
const module = createGeneratorModule([
|
|
1654
|
-
{
|
|
1655
|
-
kind: "expressionStatement",
|
|
1656
|
-
expression: createYield({ kind: "literal", value: 42 }),
|
|
1657
|
-
},
|
|
1658
|
-
], { isGenerator: false });
|
|
1659
|
-
const result = runYieldLoweringPass([module]);
|
|
1660
|
-
// The pass doesn't transform non-generators
|
|
1661
|
-
expect(result.ok).to.be.true;
|
|
1662
|
-
const body = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1663
|
-
// Should still be expressionStatement with yield, not yieldStatement
|
|
1664
|
-
expect(body[0]?.kind).to.equal("expressionStatement");
|
|
1665
|
-
});
|
|
1666
|
-
it("should process nested generator functions inside non-generators", () => {
|
|
1667
|
-
const module = {
|
|
1668
|
-
kind: "module",
|
|
1669
|
-
filePath: "/src/test.ts",
|
|
1670
|
-
namespace: "Test",
|
|
1671
|
-
className: "test",
|
|
1672
|
-
isStaticContainer: true,
|
|
1673
|
-
imports: [],
|
|
1674
|
-
body: [
|
|
1675
|
-
{
|
|
1676
|
-
kind: "functionDeclaration",
|
|
1677
|
-
name: "outer",
|
|
1678
|
-
parameters: [],
|
|
1679
|
-
returnType: { kind: "voidType" },
|
|
1680
|
-
body: {
|
|
1681
|
-
kind: "blockStatement",
|
|
1682
|
-
statements: [
|
|
1683
|
-
{
|
|
1684
|
-
kind: "functionDeclaration",
|
|
1685
|
-
name: "innerGen",
|
|
1686
|
-
parameters: [],
|
|
1687
|
-
returnType: {
|
|
1688
|
-
kind: "referenceType",
|
|
1689
|
-
name: "Generator",
|
|
1690
|
-
typeArguments: [{ kind: "primitiveType", name: "number" }],
|
|
1691
|
-
},
|
|
1692
|
-
body: {
|
|
1693
|
-
kind: "blockStatement",
|
|
1694
|
-
statements: [
|
|
1695
|
-
{
|
|
1696
|
-
kind: "expressionStatement",
|
|
1697
|
-
expression: createYield({ kind: "literal", value: 1 }),
|
|
1698
|
-
},
|
|
1699
|
-
],
|
|
1700
|
-
},
|
|
1701
|
-
isAsync: false,
|
|
1702
|
-
isGenerator: true,
|
|
1703
|
-
isExported: false,
|
|
1704
|
-
},
|
|
1705
|
-
],
|
|
1706
|
-
},
|
|
1707
|
-
isAsync: false,
|
|
1708
|
-
isGenerator: false,
|
|
1709
|
-
isExported: true,
|
|
1710
|
-
},
|
|
1711
|
-
],
|
|
1712
|
-
exports: [],
|
|
1713
|
-
};
|
|
1714
|
-
const result = runYieldLoweringPass([module]);
|
|
1715
|
-
expect(result.ok).to.be.true;
|
|
1716
|
-
// The inner generator should have its yield transformed
|
|
1717
|
-
const outerFunc = result.modules[0]?.body[0];
|
|
1718
|
-
const innerFunc = outerFunc.body.statements[0];
|
|
1719
|
-
expect(innerFunc.body.statements[0]?.kind).to.equal("yieldStatement");
|
|
1720
|
-
});
|
|
1721
|
-
});
|
|
1722
|
-
describe("Multiple Modules", () => {
|
|
1723
|
-
it("should process multiple modules independently", () => {
|
|
1724
|
-
const module1 = createGeneratorModule([
|
|
1725
|
-
{
|
|
1726
|
-
kind: "expressionStatement",
|
|
1727
|
-
expression: createYield({ kind: "literal", value: 1 }),
|
|
1728
|
-
},
|
|
1729
|
-
]);
|
|
1730
|
-
const module2 = createGeneratorModule([
|
|
1731
|
-
{
|
|
1732
|
-
kind: "expressionStatement",
|
|
1733
|
-
expression: createYield({ kind: "literal", value: 2 }),
|
|
1734
|
-
},
|
|
1735
|
-
]);
|
|
1736
|
-
const result = runYieldLoweringPass([module1, module2]);
|
|
1737
|
-
expect(result.ok).to.be.true;
|
|
1738
|
-
expect(result.modules).to.have.length(2);
|
|
1739
|
-
const body1 = getGeneratorBody(assertDefined(result.modules[0]));
|
|
1740
|
-
const body2 = getGeneratorBody(assertDefined(result.modules[1]));
|
|
1741
|
-
expect(body1[0]?.kind).to.equal("yieldStatement");
|
|
1742
|
-
expect(body2[0]?.kind).to.equal("yieldStatement");
|
|
1743
|
-
});
|
|
1744
|
-
it("should collect diagnostics from all modules", () => {
|
|
1745
|
-
const module1 = createGeneratorModule([
|
|
1746
|
-
{
|
|
1747
|
-
kind: "returnStatement",
|
|
1748
|
-
expression: {
|
|
1749
|
-
kind: "binary",
|
|
1750
|
-
operator: "+",
|
|
1751
|
-
left: createYield({ kind: "literal", value: 1 }),
|
|
1752
|
-
right: { kind: "literal", value: 2 },
|
|
1753
|
-
},
|
|
1754
|
-
},
|
|
1755
|
-
]);
|
|
1756
|
-
const module2 = createGeneratorModule([
|
|
1757
|
-
{
|
|
1758
|
-
kind: "throwStatement",
|
|
1759
|
-
expression: {
|
|
1760
|
-
kind: "call",
|
|
1761
|
-
callee: { kind: "identifier", name: "wrap" },
|
|
1762
|
-
arguments: [createYield({ kind: "identifier", name: "err" })],
|
|
1763
|
-
isOptional: false,
|
|
1764
|
-
},
|
|
1765
|
-
},
|
|
1766
|
-
]);
|
|
1767
|
-
const result = runYieldLoweringPass([module1, module2]);
|
|
1768
|
-
expect(result.ok).to.be.true;
|
|
1769
|
-
expect(result.diagnostics).to.have.length(0);
|
|
1770
|
-
});
|
|
1771
|
-
});
|
|
1772
|
-
describe("Pipeline Contract: No Yield Expressions After Lowering", () => {
|
|
1773
|
-
/**
|
|
1774
|
-
* Helper to recursively check if any IrYieldExpression nodes remain in the IR
|
|
1775
|
-
* Uses a simple approach that doesn't require exhaustive type coverage
|
|
1776
|
-
*/
|
|
1777
|
-
const containsYieldExpression = (node) => {
|
|
1778
|
-
if (!node || typeof node !== "object")
|
|
1779
|
-
return false;
|
|
1780
|
-
const obj = node;
|
|
1781
|
-
// Check for yield expression directly
|
|
1782
|
-
if (obj.kind === "yield") {
|
|
1783
|
-
return true;
|
|
1784
|
-
}
|
|
1785
|
-
// Check common container fields
|
|
1786
|
-
if (obj.statements && Array.isArray(obj.statements)) {
|
|
1787
|
-
return obj.statements.some(containsYieldExpression);
|
|
1788
|
-
}
|
|
1789
|
-
if (obj.expression) {
|
|
1790
|
-
return containsYieldExpression(obj.expression);
|
|
1791
|
-
}
|
|
1792
|
-
if (obj.declarations && Array.isArray(obj.declarations)) {
|
|
1793
|
-
return obj.declarations.some((d) => containsYieldExpression(d.initializer));
|
|
1794
|
-
}
|
|
1795
|
-
if (obj.body) {
|
|
1796
|
-
return containsYieldExpression(obj.body);
|
|
1797
|
-
}
|
|
1798
|
-
if (obj.condition) {
|
|
1799
|
-
if (containsYieldExpression(obj.condition))
|
|
1800
|
-
return true;
|
|
1801
|
-
}
|
|
1802
|
-
if (obj.consequent) {
|
|
1803
|
-
if (containsYieldExpression(obj.consequent))
|
|
1804
|
-
return true;
|
|
1805
|
-
}
|
|
1806
|
-
if (obj.alternate) {
|
|
1807
|
-
if (containsYieldExpression(obj.alternate))
|
|
1808
|
-
return true;
|
|
1809
|
-
}
|
|
1810
|
-
if (obj.left) {
|
|
1811
|
-
if (containsYieldExpression(obj.left))
|
|
1812
|
-
return true;
|
|
1813
|
-
}
|
|
1814
|
-
if (obj.right) {
|
|
1815
|
-
if (containsYieldExpression(obj.right))
|
|
1816
|
-
return true;
|
|
1817
|
-
}
|
|
1818
|
-
if (obj.arguments && Array.isArray(obj.arguments)) {
|
|
1819
|
-
if (obj.arguments.some(containsYieldExpression))
|
|
1820
|
-
return true;
|
|
1821
|
-
}
|
|
1822
|
-
if (obj.callee) {
|
|
1823
|
-
if (containsYieldExpression(obj.callee))
|
|
1824
|
-
return true;
|
|
1825
|
-
}
|
|
1826
|
-
return false;
|
|
1827
|
-
};
|
|
1828
|
-
it("should transform ALL yield expressions in generator function body", () => {
|
|
1829
|
-
const module = createGeneratorModule([
|
|
1830
|
-
// Multiple yield patterns
|
|
1831
|
-
{
|
|
1832
|
-
kind: "expressionStatement",
|
|
1833
|
-
expression: createYield({ kind: "literal", value: 1 }),
|
|
1834
|
-
},
|
|
1835
|
-
{
|
|
1836
|
-
kind: "variableDeclaration",
|
|
1837
|
-
declarationKind: "const",
|
|
1838
|
-
isExported: false,
|
|
1839
|
-
declarations: [
|
|
1840
|
-
{
|
|
1841
|
-
kind: "variableDeclarator",
|
|
1842
|
-
name: { kind: "identifierPattern", name: "x" },
|
|
1843
|
-
initializer: createYield({ kind: "literal", value: 2 }),
|
|
1844
|
-
},
|
|
1845
|
-
],
|
|
1846
|
-
},
|
|
1847
|
-
{
|
|
1848
|
-
kind: "whileStatement",
|
|
1849
|
-
condition: { kind: "literal", value: true },
|
|
1850
|
-
body: {
|
|
1851
|
-
kind: "blockStatement",
|
|
1852
|
-
statements: [
|
|
1853
|
-
{
|
|
1854
|
-
kind: "expressionStatement",
|
|
1855
|
-
expression: createYield({ kind: "literal", value: 3 }),
|
|
1856
|
-
},
|
|
1857
|
-
],
|
|
1858
|
-
},
|
|
1859
|
-
},
|
|
1860
|
-
]);
|
|
1861
|
-
const result = runYieldLoweringPass([module]);
|
|
1862
|
-
expect(result.ok).to.be.true;
|
|
1863
|
-
// Verify no yield expressions remain
|
|
1864
|
-
const func = result.modules[0]?.body[0];
|
|
1865
|
-
const hasYieldExpr = containsYieldExpression(func.body);
|
|
1866
|
-
expect(hasYieldExpr).to.be.false;
|
|
1867
|
-
});
|
|
1868
|
-
it("should leave yield expressions in non-generator functions unchanged", () => {
|
|
1869
|
-
// Non-generator function with yield (would be invalid TS but pass handles gracefully)
|
|
1870
|
-
const module = createGeneratorModule([
|
|
1871
|
-
{
|
|
1872
|
-
kind: "expressionStatement",
|
|
1873
|
-
expression: createYield({ kind: "literal", value: 1 }),
|
|
1874
|
-
},
|
|
1875
|
-
], { isGenerator: false });
|
|
1876
|
-
const result = runYieldLoweringPass([module]);
|
|
1877
|
-
expect(result.ok).to.be.true;
|
|
1878
|
-
// Yield expression SHOULD remain in non-generator
|
|
1879
|
-
const func = result.modules[0]?.body[0];
|
|
1880
|
-
const hasYieldExpr = containsYieldExpression(func.body);
|
|
1881
|
-
expect(hasYieldExpr).to.be.true;
|
|
1882
|
-
});
|
|
1883
|
-
});
|
|
1884
|
-
describe("Generator Return Statement Transformation", () => {
|
|
1885
|
-
it("should transform return statements in generators to generatorReturnStatement", () => {
|
|
1886
|
-
const module = createGeneratorModule([
|
|
1887
|
-
{
|
|
1888
|
-
kind: "expressionStatement",
|
|
1889
|
-
expression: createYield({ kind: "literal", value: 1 }),
|
|
1890
|
-
},
|
|
1891
|
-
{
|
|
1892
|
-
kind: "returnStatement",
|
|
1893
|
-
expression: { kind: "literal", value: "done" },
|
|
1894
|
-
},
|
|
1895
|
-
]);
|
|
1896
|
-
const result = runYieldLoweringPass([module]);
|
|
1897
|
-
expect(result.ok).to.be.true;
|
|
1898
|
-
const func = result.modules[0]?.body[0];
|
|
1899
|
-
const body = func.body.statements;
|
|
1900
|
-
// First statement should be yieldStatement
|
|
1901
|
-
expect(body[0]?.kind).to.equal("yieldStatement");
|
|
1902
|
-
// Second statement should be generatorReturnStatement
|
|
1903
|
-
expect(body[1]?.kind).to.equal("generatorReturnStatement");
|
|
1904
|
-
const genReturn = body[1];
|
|
1905
|
-
expect(genReturn.expression?.kind).to.equal("literal");
|
|
1906
|
-
expect(genReturn.expression.value).to.equal("done");
|
|
1907
|
-
});
|
|
1908
|
-
it("should transform bare return statements (no expression) to generatorReturnStatement", () => {
|
|
1909
|
-
const module = createGeneratorModule([
|
|
1910
|
-
{
|
|
1911
|
-
kind: "expressionStatement",
|
|
1912
|
-
expression: createYield({ kind: "literal", value: 1 }),
|
|
1913
|
-
},
|
|
1914
|
-
{
|
|
1915
|
-
kind: "returnStatement",
|
|
1916
|
-
expression: undefined,
|
|
1917
|
-
},
|
|
1918
|
-
]);
|
|
1919
|
-
const result = runYieldLoweringPass([module]);
|
|
1920
|
-
expect(result.ok).to.be.true;
|
|
1921
|
-
const func = result.modules[0]?.body[0];
|
|
1922
|
-
const body = func.body.statements;
|
|
1923
|
-
// Second statement should be generatorReturnStatement with no expression
|
|
1924
|
-
expect(body[1]?.kind).to.equal("generatorReturnStatement");
|
|
1925
|
-
const genReturn = body[1];
|
|
1926
|
-
expect(genReturn.expression).to.be.undefined;
|
|
1927
|
-
});
|
|
1928
|
-
it("should transform return statements inside nested control flow", () => {
|
|
1929
|
-
const module = createGeneratorModule([
|
|
1930
|
-
{
|
|
1931
|
-
kind: "ifStatement",
|
|
1932
|
-
condition: { kind: "identifier", name: "cond" },
|
|
1933
|
-
thenStatement: {
|
|
1934
|
-
kind: "blockStatement",
|
|
1935
|
-
statements: [
|
|
1936
|
-
{
|
|
1937
|
-
kind: "returnStatement",
|
|
1938
|
-
expression: { kind: "literal", value: "early" },
|
|
1939
|
-
},
|
|
1940
|
-
],
|
|
1941
|
-
},
|
|
1942
|
-
},
|
|
1943
|
-
{
|
|
1944
|
-
kind: "returnStatement",
|
|
1945
|
-
expression: { kind: "literal", value: "done" },
|
|
1946
|
-
},
|
|
1947
|
-
]);
|
|
1948
|
-
const result = runYieldLoweringPass([module]);
|
|
1949
|
-
expect(result.ok).to.be.true;
|
|
1950
|
-
const func = result.modules[0]?.body[0];
|
|
1951
|
-
const body = func.body.statements;
|
|
1952
|
-
// Check if statement then branch contains generatorReturnStatement
|
|
1953
|
-
const ifStmt = body[0];
|
|
1954
|
-
const thenBlock = ifStmt.thenStatement;
|
|
1955
|
-
expect(thenBlock.statements[0]?.kind).to.equal("generatorReturnStatement");
|
|
1956
|
-
// Final return also transformed
|
|
1957
|
-
expect(body[1]?.kind).to.equal("generatorReturnStatement");
|
|
1958
|
-
});
|
|
1959
|
-
it("should NOT transform return statements in non-generator functions", () => {
|
|
1960
|
-
// Non-generator function
|
|
1961
|
-
const module = createGeneratorModule([
|
|
1962
|
-
{
|
|
1963
|
-
kind: "returnStatement",
|
|
1964
|
-
expression: { kind: "literal", value: "result" },
|
|
1965
|
-
},
|
|
1966
|
-
], { isGenerator: false });
|
|
1967
|
-
const result = runYieldLoweringPass([module]);
|
|
1968
|
-
expect(result.ok).to.be.true;
|
|
1969
|
-
const func = result.modules[0]?.body[0];
|
|
1970
|
-
const body = func.body.statements;
|
|
1971
|
-
// Return statement should remain as returnStatement (not transformed)
|
|
1972
|
-
expect(body[0]?.kind).to.equal("returnStatement");
|
|
1973
|
-
});
|
|
1974
|
-
});
|
|
1975
|
-
});
|
|
1
|
+
import "./yield-lowering-cases/assignment-yield.test.js";
|
|
2
|
+
import "./yield-lowering-cases/basic-yield.test.js";
|
|
3
|
+
import "./yield-lowering-cases/control-flow.test.js";
|
|
4
|
+
import "./yield-lowering-cases/destructuring-and-unsupported.test.js";
|
|
5
|
+
import "./yield-lowering-cases/for-loop-initializer.test.js";
|
|
6
|
+
import "./yield-lowering-cases/nested-yield-in-statements.test.js";
|
|
7
|
+
import "./yield-lowering-cases/non-generator-and-modules.test.js";
|
|
8
|
+
import "./yield-lowering-cases/pipeline-contract-and-return.test.js";
|
|
1976
9
|
//# sourceMappingURL=yield-lowering-pass.test.js.map
|