@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
|
@@ -0,0 +1,1990 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IR Builder tests: JS surface helpers - global bindings, regex, spread arrays
|
|
3
|
+
*/
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
|
5
|
+
import { describe, it } from "mocha";
|
|
6
|
+
import { expect } from "chai";
|
|
7
|
+
import * as fs from "node:fs";
|
|
8
|
+
import * as os from "node:os";
|
|
9
|
+
import * as path from "node:path";
|
|
10
|
+
import { fileURLToPath } from "node:url";
|
|
11
|
+
import { buildIrModule } from "../builder.js";
|
|
12
|
+
import { runAnonymousTypeLoweringPass, runCallResolutionRefreshPass, runNumericProofPass, } from "../validation/index.js";
|
|
13
|
+
import { createProgram, createProgramContext } from "./_test-helpers.js";
|
|
14
|
+
import { materializeFrontendFixture } from "../../testing/filesystem-fixtures.js";
|
|
15
|
+
const currentFileDir = path.dirname(fileURLToPath(import.meta.url));
|
|
16
|
+
const repoRoot = path.resolve(currentFileDir, "../../../../..");
|
|
17
|
+
const repoGlobalsRoot = path.resolve(repoRoot, "../globals/versions/10");
|
|
18
|
+
const repoCoreRoot = path.resolve(repoRoot, "../core/versions/10");
|
|
19
|
+
const installRepoPackage = (tempDir, packageName, sourceRoot) => {
|
|
20
|
+
const packageRoot = path.join(tempDir, "node_modules", ...packageName.split("/"));
|
|
21
|
+
fs.mkdirSync(path.dirname(packageRoot), { recursive: true });
|
|
22
|
+
fs.cpSync(sourceRoot, packageRoot, { recursive: true });
|
|
23
|
+
};
|
|
24
|
+
const installMinimalClrRoots = (tempDir) => {
|
|
25
|
+
installRepoPackage(tempDir, "@tsonic/globals", repoGlobalsRoot);
|
|
26
|
+
installRepoPackage(tempDir, "@tsonic/core", repoCoreRoot);
|
|
27
|
+
};
|
|
28
|
+
const writeFixtureJsSurface = (tempDir, exportEntries, sourceFiles, ambientSource) => {
|
|
29
|
+
installMinimalClrRoots(tempDir);
|
|
30
|
+
const surfaceRoot = path.join(tempDir, "node_modules", "@fixture", "js");
|
|
31
|
+
fs.mkdirSync(path.join(surfaceRoot, "src"), { recursive: true });
|
|
32
|
+
fs.writeFileSync(path.join(surfaceRoot, "package.json"), JSON.stringify({ name: "@fixture/js", version: "1.0.0", type: "module" }, null, 2));
|
|
33
|
+
fs.writeFileSync(path.join(surfaceRoot, "tsonic.surface.json"), JSON.stringify({
|
|
34
|
+
schemaVersion: 1,
|
|
35
|
+
id: "@fixture/js",
|
|
36
|
+
extends: ["clr"],
|
|
37
|
+
requiredTypeRoots: ["."],
|
|
38
|
+
}, null, 2));
|
|
39
|
+
fs.writeFileSync(path.join(surfaceRoot, "globals.ts"), ambientSource);
|
|
40
|
+
fs.writeFileSync(path.join(surfaceRoot, "tsonic.package.json"), JSON.stringify({
|
|
41
|
+
schemaVersion: 1,
|
|
42
|
+
kind: "tsonic-source-package",
|
|
43
|
+
surfaces: ["@fixture/js"],
|
|
44
|
+
source: {
|
|
45
|
+
namespace: "fixture.js",
|
|
46
|
+
ambient: ["./globals.ts"],
|
|
47
|
+
exports: exportEntries,
|
|
48
|
+
},
|
|
49
|
+
}, null, 2));
|
|
50
|
+
for (const [relativePath, contents] of Object.entries(sourceFiles)) {
|
|
51
|
+
const absolutePath = path.join(surfaceRoot, relativePath);
|
|
52
|
+
fs.mkdirSync(path.dirname(absolutePath), { recursive: true });
|
|
53
|
+
fs.writeFileSync(absolutePath, contents);
|
|
54
|
+
}
|
|
55
|
+
return surfaceRoot;
|
|
56
|
+
};
|
|
57
|
+
const materializeJsSurfaceHelpersFixture = (fixtureNames) => materializeFrontendFixture((Array.isArray(fixtureNames) ? fixtureNames : [fixtureNames]).map((fixtureName) => fixtureName.startsWith("fragments/")
|
|
58
|
+
? fixtureName
|
|
59
|
+
: `ir/js-surface-helpers/${fixtureName}`));
|
|
60
|
+
describe("IR Builder", function () {
|
|
61
|
+
this.timeout(90000);
|
|
62
|
+
describe("JS surface helpers", () => {
|
|
63
|
+
it("attaches explicit computed-access protocol for class index signatures with at/set", () => {
|
|
64
|
+
const fixture = materializeJsSurfaceHelpersFixture([
|
|
65
|
+
"fragments/module-bindings/basic-fixture-js-surface",
|
|
66
|
+
"regexp-surface",
|
|
67
|
+
"computed-access-protocol",
|
|
68
|
+
]);
|
|
69
|
+
try {
|
|
70
|
+
const projectRoot = fixture.path("app");
|
|
71
|
+
const srcDir = fixture.path("app/src");
|
|
72
|
+
const entryPath = fixture.path("app/src/index.ts");
|
|
73
|
+
const programResult = createProgram([entryPath], {
|
|
74
|
+
projectRoot,
|
|
75
|
+
sourceRoot: srcDir,
|
|
76
|
+
rootNamespace: "TestApp",
|
|
77
|
+
surface: "@fixture/js",
|
|
78
|
+
});
|
|
79
|
+
expect(programResult.ok).to.equal(true);
|
|
80
|
+
if (!programResult.ok)
|
|
81
|
+
return;
|
|
82
|
+
const program = programResult.value;
|
|
83
|
+
const sourceFile = program.sourceFiles.find((file) => path.resolve(file.fileName) === path.resolve(entryPath));
|
|
84
|
+
expect(sourceFile).to.not.equal(undefined);
|
|
85
|
+
if (!sourceFile)
|
|
86
|
+
return;
|
|
87
|
+
const ctx = createProgramContext(program, {
|
|
88
|
+
sourceRoot: srcDir,
|
|
89
|
+
rootNamespace: "TestApp",
|
|
90
|
+
});
|
|
91
|
+
const moduleResult = buildIrModule(sourceFile, program, {
|
|
92
|
+
sourceRoot: srcDir,
|
|
93
|
+
rootNamespace: "TestApp",
|
|
94
|
+
}, ctx);
|
|
95
|
+
expect(moduleResult.ok).to.equal(true);
|
|
96
|
+
if (!moduleResult.ok)
|
|
97
|
+
return;
|
|
98
|
+
const vecClass = moduleResult.value.body.find((stmt) => stmt.kind === "classDeclaration" && stmt.name === "Vec");
|
|
99
|
+
expect(vecClass).to.not.equal(undefined);
|
|
100
|
+
if (!vecClass || vecClass.kind !== "classDeclaration")
|
|
101
|
+
return;
|
|
102
|
+
const readMethod = vecClass.members.find((member) => member.kind === "methodDeclaration" && member.name === "read");
|
|
103
|
+
expect(readMethod).to.not.equal(undefined);
|
|
104
|
+
if (!readMethod ||
|
|
105
|
+
readMethod.kind !== "methodDeclaration" ||
|
|
106
|
+
!readMethod.body)
|
|
107
|
+
return;
|
|
108
|
+
const readReturn = readMethod.body.statements[0];
|
|
109
|
+
expect(readReturn?.kind).to.equal("returnStatement");
|
|
110
|
+
if (!readReturn || readReturn.kind !== "returnStatement")
|
|
111
|
+
return;
|
|
112
|
+
const readExpr = readReturn.expression;
|
|
113
|
+
expect(readExpr?.kind).to.equal("memberAccess");
|
|
114
|
+
if (!readExpr || readExpr.kind !== "memberAccess")
|
|
115
|
+
return;
|
|
116
|
+
expect(readExpr.isComputed).to.equal(true);
|
|
117
|
+
expect(readExpr.accessProtocol).to.deep.equal({
|
|
118
|
+
getterMember: "at",
|
|
119
|
+
setterMember: "set",
|
|
120
|
+
});
|
|
121
|
+
const writeMethod = vecClass.members.find((member) => member.kind === "methodDeclaration" && member.name === "write");
|
|
122
|
+
expect(writeMethod).to.not.equal(undefined);
|
|
123
|
+
if (!writeMethod ||
|
|
124
|
+
writeMethod.kind !== "methodDeclaration" ||
|
|
125
|
+
!writeMethod.body)
|
|
126
|
+
return;
|
|
127
|
+
const writeExprStmt = writeMethod.body.statements[0];
|
|
128
|
+
expect(writeExprStmt?.kind).to.equal("expressionStatement");
|
|
129
|
+
if (!writeExprStmt || writeExprStmt.kind !== "expressionStatement")
|
|
130
|
+
return;
|
|
131
|
+
const writeExpr = writeExprStmt.expression;
|
|
132
|
+
expect(writeExpr.kind).to.equal("assignment");
|
|
133
|
+
if (writeExpr.kind !== "assignment")
|
|
134
|
+
return;
|
|
135
|
+
expect(writeExpr.left.kind).to.equal("memberAccess");
|
|
136
|
+
if (writeExpr.left.kind !== "memberAccess")
|
|
137
|
+
return;
|
|
138
|
+
expect(writeExpr.left.accessProtocol).to.deep.equal({
|
|
139
|
+
getterMember: "at",
|
|
140
|
+
setterMember: "set",
|
|
141
|
+
});
|
|
142
|
+
const holderClass = moduleResult.value.body.find((stmt) => stmt.kind === "classDeclaration" && stmt.name === "Holder");
|
|
143
|
+
expect(holderClass).to.not.equal(undefined);
|
|
144
|
+
if (!holderClass || holderClass.kind !== "classDeclaration")
|
|
145
|
+
return;
|
|
146
|
+
const holderReadMethod = holderClass.members.find((member) => member.kind === "methodDeclaration" && member.name === "read");
|
|
147
|
+
expect(holderReadMethod).to.not.equal(undefined);
|
|
148
|
+
if (!holderReadMethod ||
|
|
149
|
+
holderReadMethod.kind !== "methodDeclaration" ||
|
|
150
|
+
!holderReadMethod.body)
|
|
151
|
+
return;
|
|
152
|
+
const holderReadStmt = holderReadMethod.body.statements[0];
|
|
153
|
+
expect(holderReadStmt?.kind).to.equal("returnStatement");
|
|
154
|
+
if (!holderReadStmt || holderReadStmt.kind !== "returnStatement")
|
|
155
|
+
return;
|
|
156
|
+
const holderReadExpr = holderReadStmt.expression;
|
|
157
|
+
expect(holderReadExpr?.kind).to.equal("memberAccess");
|
|
158
|
+
if (!holderReadExpr || holderReadExpr.kind !== "memberAccess")
|
|
159
|
+
return;
|
|
160
|
+
expect(holderReadExpr.isComputed).to.equal(true);
|
|
161
|
+
expect(holderReadExpr.accessProtocol).to.deep.equal({
|
|
162
|
+
getterMember: "at",
|
|
163
|
+
setterMember: "set",
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
finally {
|
|
167
|
+
fixture.cleanup();
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
it("attaches explicit computed-access protocol through inherited class index signatures with at/set", () => {
|
|
171
|
+
const fixture = materializeJsSurfaceHelpersFixture([
|
|
172
|
+
"fragments/module-bindings/basic-fixture-js-surface",
|
|
173
|
+
"regexp-surface",
|
|
174
|
+
"inherited-computed-access-protocol",
|
|
175
|
+
]);
|
|
176
|
+
try {
|
|
177
|
+
const projectRoot = fixture.path("app");
|
|
178
|
+
const srcDir = fixture.path("app/src");
|
|
179
|
+
const entryPath = fixture.path("app/src/index.ts");
|
|
180
|
+
const programResult = createProgram([entryPath], {
|
|
181
|
+
projectRoot,
|
|
182
|
+
sourceRoot: srcDir,
|
|
183
|
+
rootNamespace: "TestApp",
|
|
184
|
+
surface: "@fixture/js",
|
|
185
|
+
});
|
|
186
|
+
expect(programResult.ok).to.equal(true);
|
|
187
|
+
if (!programResult.ok)
|
|
188
|
+
return;
|
|
189
|
+
const program = programResult.value;
|
|
190
|
+
const sourceFile = program.sourceFiles.find((file) => path.resolve(file.fileName) === path.resolve(entryPath));
|
|
191
|
+
expect(sourceFile).to.not.equal(undefined);
|
|
192
|
+
if (!sourceFile)
|
|
193
|
+
return;
|
|
194
|
+
const ctx = createProgramContext(program, {
|
|
195
|
+
sourceRoot: srcDir,
|
|
196
|
+
rootNamespace: "TestApp",
|
|
197
|
+
});
|
|
198
|
+
const moduleResult = buildIrModule(sourceFile, program, {
|
|
199
|
+
sourceRoot: srcDir,
|
|
200
|
+
rootNamespace: "TestApp",
|
|
201
|
+
}, ctx);
|
|
202
|
+
expect(moduleResult.ok).to.equal(true);
|
|
203
|
+
if (!moduleResult.ok)
|
|
204
|
+
return;
|
|
205
|
+
const holderClass = moduleResult.value.body.find((stmt) => stmt.kind === "classDeclaration" && stmt.name === "Holder");
|
|
206
|
+
expect(holderClass).to.not.equal(undefined);
|
|
207
|
+
if (!holderClass || holderClass.kind !== "classDeclaration")
|
|
208
|
+
return;
|
|
209
|
+
const holderReadMethod = holderClass.members.find((member) => member.kind === "methodDeclaration" && member.name === "read");
|
|
210
|
+
expect(holderReadMethod).to.not.equal(undefined);
|
|
211
|
+
if (!holderReadMethod ||
|
|
212
|
+
holderReadMethod.kind !== "methodDeclaration" ||
|
|
213
|
+
!holderReadMethod.body) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
const holderReadStmt = holderReadMethod.body.statements[0];
|
|
217
|
+
expect(holderReadStmt?.kind).to.equal("returnStatement");
|
|
218
|
+
if (!holderReadStmt || holderReadStmt.kind !== "returnStatement")
|
|
219
|
+
return;
|
|
220
|
+
const holderReadExpr = holderReadStmt.expression;
|
|
221
|
+
expect(holderReadExpr?.kind).to.equal("memberAccess");
|
|
222
|
+
if (!holderReadExpr || holderReadExpr.kind !== "memberAccess")
|
|
223
|
+
return;
|
|
224
|
+
expect(holderReadExpr.isComputed).to.equal(true);
|
|
225
|
+
expect(holderReadExpr.accessProtocol).to.deep.equal({
|
|
226
|
+
getterMember: "at",
|
|
227
|
+
setterMember: "set",
|
|
228
|
+
});
|
|
229
|
+
const holderWriteMethod = holderClass.members.find((member) => member.kind === "methodDeclaration" && member.name === "write");
|
|
230
|
+
expect(holderWriteMethod).to.not.equal(undefined);
|
|
231
|
+
if (!holderWriteMethod ||
|
|
232
|
+
holderWriteMethod.kind !== "methodDeclaration" ||
|
|
233
|
+
!holderWriteMethod.body) {
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
const holderWriteStmt = holderWriteMethod.body.statements[0];
|
|
237
|
+
expect(holderWriteStmt?.kind).to.equal("expressionStatement");
|
|
238
|
+
if (!holderWriteStmt ||
|
|
239
|
+
holderWriteStmt.kind !== "expressionStatement") {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
const holderWriteExpr = holderWriteStmt.expression;
|
|
243
|
+
expect(holderWriteExpr.kind).to.equal("assignment");
|
|
244
|
+
if (holderWriteExpr.kind !== "assignment")
|
|
245
|
+
return;
|
|
246
|
+
expect(holderWriteExpr.left.kind).to.equal("memberAccess");
|
|
247
|
+
if (holderWriteExpr.left.kind !== "memberAccess")
|
|
248
|
+
return;
|
|
249
|
+
expect(holderWriteExpr.left.accessProtocol).to.deep.equal({
|
|
250
|
+
getterMember: "at",
|
|
251
|
+
setterMember: "set",
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
finally {
|
|
255
|
+
fixture.cleanup();
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
it("attaches computed-access protocol for imported class index signatures with at/set", () => {
|
|
259
|
+
const fixture = materializeJsSurfaceHelpersFixture([
|
|
260
|
+
"fragments/installed-source-deterministic/minimal-core-types",
|
|
261
|
+
"imported-buffer-computed-access",
|
|
262
|
+
]);
|
|
263
|
+
try {
|
|
264
|
+
const projectRoot = fixture.path("app");
|
|
265
|
+
const sourceRoot = fixture.path("app/src");
|
|
266
|
+
const entryPath = fixture.path("app/src/index.ts");
|
|
267
|
+
const programResult = createProgram([entryPath], {
|
|
268
|
+
projectRoot,
|
|
269
|
+
sourceRoot,
|
|
270
|
+
rootNamespace: "TestApp",
|
|
271
|
+
});
|
|
272
|
+
expect(programResult.ok).to.equal(true);
|
|
273
|
+
if (!programResult.ok)
|
|
274
|
+
return;
|
|
275
|
+
const result = buildIrModule(programResult.value.sourceFiles.find((file) => path.resolve(file.fileName) === path.resolve(entryPath)), programResult.value, {
|
|
276
|
+
sourceRoot,
|
|
277
|
+
rootNamespace: "TestApp",
|
|
278
|
+
}, createProgramContext(programResult.value, {
|
|
279
|
+
sourceRoot,
|
|
280
|
+
rootNamespace: "TestApp",
|
|
281
|
+
}));
|
|
282
|
+
expect(result.ok).to.equal(true);
|
|
283
|
+
if (!result.ok)
|
|
284
|
+
return;
|
|
285
|
+
const readerClass = result.value.body.find((stmt) => stmt.kind === "classDeclaration" && stmt.name === "Reader");
|
|
286
|
+
expect(readerClass).to.not.equal(undefined);
|
|
287
|
+
if (!readerClass || readerClass.kind !== "classDeclaration")
|
|
288
|
+
return;
|
|
289
|
+
const readMethod = readerClass.members.find((member) => member.kind === "methodDeclaration" && member.name === "read");
|
|
290
|
+
expect(readMethod).to.not.equal(undefined);
|
|
291
|
+
if (!readMethod ||
|
|
292
|
+
readMethod.kind !== "methodDeclaration" ||
|
|
293
|
+
!readMethod.body) {
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
const readReturn = readMethod.body.statements[0];
|
|
297
|
+
expect(readReturn?.kind).to.equal("returnStatement");
|
|
298
|
+
if (!readReturn || readReturn.kind !== "returnStatement")
|
|
299
|
+
return;
|
|
300
|
+
const readExpr = readReturn.expression;
|
|
301
|
+
expect(readExpr?.kind).to.equal("memberAccess");
|
|
302
|
+
if (!readExpr || readExpr.kind !== "memberAccess")
|
|
303
|
+
return;
|
|
304
|
+
expect(readExpr.isComputed).to.equal(true);
|
|
305
|
+
expect(readExpr.accessProtocol).to.deep.equal({
|
|
306
|
+
getterMember: "at",
|
|
307
|
+
setterMember: "set",
|
|
308
|
+
});
|
|
309
|
+
const writeMethod = readerClass.members.find((member) => member.kind === "methodDeclaration" && member.name === "write");
|
|
310
|
+
expect(writeMethod).to.not.equal(undefined);
|
|
311
|
+
if (!writeMethod ||
|
|
312
|
+
writeMethod.kind !== "methodDeclaration" ||
|
|
313
|
+
!writeMethod.body) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
const writeExprStmt = writeMethod.body.statements[0];
|
|
317
|
+
expect(writeExprStmt?.kind).to.equal("expressionStatement");
|
|
318
|
+
if (!writeExprStmt ||
|
|
319
|
+
writeExprStmt.kind !== "expressionStatement" ||
|
|
320
|
+
writeExprStmt.expression.kind !== "assignment" ||
|
|
321
|
+
writeExprStmt.expression.left.kind !== "memberAccess") {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
expect(writeExprStmt.expression.left.accessProtocol).to.deep.equal({
|
|
325
|
+
getterMember: "at",
|
|
326
|
+
setterMember: "set",
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
finally {
|
|
330
|
+
fixture.cleanup();
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
it("preserves imported core numeric aliases in installed source-package type annotations", () => {
|
|
334
|
+
const fixture = materializeJsSurfaceHelpersFixture([
|
|
335
|
+
"fragments/installed-source-deterministic/minimal-core-types",
|
|
336
|
+
"core-byte-alias-property",
|
|
337
|
+
]);
|
|
338
|
+
try {
|
|
339
|
+
const projectRoot = fixture.path("app");
|
|
340
|
+
const sourceRoot = fixture.path("app/src");
|
|
341
|
+
const entryPath = fixture.path("app/src/index.ts");
|
|
342
|
+
const programResult = createProgram([entryPath], {
|
|
343
|
+
projectRoot,
|
|
344
|
+
sourceRoot,
|
|
345
|
+
rootNamespace: "TestApp",
|
|
346
|
+
});
|
|
347
|
+
expect(programResult.ok).to.equal(true);
|
|
348
|
+
if (!programResult.ok)
|
|
349
|
+
return;
|
|
350
|
+
const result = buildIrModule(programResult.value.sourceFiles.find((file) => path.resolve(file.fileName) === path.resolve(entryPath)), programResult.value, {
|
|
351
|
+
sourceRoot,
|
|
352
|
+
rootNamespace: "TestApp",
|
|
353
|
+
}, createProgramContext(programResult.value, {
|
|
354
|
+
sourceRoot,
|
|
355
|
+
rootNamespace: "TestApp",
|
|
356
|
+
}));
|
|
357
|
+
expect(result.ok).to.equal(true);
|
|
358
|
+
if (!result.ok)
|
|
359
|
+
return;
|
|
360
|
+
const holderClass = result.value.body.find((stmt) => stmt.kind === "classDeclaration" && stmt.name === "Holder");
|
|
361
|
+
expect(holderClass).to.not.equal(undefined);
|
|
362
|
+
if (!holderClass || holderClass.kind !== "classDeclaration")
|
|
363
|
+
return;
|
|
364
|
+
const valueProperty = holderClass.members.find((member) => member.kind === "propertyDeclaration" && member.name === "value");
|
|
365
|
+
expect(valueProperty).to.not.equal(undefined);
|
|
366
|
+
if (!valueProperty || valueProperty.kind !== "propertyDeclaration") {
|
|
367
|
+
return;
|
|
368
|
+
}
|
|
369
|
+
expect(valueProperty.type?.kind).to.equal("referenceType");
|
|
370
|
+
if (!valueProperty.type ||
|
|
371
|
+
valueProperty.type.kind !== "referenceType") {
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
expect(valueProperty.type.name).to.equal("byte");
|
|
375
|
+
}
|
|
376
|
+
finally {
|
|
377
|
+
fixture.cleanup();
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
it("specializes inherited source-package method parameter types through global owner aliases", () => {
|
|
381
|
+
const fixture = materializeJsSurfaceHelpersFixture([
|
|
382
|
+
"fragments/module-bindings/basic-fixture-js-surface",
|
|
383
|
+
"typed-array-global-surface-basic",
|
|
384
|
+
"specializes-inherited-method-params",
|
|
385
|
+
]);
|
|
386
|
+
try {
|
|
387
|
+
const projectRoot = fixture.path("app");
|
|
388
|
+
const srcDir = fixture.path("app/src");
|
|
389
|
+
const entryPath = fixture.path("app/src/index.ts");
|
|
390
|
+
const programResult = createProgram([entryPath], {
|
|
391
|
+
projectRoot,
|
|
392
|
+
sourceRoot: srcDir,
|
|
393
|
+
rootNamespace: "TestApp",
|
|
394
|
+
surface: "@fixture/js",
|
|
395
|
+
});
|
|
396
|
+
expect(programResult.ok).to.equal(true);
|
|
397
|
+
if (!programResult.ok)
|
|
398
|
+
return;
|
|
399
|
+
const program = programResult.value;
|
|
400
|
+
const sourceFile = program.sourceFiles.find((file) => path.resolve(file.fileName) === path.resolve(entryPath));
|
|
401
|
+
expect(sourceFile).to.not.equal(undefined);
|
|
402
|
+
if (!sourceFile)
|
|
403
|
+
return;
|
|
404
|
+
const ctx = createProgramContext(program, {
|
|
405
|
+
sourceRoot: srcDir,
|
|
406
|
+
rootNamespace: "TestApp",
|
|
407
|
+
});
|
|
408
|
+
const moduleResult = buildIrModule(sourceFile, program, {
|
|
409
|
+
sourceRoot: srcDir,
|
|
410
|
+
rootNamespace: "TestApp",
|
|
411
|
+
}, ctx);
|
|
412
|
+
expect(moduleResult.ok).to.equal(true);
|
|
413
|
+
if (!moduleResult.ok)
|
|
414
|
+
return;
|
|
415
|
+
const fn = moduleResult.value.body.find((stmt) => stmt.kind === "functionDeclaration" && stmt.name === "main");
|
|
416
|
+
expect(fn).to.not.equal(undefined);
|
|
417
|
+
if (!fn)
|
|
418
|
+
return;
|
|
419
|
+
const callStmt = fn.body.statements[1];
|
|
420
|
+
expect(callStmt?.kind).to.equal("expressionStatement");
|
|
421
|
+
if (!callStmt || callStmt.kind !== "expressionStatement")
|
|
422
|
+
return;
|
|
423
|
+
const callExpr = callStmt.expression;
|
|
424
|
+
expect(callExpr.kind).to.equal("call");
|
|
425
|
+
if (callExpr.kind !== "call")
|
|
426
|
+
return;
|
|
427
|
+
const firstParameterType = callExpr.parameterTypes?.[0];
|
|
428
|
+
expect(firstParameterType).to.not.equal(undefined);
|
|
429
|
+
if (!firstParameterType)
|
|
430
|
+
return;
|
|
431
|
+
expect(JSON.stringify(firstParameterType)).to.not.include('"kind":"typeParameterType"');
|
|
432
|
+
expect(firstParameterType.kind).to.equal("unionType");
|
|
433
|
+
if (firstParameterType.kind !== "unionType")
|
|
434
|
+
return;
|
|
435
|
+
const [arrayMember, iterableMember] = firstParameterType.types;
|
|
436
|
+
expect(arrayMember?.kind).to.equal("arrayType");
|
|
437
|
+
expect(iterableMember?.kind).to.equal("referenceType");
|
|
438
|
+
if (!arrayMember || arrayMember.kind !== "arrayType")
|
|
439
|
+
return;
|
|
440
|
+
if (!iterableMember || iterableMember.kind !== "referenceType")
|
|
441
|
+
return;
|
|
442
|
+
expect(arrayMember.elementType).to.deep.equal({
|
|
443
|
+
kind: "primitiveType",
|
|
444
|
+
name: "number",
|
|
445
|
+
});
|
|
446
|
+
expect(iterableMember.name).to.equal("Iterable");
|
|
447
|
+
expect(iterableMember.typeArguments?.[0]).to.deep.equal({
|
|
448
|
+
kind: "primitiveType",
|
|
449
|
+
name: "number",
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
finally {
|
|
453
|
+
fixture.cleanup();
|
|
454
|
+
}
|
|
455
|
+
});
|
|
456
|
+
it("keeps inherited iterable overloads over numeric sibling overloads through global owner aliases", () => {
|
|
457
|
+
const fixture = materializeJsSurfaceHelpersFixture([
|
|
458
|
+
"fragments/module-bindings/basic-fixture-js-surface",
|
|
459
|
+
"typed-array-global-surface-overload",
|
|
460
|
+
"inherited-iterable-overloads",
|
|
461
|
+
]);
|
|
462
|
+
try {
|
|
463
|
+
const projectRoot = fixture.path("app");
|
|
464
|
+
const srcDir = fixture.path("app/src");
|
|
465
|
+
const entryPath = fixture.path("app/src/index.ts");
|
|
466
|
+
const programResult = createProgram([entryPath], {
|
|
467
|
+
projectRoot,
|
|
468
|
+
sourceRoot: srcDir,
|
|
469
|
+
rootNamespace: "TestApp",
|
|
470
|
+
surface: "@fixture/js",
|
|
471
|
+
});
|
|
472
|
+
expect(programResult.ok).to.equal(true);
|
|
473
|
+
if (!programResult.ok)
|
|
474
|
+
return;
|
|
475
|
+
const program = programResult.value;
|
|
476
|
+
const sourceFile = program.sourceFiles.find((file) => path.resolve(file.fileName) === path.resolve(entryPath));
|
|
477
|
+
expect(sourceFile).to.not.equal(undefined);
|
|
478
|
+
if (!sourceFile)
|
|
479
|
+
return;
|
|
480
|
+
const ctx = createProgramContext(program, {
|
|
481
|
+
sourceRoot: srcDir,
|
|
482
|
+
rootNamespace: "TestApp",
|
|
483
|
+
});
|
|
484
|
+
const moduleResult = buildIrModule(sourceFile, program, {
|
|
485
|
+
sourceRoot: srcDir,
|
|
486
|
+
rootNamespace: "TestApp",
|
|
487
|
+
}, ctx);
|
|
488
|
+
expect(moduleResult.ok).to.equal(true);
|
|
489
|
+
if (!moduleResult.ok)
|
|
490
|
+
return;
|
|
491
|
+
const fn = moduleResult.value.body.find((stmt) => stmt.kind === "functionDeclaration" && stmt.name === "main");
|
|
492
|
+
expect(fn).to.not.equal(undefined);
|
|
493
|
+
if (!fn)
|
|
494
|
+
return;
|
|
495
|
+
const callStmt = fn.body.statements[1];
|
|
496
|
+
expect(callStmt?.kind).to.equal("expressionStatement");
|
|
497
|
+
if (!callStmt || callStmt.kind !== "expressionStatement")
|
|
498
|
+
return;
|
|
499
|
+
const callExpr = callStmt.expression;
|
|
500
|
+
expect(callExpr.kind).to.equal("call");
|
|
501
|
+
if (callExpr.kind !== "call")
|
|
502
|
+
return;
|
|
503
|
+
const firstParameterType = callExpr.parameterTypes?.[0];
|
|
504
|
+
const secondParameterType = callExpr.parameterTypes?.[1];
|
|
505
|
+
const firstSurfaceParameterType = callExpr.surfaceParameterTypes?.[0];
|
|
506
|
+
const secondSurfaceParameterType = callExpr.surfaceParameterTypes?.[1];
|
|
507
|
+
expect(firstParameterType).to.not.deep.equal({
|
|
508
|
+
kind: "primitiveType",
|
|
509
|
+
name: "int",
|
|
510
|
+
});
|
|
511
|
+
expect(firstParameterType?.kind).to.equal("referenceType");
|
|
512
|
+
if (firstParameterType?.kind === "referenceType") {
|
|
513
|
+
expect(firstParameterType.name).to.equal("Iterable");
|
|
514
|
+
expect(firstParameterType.typeArguments).to.deep.equal([
|
|
515
|
+
{
|
|
516
|
+
kind: "primitiveType",
|
|
517
|
+
name: "number",
|
|
518
|
+
},
|
|
519
|
+
]);
|
|
520
|
+
}
|
|
521
|
+
expect(firstSurfaceParameterType?.kind).to.equal("referenceType");
|
|
522
|
+
if (firstSurfaceParameterType?.kind === "referenceType") {
|
|
523
|
+
expect(firstSurfaceParameterType.kind).to.equal("referenceType");
|
|
524
|
+
expect(firstSurfaceParameterType.name).to.equal("TypedArrayInput");
|
|
525
|
+
expect(firstSurfaceParameterType.typeArguments).to.have.length(1);
|
|
526
|
+
expect(firstSurfaceParameterType.typeArguments?.[0]).to.deep.include({
|
|
527
|
+
kind: "referenceType",
|
|
528
|
+
name: "byte",
|
|
529
|
+
});
|
|
530
|
+
expect(firstSurfaceParameterType.typeId?.tsName).to.equal("TypedArrayInput");
|
|
531
|
+
}
|
|
532
|
+
expect(secondParameterType).to.deep.equal({
|
|
533
|
+
kind: "unionType",
|
|
534
|
+
types: [
|
|
535
|
+
{
|
|
536
|
+
kind: "primitiveType",
|
|
537
|
+
name: "int",
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
kind: "primitiveType",
|
|
541
|
+
name: "undefined",
|
|
542
|
+
},
|
|
543
|
+
],
|
|
544
|
+
});
|
|
545
|
+
expect(secondSurfaceParameterType?.kind).to.equal("unionType");
|
|
546
|
+
if (secondSurfaceParameterType?.kind === "unionType") {
|
|
547
|
+
expect(secondSurfaceParameterType.types).to.have.length(2);
|
|
548
|
+
expect(secondSurfaceParameterType.types.some((candidate) => candidate.kind === "primitiveType" && candidate.name === "int")).to.equal(true);
|
|
549
|
+
expect(secondSurfaceParameterType.types.some((candidate) => candidate.kind === "primitiveType" &&
|
|
550
|
+
candidate.name === "undefined")).to.equal(true);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
finally {
|
|
554
|
+
fixture.cleanup();
|
|
555
|
+
}
|
|
556
|
+
});
|
|
557
|
+
it("specializes direct generic source-package members through global owner aliases", () => {
|
|
558
|
+
const fixture = materializeJsSurfaceHelpersFixture([
|
|
559
|
+
"fragments/module-bindings/basic-fixture-js-surface",
|
|
560
|
+
"map-global-surface",
|
|
561
|
+
"direct-generic-members",
|
|
562
|
+
]);
|
|
563
|
+
try {
|
|
564
|
+
const projectRoot = fixture.path("app");
|
|
565
|
+
const srcDir = fixture.path("app/src");
|
|
566
|
+
const entryPath = fixture.path("app/src/index.ts");
|
|
567
|
+
const programResult = createProgram([entryPath], {
|
|
568
|
+
projectRoot,
|
|
569
|
+
sourceRoot: srcDir,
|
|
570
|
+
rootNamespace: "TestApp",
|
|
571
|
+
surface: "@fixture/js",
|
|
572
|
+
});
|
|
573
|
+
expect(programResult.ok).to.equal(true);
|
|
574
|
+
if (!programResult.ok)
|
|
575
|
+
return;
|
|
576
|
+
const program = programResult.value;
|
|
577
|
+
const sourceFile = program.sourceFiles.find((file) => path.resolve(file.fileName) === path.resolve(entryPath));
|
|
578
|
+
expect(sourceFile).to.not.equal(undefined);
|
|
579
|
+
if (!sourceFile)
|
|
580
|
+
return;
|
|
581
|
+
const ctx = createProgramContext(program, {
|
|
582
|
+
sourceRoot: srcDir,
|
|
583
|
+
rootNamespace: "TestApp",
|
|
584
|
+
});
|
|
585
|
+
const moduleResult = buildIrModule(sourceFile, program, {
|
|
586
|
+
sourceRoot: srcDir,
|
|
587
|
+
rootNamespace: "TestApp",
|
|
588
|
+
}, ctx);
|
|
589
|
+
expect(moduleResult.ok).to.equal(true);
|
|
590
|
+
if (!moduleResult.ok)
|
|
591
|
+
return;
|
|
592
|
+
const fn = moduleResult.value.body.find((stmt) => stmt.kind === "functionDeclaration" && stmt.name === "main");
|
|
593
|
+
expect(fn).to.not.equal(undefined);
|
|
594
|
+
if (!fn)
|
|
595
|
+
return;
|
|
596
|
+
const nextDecl = fn.body.statements[1];
|
|
597
|
+
expect(nextDecl?.kind).to.equal("variableDeclaration");
|
|
598
|
+
if (!nextDecl || nextDecl.kind !== "variableDeclaration")
|
|
599
|
+
return;
|
|
600
|
+
const logicalExpr = nextDecl.declarations[0]?.initializer;
|
|
601
|
+
expect(logicalExpr?.kind).to.equal("logical");
|
|
602
|
+
if (!logicalExpr || logicalExpr.kind !== "logical")
|
|
603
|
+
return;
|
|
604
|
+
expect(JSON.stringify(logicalExpr.inferredType)).to.not.include('"kind":"typeParameterType"');
|
|
605
|
+
expect(logicalExpr.left.kind).to.equal("call");
|
|
606
|
+
if (logicalExpr.left.kind !== "call")
|
|
607
|
+
return;
|
|
608
|
+
expect(JSON.stringify(logicalExpr.left.inferredType)).to.not.include('"kind":"typeParameterType"');
|
|
609
|
+
const [firstParameterType] = logicalExpr.left.parameterTypes ?? [];
|
|
610
|
+
expect(firstParameterType).to.deep.equal({
|
|
611
|
+
kind: "primitiveType",
|
|
612
|
+
name: "string",
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
finally {
|
|
616
|
+
fixture.cleanup();
|
|
617
|
+
}
|
|
618
|
+
});
|
|
619
|
+
it("uses lambda arity to select source-backed array callback overloads", () => {
|
|
620
|
+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "tsonic-builder-js-array-callback-arity-"));
|
|
621
|
+
try {
|
|
622
|
+
fs.writeFileSync(path.join(tempDir, "package.json"), JSON.stringify({ name: "app", version: "1.0.0", type: "module" }, null, 2));
|
|
623
|
+
const srcDir = path.join(tempDir, "src");
|
|
624
|
+
fs.mkdirSync(srcDir, { recursive: true });
|
|
625
|
+
writeFixtureJsSurface(tempDir, {
|
|
626
|
+
"./Array.js": "./src/Array.ts",
|
|
627
|
+
}, {
|
|
628
|
+
"src/Array.ts": [
|
|
629
|
+
'import type { int } from "@tsonic/core/types.js";',
|
|
630
|
+
"export class Array<T> {",
|
|
631
|
+
" public constructor() {}",
|
|
632
|
+
" public find(callback: (value: T) => boolean): T | undefined;",
|
|
633
|
+
" public find(callback: (value: T, index: int) => boolean): T | undefined;",
|
|
634
|
+
" public find(callback: (value: T, index: int, array: readonly T[]) => boolean): T | undefined;",
|
|
635
|
+
" public find(callback: (value: T, index?: int, array?: readonly T[]) => boolean): T | undefined {",
|
|
636
|
+
" void callback;",
|
|
637
|
+
" return undefined;",
|
|
638
|
+
" }",
|
|
639
|
+
" public findIndex(callback: (value: T) => boolean): int;",
|
|
640
|
+
" public findIndex(callback: (value: T, index: int) => boolean): int;",
|
|
641
|
+
" public findIndex(callback: (value: T, index: int, array: readonly T[]) => boolean): int;",
|
|
642
|
+
" public findIndex(callback: (value: T, index?: int, array?: readonly T[]) => boolean): int {",
|
|
643
|
+
" void callback;",
|
|
644
|
+
" return 0 as int;",
|
|
645
|
+
" }",
|
|
646
|
+
"}",
|
|
647
|
+
].join("\n"),
|
|
648
|
+
}, [
|
|
649
|
+
"declare global {",
|
|
650
|
+
' interface Array<T> extends import("./src/Array.js").Array<T> {}',
|
|
651
|
+
' const Array: typeof import("./src/Array.js").Array;',
|
|
652
|
+
"}",
|
|
653
|
+
"",
|
|
654
|
+
"export {};",
|
|
655
|
+
"",
|
|
656
|
+
].join("\n"));
|
|
657
|
+
const entryPath = path.join(srcDir, "index.ts");
|
|
658
|
+
fs.writeFileSync(entryPath, [
|
|
659
|
+
"type Todo = { id: number; title: string };",
|
|
660
|
+
"",
|
|
661
|
+
"export function main(id: number): number {",
|
|
662
|
+
" const todos = new Array<Todo>();",
|
|
663
|
+
" const todo = todos.find((t) => t.id === id);",
|
|
664
|
+
" const index = todos.findIndex((t) => t.id === id);",
|
|
665
|
+
" void todo;",
|
|
666
|
+
" return index;",
|
|
667
|
+
"}",
|
|
668
|
+
].join("\n"));
|
|
669
|
+
const programResult = createProgram([entryPath], {
|
|
670
|
+
projectRoot: tempDir,
|
|
671
|
+
sourceRoot: srcDir,
|
|
672
|
+
rootNamespace: "TestApp",
|
|
673
|
+
surface: "@fixture/js",
|
|
674
|
+
});
|
|
675
|
+
expect(programResult.ok).to.equal(true);
|
|
676
|
+
if (!programResult.ok)
|
|
677
|
+
return;
|
|
678
|
+
const program = programResult.value;
|
|
679
|
+
const sourceFile = program.sourceFiles.find((file) => path.resolve(file.fileName) === path.resolve(entryPath));
|
|
680
|
+
expect(sourceFile).to.not.equal(undefined);
|
|
681
|
+
if (!sourceFile)
|
|
682
|
+
return;
|
|
683
|
+
const ctx = createProgramContext(program, {
|
|
684
|
+
sourceRoot: srcDir,
|
|
685
|
+
rootNamespace: "TestApp",
|
|
686
|
+
});
|
|
687
|
+
const moduleResult = buildIrModule(sourceFile, program, {
|
|
688
|
+
sourceRoot: srcDir,
|
|
689
|
+
rootNamespace: "TestApp",
|
|
690
|
+
}, ctx);
|
|
691
|
+
expect(moduleResult.ok).to.equal(true);
|
|
692
|
+
if (!moduleResult.ok)
|
|
693
|
+
return;
|
|
694
|
+
const fn = moduleResult.value.body.find((stmt) => stmt.kind === "functionDeclaration" && stmt.name === "main");
|
|
695
|
+
expect(fn).to.not.equal(undefined);
|
|
696
|
+
if (!fn)
|
|
697
|
+
return;
|
|
698
|
+
const findDecl = fn.body.statements[1];
|
|
699
|
+
expect(findDecl?.kind).to.equal("variableDeclaration");
|
|
700
|
+
if (!findDecl || findDecl.kind !== "variableDeclaration")
|
|
701
|
+
return;
|
|
702
|
+
const findCall = findDecl.declarations[0]?.initializer;
|
|
703
|
+
expect(findCall?.kind).to.equal("call");
|
|
704
|
+
if (!findCall || findCall.kind !== "call")
|
|
705
|
+
return;
|
|
706
|
+
const findIndexDecl = fn.body.statements[2];
|
|
707
|
+
expect(findIndexDecl?.kind).to.equal("variableDeclaration");
|
|
708
|
+
if (!findIndexDecl || findIndexDecl.kind !== "variableDeclaration")
|
|
709
|
+
return;
|
|
710
|
+
const findIndexCall = findIndexDecl.declarations[0]?.initializer;
|
|
711
|
+
expect(findIndexCall?.kind).to.equal("call");
|
|
712
|
+
if (!findIndexCall || findIndexCall.kind !== "call")
|
|
713
|
+
return;
|
|
714
|
+
const findRuntimeCallback = findCall.parameterTypes?.[0];
|
|
715
|
+
const findSurfaceCallback = findCall.surfaceParameterTypes?.[0];
|
|
716
|
+
const findIndexRuntimeCallback = findIndexCall.parameterTypes?.[0];
|
|
717
|
+
const findIndexSurfaceCallback = findIndexCall.surfaceParameterTypes?.[0];
|
|
718
|
+
expect(findRuntimeCallback?.kind).to.equal("functionType");
|
|
719
|
+
expect(findSurfaceCallback?.kind).to.equal("functionType");
|
|
720
|
+
expect(findIndexRuntimeCallback?.kind).to.equal("functionType");
|
|
721
|
+
expect(findIndexSurfaceCallback?.kind).to.equal("functionType");
|
|
722
|
+
if (findRuntimeCallback?.kind === "functionType") {
|
|
723
|
+
expect(findRuntimeCallback.parameters).to.have.length(1);
|
|
724
|
+
}
|
|
725
|
+
if (findSurfaceCallback?.kind === "functionType") {
|
|
726
|
+
expect(findSurfaceCallback.parameters).to.have.length(1);
|
|
727
|
+
}
|
|
728
|
+
if (findIndexRuntimeCallback?.kind === "functionType") {
|
|
729
|
+
expect(findIndexRuntimeCallback.parameters).to.have.length(1);
|
|
730
|
+
}
|
|
731
|
+
if (findIndexSurfaceCallback?.kind === "functionType") {
|
|
732
|
+
expect(findIndexSurfaceCallback.parameters).to.have.length(1);
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
finally {
|
|
736
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
737
|
+
}
|
|
738
|
+
});
|
|
739
|
+
it("infers source-backed array callback returns from expression-bodied lambdas", () => {
|
|
740
|
+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "tsonic-builder-js-array-map-return-"));
|
|
741
|
+
try {
|
|
742
|
+
fs.writeFileSync(path.join(tempDir, "package.json"), JSON.stringify({ name: "app", version: "1.0.0", type: "module" }, null, 2));
|
|
743
|
+
const srcDir = path.join(tempDir, "src");
|
|
744
|
+
fs.mkdirSync(srcDir, { recursive: true });
|
|
745
|
+
const workspaceNodeModules = path.join(repoRoot, "node_modules");
|
|
746
|
+
if (fs.existsSync(workspaceNodeModules)) {
|
|
747
|
+
fs.symlinkSync(workspaceNodeModules, path.join(tempDir, "node_modules"), "dir");
|
|
748
|
+
}
|
|
749
|
+
const entryPath = path.join(srcDir, "index.ts");
|
|
750
|
+
fs.writeFileSync(entryPath, [
|
|
751
|
+
"declare const entries: string[];",
|
|
752
|
+
"export const values = entries",
|
|
753
|
+
" .map((entry) => entry)",
|
|
754
|
+
" .filter((value) => value.length > 0);",
|
|
755
|
+
].join("\n"));
|
|
756
|
+
const programResult = createProgram([entryPath], {
|
|
757
|
+
projectRoot: tempDir,
|
|
758
|
+
sourceRoot: srcDir,
|
|
759
|
+
rootNamespace: "TestApp",
|
|
760
|
+
surface: "@tsonic/js",
|
|
761
|
+
});
|
|
762
|
+
expect(programResult.ok).to.equal(true);
|
|
763
|
+
if (!programResult.ok)
|
|
764
|
+
return;
|
|
765
|
+
const program = programResult.value;
|
|
766
|
+
const sourceFile = program.sourceFiles.find((file) => path.resolve(file.fileName) === path.resolve(entryPath));
|
|
767
|
+
expect(sourceFile).to.not.equal(undefined);
|
|
768
|
+
if (!sourceFile)
|
|
769
|
+
return;
|
|
770
|
+
const ctx = createProgramContext(program, {
|
|
771
|
+
sourceRoot: srcDir,
|
|
772
|
+
rootNamespace: "TestApp",
|
|
773
|
+
});
|
|
774
|
+
const moduleResult = buildIrModule(sourceFile, program, {
|
|
775
|
+
sourceRoot: srcDir,
|
|
776
|
+
rootNamespace: "TestApp",
|
|
777
|
+
}, ctx);
|
|
778
|
+
expect(moduleResult.ok).to.equal(true);
|
|
779
|
+
if (!moduleResult.ok)
|
|
780
|
+
return;
|
|
781
|
+
const lowered = runAnonymousTypeLoweringPass([
|
|
782
|
+
moduleResult.value,
|
|
783
|
+
]).modules;
|
|
784
|
+
const proofResult = runNumericProofPass(lowered);
|
|
785
|
+
expect(proofResult.ok).to.equal(true);
|
|
786
|
+
if (!proofResult.ok)
|
|
787
|
+
return;
|
|
788
|
+
const refreshed = runCallResolutionRefreshPass(proofResult.modules, ctx)
|
|
789
|
+
.modules[0];
|
|
790
|
+
const valuesDecl = refreshed?.body.find((statement) => statement.kind === "variableDeclaration");
|
|
791
|
+
expect(valuesDecl?.kind).to.equal("variableDeclaration");
|
|
792
|
+
if (!valuesDecl || valuesDecl.kind !== "variableDeclaration")
|
|
793
|
+
return;
|
|
794
|
+
const filterCall = valuesDecl.declarations[0]?.initializer;
|
|
795
|
+
expect(filterCall?.kind).to.equal("call");
|
|
796
|
+
if (!filterCall || filterCall.kind !== "call")
|
|
797
|
+
return;
|
|
798
|
+
const mapCall = filterCall.callee.kind === "memberAccess"
|
|
799
|
+
? filterCall.callee.object
|
|
800
|
+
: undefined;
|
|
801
|
+
expect(mapCall?.kind).to.equal("call");
|
|
802
|
+
if (!mapCall || mapCall.kind !== "call")
|
|
803
|
+
return;
|
|
804
|
+
const mapCallback = mapCall.arguments[0];
|
|
805
|
+
expect(mapCallback?.kind).to.equal("arrowFunction");
|
|
806
|
+
if (!mapCallback || mapCallback.kind !== "arrowFunction")
|
|
807
|
+
return;
|
|
808
|
+
expect(mapCallback.inferredType?.kind).to.equal("functionType");
|
|
809
|
+
if (mapCallback.inferredType?.kind === "functionType") {
|
|
810
|
+
expect(mapCallback.inferredType.returnType).to.deep.equal({
|
|
811
|
+
kind: "primitiveType",
|
|
812
|
+
name: "string",
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
expect(mapCall.inferredType).to.deep.equal({
|
|
816
|
+
kind: "arrayType",
|
|
817
|
+
elementType: {
|
|
818
|
+
kind: "primitiveType",
|
|
819
|
+
name: "string",
|
|
820
|
+
},
|
|
821
|
+
origin: "explicit",
|
|
822
|
+
});
|
|
823
|
+
const filterCallback = filterCall.parameterTypes?.[0];
|
|
824
|
+
expect(filterCallback?.kind).to.equal("functionType");
|
|
825
|
+
if (filterCallback?.kind === "functionType") {
|
|
826
|
+
expect(filterCallback.parameters[0]?.type).to.deep.equal({
|
|
827
|
+
kind: "primitiveType",
|
|
828
|
+
name: "string",
|
|
829
|
+
});
|
|
830
|
+
}
|
|
831
|
+
expect(filterCall.inferredType).to.deep.equal({
|
|
832
|
+
kind: "arrayType",
|
|
833
|
+
elementType: {
|
|
834
|
+
kind: "primitiveType",
|
|
835
|
+
name: "string",
|
|
836
|
+
},
|
|
837
|
+
origin: "explicit",
|
|
838
|
+
});
|
|
839
|
+
}
|
|
840
|
+
finally {
|
|
841
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
842
|
+
}
|
|
843
|
+
});
|
|
844
|
+
it("threads expected tuple returns into source-backed array map callbacks", () => {
|
|
845
|
+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "tsonic-builder-js-array-map-tuple-return-"));
|
|
846
|
+
try {
|
|
847
|
+
fs.writeFileSync(path.join(tempDir, "package.json"), JSON.stringify({ name: "app", version: "1.0.0", type: "module" }, null, 2));
|
|
848
|
+
const srcDir = path.join(tempDir, "src");
|
|
849
|
+
fs.mkdirSync(srcDir, { recursive: true });
|
|
850
|
+
const workspaceNodeModules = path.join(repoRoot, "node_modules");
|
|
851
|
+
if (fs.existsSync(workspaceNodeModules)) {
|
|
852
|
+
fs.symlinkSync(workspaceNodeModules, path.join(tempDir, "node_modules"), "dir");
|
|
853
|
+
}
|
|
854
|
+
const entryPath = path.join(srcDir, "index.ts");
|
|
855
|
+
fs.writeFileSync(entryPath, [
|
|
856
|
+
"type Entry = { readonly name: string; readonly value: string };",
|
|
857
|
+
"declare const params: Entry[];",
|
|
858
|
+
"export const entries = (): Array<[string, string]> =>",
|
|
859
|
+
" params.map((param) => [param.name, param.value]);",
|
|
860
|
+
].join("\n"));
|
|
861
|
+
const programResult = createProgram([entryPath], {
|
|
862
|
+
projectRoot: tempDir,
|
|
863
|
+
sourceRoot: srcDir,
|
|
864
|
+
rootNamespace: "TestApp",
|
|
865
|
+
surface: "@tsonic/js",
|
|
866
|
+
});
|
|
867
|
+
expect(programResult.ok).to.equal(true);
|
|
868
|
+
if (!programResult.ok)
|
|
869
|
+
return;
|
|
870
|
+
const program = programResult.value;
|
|
871
|
+
const sourceFile = program.sourceFiles.find((file) => path.resolve(file.fileName) === path.resolve(entryPath));
|
|
872
|
+
expect(sourceFile).to.not.equal(undefined);
|
|
873
|
+
if (!sourceFile)
|
|
874
|
+
return;
|
|
875
|
+
const ctx = createProgramContext(program, {
|
|
876
|
+
sourceRoot: srcDir,
|
|
877
|
+
rootNamespace: "TestApp",
|
|
878
|
+
});
|
|
879
|
+
const moduleResult = buildIrModule(sourceFile, program, {
|
|
880
|
+
sourceRoot: srcDir,
|
|
881
|
+
rootNamespace: "TestApp",
|
|
882
|
+
}, ctx);
|
|
883
|
+
expect(moduleResult.ok).to.equal(true);
|
|
884
|
+
if (!moduleResult.ok)
|
|
885
|
+
return;
|
|
886
|
+
const lowered = runAnonymousTypeLoweringPass([
|
|
887
|
+
moduleResult.value,
|
|
888
|
+
]).modules;
|
|
889
|
+
const proofResult = runNumericProofPass(lowered);
|
|
890
|
+
expect(proofResult.ok).to.equal(true);
|
|
891
|
+
if (!proofResult.ok)
|
|
892
|
+
return;
|
|
893
|
+
const refreshed = runCallResolutionRefreshPass(proofResult.modules, ctx)
|
|
894
|
+
.modules[0];
|
|
895
|
+
const entriesDecl = refreshed?.body.find((statement) => statement.kind === "variableDeclaration");
|
|
896
|
+
expect(entriesDecl?.kind).to.equal("variableDeclaration");
|
|
897
|
+
if (!entriesDecl || entriesDecl.kind !== "variableDeclaration")
|
|
898
|
+
return;
|
|
899
|
+
const entriesFn = entriesDecl.declarations[0]?.initializer;
|
|
900
|
+
expect(entriesFn?.kind).to.equal("arrowFunction");
|
|
901
|
+
if (!entriesFn || entriesFn.kind !== "arrowFunction")
|
|
902
|
+
return;
|
|
903
|
+
const mapCall = entriesFn.body;
|
|
904
|
+
expect(mapCall?.kind).to.equal("call");
|
|
905
|
+
if (!mapCall || mapCall.kind !== "call")
|
|
906
|
+
return;
|
|
907
|
+
expect(mapCall.inferredType).to.deep.equal({
|
|
908
|
+
kind: "arrayType",
|
|
909
|
+
elementType: {
|
|
910
|
+
kind: "tupleType",
|
|
911
|
+
elementTypes: [
|
|
912
|
+
{
|
|
913
|
+
kind: "primitiveType",
|
|
914
|
+
name: "string",
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
kind: "primitiveType",
|
|
918
|
+
name: "string",
|
|
919
|
+
},
|
|
920
|
+
],
|
|
921
|
+
},
|
|
922
|
+
origin: "explicit",
|
|
923
|
+
});
|
|
924
|
+
const callbackType = mapCall.parameterTypes?.[0];
|
|
925
|
+
expect(callbackType?.kind).to.equal("functionType");
|
|
926
|
+
if (callbackType?.kind === "functionType") {
|
|
927
|
+
expect(callbackType.returnType).to.deep.equal({
|
|
928
|
+
kind: "tupleType",
|
|
929
|
+
elementTypes: [
|
|
930
|
+
{
|
|
931
|
+
kind: "primitiveType",
|
|
932
|
+
name: "string",
|
|
933
|
+
},
|
|
934
|
+
{
|
|
935
|
+
kind: "primitiveType",
|
|
936
|
+
name: "string",
|
|
937
|
+
},
|
|
938
|
+
],
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
const mapCallback = mapCall.arguments[0];
|
|
942
|
+
expect(mapCallback?.kind).to.equal("arrowFunction");
|
|
943
|
+
if (!mapCallback || mapCallback.kind !== "arrowFunction")
|
|
944
|
+
return;
|
|
945
|
+
expect(mapCallback.inferredType?.kind).to.equal("functionType");
|
|
946
|
+
if (mapCallback.inferredType?.kind === "functionType") {
|
|
947
|
+
expect(mapCallback.inferredType.returnType).to.deep.equal({
|
|
948
|
+
kind: "tupleType",
|
|
949
|
+
elementTypes: [
|
|
950
|
+
{
|
|
951
|
+
kind: "primitiveType",
|
|
952
|
+
name: "string",
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
kind: "primitiveType",
|
|
956
|
+
name: "string",
|
|
957
|
+
},
|
|
958
|
+
],
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
expect(mapCallback.body.kind).to.not.equal("blockStatement");
|
|
962
|
+
if (mapCallback.body.kind !== "blockStatement") {
|
|
963
|
+
expect(mapCallback.body.inferredType).to.deep.equal({
|
|
964
|
+
kind: "tupleType",
|
|
965
|
+
elementTypes: [
|
|
966
|
+
{
|
|
967
|
+
kind: "primitiveType",
|
|
968
|
+
name: "string",
|
|
969
|
+
},
|
|
970
|
+
{
|
|
971
|
+
kind: "primitiveType",
|
|
972
|
+
name: "string",
|
|
973
|
+
},
|
|
974
|
+
],
|
|
975
|
+
});
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
finally {
|
|
979
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
980
|
+
}
|
|
981
|
+
});
|
|
982
|
+
it("threads generic surface root global bindings into identifier callees", () => {
|
|
983
|
+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "tsonic-builder-generic-surface-globals-"));
|
|
984
|
+
try {
|
|
985
|
+
fs.writeFileSync(path.join(tempDir, "package.json"), JSON.stringify({ name: "app", version: "1.0.0", type: "module" }, null, 2));
|
|
986
|
+
const srcDir = path.join(tempDir, "src");
|
|
987
|
+
fs.mkdirSync(srcDir, { recursive: true });
|
|
988
|
+
installMinimalClrRoots(tempDir);
|
|
989
|
+
const surfaceRoot = path.join(tempDir, "node_modules/@fixture/js");
|
|
990
|
+
fs.mkdirSync(surfaceRoot, { recursive: true });
|
|
991
|
+
fs.writeFileSync(path.join(surfaceRoot, "package.json"), JSON.stringify({ name: "@fixture/js", version: "1.0.0", type: "module" }, null, 2));
|
|
992
|
+
fs.writeFileSync(path.join(surfaceRoot, "index.js"), "export {};\n");
|
|
993
|
+
fs.writeFileSync(path.join(surfaceRoot, "index.d.ts"), [
|
|
994
|
+
'import type { int } from "@tsonic/core/types.js";',
|
|
995
|
+
"",
|
|
996
|
+
"declare global {",
|
|
997
|
+
" const console: {",
|
|
998
|
+
" log(...data: unknown[]): void;",
|
|
999
|
+
" };",
|
|
1000
|
+
" function setInterval(handler: (...args: unknown[]) => void, timeout?: int, ...args: unknown[]): int;",
|
|
1001
|
+
" function clearInterval(id: int): void;",
|
|
1002
|
+
"}",
|
|
1003
|
+
"",
|
|
1004
|
+
"export {};",
|
|
1005
|
+
"",
|
|
1006
|
+
].join("\n"));
|
|
1007
|
+
fs.writeFileSync(path.join(surfaceRoot, "bindings.json"), JSON.stringify({
|
|
1008
|
+
bindings: {
|
|
1009
|
+
console: {
|
|
1010
|
+
kind: "global",
|
|
1011
|
+
assembly: "js",
|
|
1012
|
+
type: "js.console",
|
|
1013
|
+
},
|
|
1014
|
+
setInterval: {
|
|
1015
|
+
kind: "global",
|
|
1016
|
+
assembly: "Acme.ExternalRuntime",
|
|
1017
|
+
type: "Acme.ExternalRuntime.Timers",
|
|
1018
|
+
csharpName: "Timers.setInterval",
|
|
1019
|
+
},
|
|
1020
|
+
clearInterval: {
|
|
1021
|
+
kind: "global",
|
|
1022
|
+
assembly: "Acme.ExternalRuntime",
|
|
1023
|
+
type: "Acme.ExternalRuntime.Timers",
|
|
1024
|
+
csharpName: "Timers.clearInterval",
|
|
1025
|
+
},
|
|
1026
|
+
},
|
|
1027
|
+
}, null, 2));
|
|
1028
|
+
fs.writeFileSync(path.join(surfaceRoot, "Acme.ExternalRuntime.d.ts"), "export {};\n");
|
|
1029
|
+
fs.mkdirSync(path.join(surfaceRoot, "Acme.ExternalRuntime"), {
|
|
1030
|
+
recursive: true,
|
|
1031
|
+
});
|
|
1032
|
+
fs.writeFileSync(path.join(surfaceRoot, "Acme.ExternalRuntime", "bindings.json"), JSON.stringify({
|
|
1033
|
+
namespace: "Acme.ExternalRuntime",
|
|
1034
|
+
types: [
|
|
1035
|
+
{
|
|
1036
|
+
clrName: "Acme.ExternalRuntime.Timers",
|
|
1037
|
+
assemblyName: "Acme.ExternalRuntime",
|
|
1038
|
+
methods: [
|
|
1039
|
+
{
|
|
1040
|
+
clrName: "setInterval",
|
|
1041
|
+
normalizedSignature: "setInterval|(System.Action,System.Double):System.Double|static=true",
|
|
1042
|
+
parameterCount: 2,
|
|
1043
|
+
declaringClrType: "Acme.ExternalRuntime.Timers",
|
|
1044
|
+
declaringAssemblyName: "Acme.ExternalRuntime",
|
|
1045
|
+
semanticSignature: {
|
|
1046
|
+
parameters: [
|
|
1047
|
+
{
|
|
1048
|
+
kind: "parameter",
|
|
1049
|
+
pattern: {
|
|
1050
|
+
kind: "identifierPattern",
|
|
1051
|
+
name: "handler",
|
|
1052
|
+
},
|
|
1053
|
+
type: {
|
|
1054
|
+
kind: "referenceType",
|
|
1055
|
+
name: "System.Action",
|
|
1056
|
+
resolvedClrType: "System.Action",
|
|
1057
|
+
},
|
|
1058
|
+
isOptional: false,
|
|
1059
|
+
isRest: false,
|
|
1060
|
+
passing: "value",
|
|
1061
|
+
},
|
|
1062
|
+
{
|
|
1063
|
+
kind: "parameter",
|
|
1064
|
+
pattern: {
|
|
1065
|
+
kind: "identifierPattern",
|
|
1066
|
+
name: "timeout",
|
|
1067
|
+
},
|
|
1068
|
+
type: {
|
|
1069
|
+
kind: "primitiveType",
|
|
1070
|
+
name: "number",
|
|
1071
|
+
},
|
|
1072
|
+
isOptional: false,
|
|
1073
|
+
isRest: false,
|
|
1074
|
+
passing: "value",
|
|
1075
|
+
},
|
|
1076
|
+
],
|
|
1077
|
+
returnType: {
|
|
1078
|
+
kind: "primitiveType",
|
|
1079
|
+
name: "number",
|
|
1080
|
+
},
|
|
1081
|
+
},
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
clrName: "clearInterval",
|
|
1085
|
+
normalizedSignature: "clearInterval|(System.Double):System.Void|static=true",
|
|
1086
|
+
parameterCount: 1,
|
|
1087
|
+
declaringClrType: "Acme.ExternalRuntime.Timers",
|
|
1088
|
+
declaringAssemblyName: "Acme.ExternalRuntime",
|
|
1089
|
+
semanticSignature: {
|
|
1090
|
+
parameters: [
|
|
1091
|
+
{
|
|
1092
|
+
kind: "parameter",
|
|
1093
|
+
pattern: {
|
|
1094
|
+
kind: "identifierPattern",
|
|
1095
|
+
name: "id",
|
|
1096
|
+
},
|
|
1097
|
+
type: {
|
|
1098
|
+
kind: "primitiveType",
|
|
1099
|
+
name: "number",
|
|
1100
|
+
},
|
|
1101
|
+
isOptional: false,
|
|
1102
|
+
isRest: false,
|
|
1103
|
+
passing: "value",
|
|
1104
|
+
},
|
|
1105
|
+
],
|
|
1106
|
+
returnType: {
|
|
1107
|
+
kind: "voidType",
|
|
1108
|
+
},
|
|
1109
|
+
},
|
|
1110
|
+
},
|
|
1111
|
+
],
|
|
1112
|
+
properties: [],
|
|
1113
|
+
fields: [],
|
|
1114
|
+
},
|
|
1115
|
+
],
|
|
1116
|
+
}, null, 2));
|
|
1117
|
+
fs.writeFileSync(path.join(surfaceRoot, "tsonic.surface.json"), JSON.stringify({
|
|
1118
|
+
schemaVersion: 1,
|
|
1119
|
+
id: "@fixture/js",
|
|
1120
|
+
extends: ["clr"],
|
|
1121
|
+
requiredTypeRoots: ["."],
|
|
1122
|
+
}, null, 2));
|
|
1123
|
+
const entryPath = path.join(srcDir, "index.ts");
|
|
1124
|
+
fs.writeFileSync(entryPath, [
|
|
1125
|
+
"export function main(): void {",
|
|
1126
|
+
" const id = setInterval(() => {}, 1000);",
|
|
1127
|
+
" clearInterval(id);",
|
|
1128
|
+
' console.log("tick");',
|
|
1129
|
+
"}",
|
|
1130
|
+
].join("\n"));
|
|
1131
|
+
const programResult = createProgram([entryPath], {
|
|
1132
|
+
projectRoot: tempDir,
|
|
1133
|
+
sourceRoot: srcDir,
|
|
1134
|
+
rootNamespace: "TestApp",
|
|
1135
|
+
surface: "@fixture/js",
|
|
1136
|
+
});
|
|
1137
|
+
expect(programResult.ok).to.equal(true);
|
|
1138
|
+
if (!programResult.ok)
|
|
1139
|
+
return;
|
|
1140
|
+
const program = programResult.value;
|
|
1141
|
+
const sourceFile = program.sourceFiles.find((file) => path.resolve(file.fileName) === path.resolve(entryPath));
|
|
1142
|
+
expect(sourceFile).to.not.equal(undefined);
|
|
1143
|
+
if (!sourceFile)
|
|
1144
|
+
return;
|
|
1145
|
+
const ctx = createProgramContext(program, {
|
|
1146
|
+
sourceRoot: srcDir,
|
|
1147
|
+
rootNamespace: "TestApp",
|
|
1148
|
+
});
|
|
1149
|
+
const moduleResult = buildIrModule(sourceFile, program, {
|
|
1150
|
+
sourceRoot: srcDir,
|
|
1151
|
+
rootNamespace: "TestApp",
|
|
1152
|
+
}, ctx);
|
|
1153
|
+
expect(moduleResult.ok).to.equal(true);
|
|
1154
|
+
if (!moduleResult.ok)
|
|
1155
|
+
return;
|
|
1156
|
+
const fn = moduleResult.value.body.find((stmt) => stmt.kind === "functionDeclaration" && stmt.name === "main");
|
|
1157
|
+
expect(fn).to.not.equal(undefined);
|
|
1158
|
+
if (!fn)
|
|
1159
|
+
return;
|
|
1160
|
+
const firstStmt = fn.body.statements[0];
|
|
1161
|
+
expect(firstStmt?.kind).to.equal("variableDeclaration");
|
|
1162
|
+
if (!firstStmt || firstStmt.kind !== "variableDeclaration")
|
|
1163
|
+
return;
|
|
1164
|
+
const setIntervalCall = firstStmt.declarations[0]?.initializer;
|
|
1165
|
+
expect(setIntervalCall?.kind).to.equal("call");
|
|
1166
|
+
if (!setIntervalCall || setIntervalCall.kind !== "call")
|
|
1167
|
+
return;
|
|
1168
|
+
expect(setIntervalCall.callee.kind).to.equal("identifier");
|
|
1169
|
+
if (setIntervalCall.callee.kind !== "identifier")
|
|
1170
|
+
return;
|
|
1171
|
+
expect(setIntervalCall.callee.name).to.equal("setInterval");
|
|
1172
|
+
expect(setIntervalCall.callee.resolvedClrType).to.equal("Acme.ExternalRuntime.Timers");
|
|
1173
|
+
expect(setIntervalCall.callee.resolvedAssembly).to.equal("Acme.ExternalRuntime");
|
|
1174
|
+
expect(setIntervalCall.callee.csharpName).to.equal("Timers.setInterval");
|
|
1175
|
+
expect(setIntervalCall.parameterTypes).to.deep.equal([
|
|
1176
|
+
{
|
|
1177
|
+
kind: "referenceType",
|
|
1178
|
+
name: "System.Action",
|
|
1179
|
+
resolvedClrType: "System.Action",
|
|
1180
|
+
},
|
|
1181
|
+
{
|
|
1182
|
+
kind: "primitiveType",
|
|
1183
|
+
name: "number",
|
|
1184
|
+
},
|
|
1185
|
+
]);
|
|
1186
|
+
expect(setIntervalCall.surfaceParameterTypes).to.deep.equal([
|
|
1187
|
+
{
|
|
1188
|
+
kind: "referenceType",
|
|
1189
|
+
name: "System.Action",
|
|
1190
|
+
resolvedClrType: "System.Action",
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
kind: "primitiveType",
|
|
1194
|
+
name: "number",
|
|
1195
|
+
},
|
|
1196
|
+
]);
|
|
1197
|
+
expect(setIntervalCall.restParameter).to.equal(undefined);
|
|
1198
|
+
expect(setIntervalCall.surfaceRestParameter).to.equal(undefined);
|
|
1199
|
+
const clearIntervalStmt = fn.body.statements[1];
|
|
1200
|
+
expect(clearIntervalStmt?.kind).to.equal("expressionStatement");
|
|
1201
|
+
if (!clearIntervalStmt ||
|
|
1202
|
+
clearIntervalStmt.kind !== "expressionStatement")
|
|
1203
|
+
return;
|
|
1204
|
+
const clearIntervalCall = clearIntervalStmt.expression;
|
|
1205
|
+
expect(clearIntervalCall.kind).to.equal("call");
|
|
1206
|
+
if (clearIntervalCall.kind !== "call")
|
|
1207
|
+
return;
|
|
1208
|
+
expect(clearIntervalCall.callee.kind).to.equal("identifier");
|
|
1209
|
+
if (clearIntervalCall.callee.kind !== "identifier")
|
|
1210
|
+
return;
|
|
1211
|
+
expect(clearIntervalCall.callee.csharpName).to.equal("Timers.clearInterval");
|
|
1212
|
+
}
|
|
1213
|
+
finally {
|
|
1214
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
1215
|
+
}
|
|
1216
|
+
});
|
|
1217
|
+
it("threads source-package ambient globals declared through static imports", () => {
|
|
1218
|
+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "tsonic-builder-source-package-globals-"));
|
|
1219
|
+
try {
|
|
1220
|
+
fs.writeFileSync(path.join(tempDir, "package.json"), JSON.stringify({ name: "app", version: "1.0.0", type: "module" }, null, 2));
|
|
1221
|
+
const srcDir = path.join(tempDir, "src");
|
|
1222
|
+
fs.mkdirSync(srcDir, { recursive: true });
|
|
1223
|
+
installMinimalClrRoots(tempDir);
|
|
1224
|
+
const surfaceRoot = path.join(tempDir, "node_modules/@fixture/js");
|
|
1225
|
+
fs.mkdirSync(path.join(surfaceRoot, "src"), { recursive: true });
|
|
1226
|
+
fs.writeFileSync(path.join(surfaceRoot, "package.json"), JSON.stringify({ name: "@fixture/js", version: "1.0.0", type: "module" }, null, 2));
|
|
1227
|
+
fs.writeFileSync(path.join(surfaceRoot, "tsonic.package.json"), JSON.stringify({
|
|
1228
|
+
schemaVersion: 1,
|
|
1229
|
+
kind: "tsonic-source-package",
|
|
1230
|
+
surfaces: ["@fixture/js"],
|
|
1231
|
+
source: {
|
|
1232
|
+
namespace: "fixture.js",
|
|
1233
|
+
ambient: ["./globals.ts"],
|
|
1234
|
+
exports: {
|
|
1235
|
+
"./Globals.js": "./src/Globals.ts",
|
|
1236
|
+
"./console.js": "./src/console.ts",
|
|
1237
|
+
},
|
|
1238
|
+
},
|
|
1239
|
+
}, null, 2));
|
|
1240
|
+
fs.writeFileSync(path.join(surfaceRoot, "tsonic.surface.json"), JSON.stringify({
|
|
1241
|
+
schemaVersion: 1,
|
|
1242
|
+
id: "@fixture/js",
|
|
1243
|
+
extends: ["clr"],
|
|
1244
|
+
requiredTypeRoots: ["."],
|
|
1245
|
+
}, null, 2));
|
|
1246
|
+
fs.writeFileSync(path.join(surfaceRoot, "globals.ts"), [
|
|
1247
|
+
'import { parseInt as SourceParseInt } from "./src/Globals.js";',
|
|
1248
|
+
'import { console as SourceConsole } from "./src/console.js";',
|
|
1249
|
+
"",
|
|
1250
|
+
"declare global {",
|
|
1251
|
+
" const parseInt: typeof SourceParseInt;",
|
|
1252
|
+
" const console: typeof SourceConsole;",
|
|
1253
|
+
"}",
|
|
1254
|
+
"",
|
|
1255
|
+
"export {};",
|
|
1256
|
+
].join("\n"));
|
|
1257
|
+
fs.writeFileSync(path.join(surfaceRoot, "src/Globals.ts"), [
|
|
1258
|
+
"export const parseInt = (value: string): number => {",
|
|
1259
|
+
" void value;",
|
|
1260
|
+
" return 42;",
|
|
1261
|
+
"};",
|
|
1262
|
+
].join("\n"));
|
|
1263
|
+
fs.writeFileSync(path.join(surfaceRoot, "src/console.ts"), [
|
|
1264
|
+
"export const console = {",
|
|
1265
|
+
" log(...data: unknown[]): void {",
|
|
1266
|
+
" void data;",
|
|
1267
|
+
" },",
|
|
1268
|
+
"};",
|
|
1269
|
+
].join("\n"));
|
|
1270
|
+
const entryPath = path.join(srcDir, "index.ts");
|
|
1271
|
+
fs.writeFileSync(entryPath, [
|
|
1272
|
+
"export function main(): void {",
|
|
1273
|
+
' const value = parseInt("42");',
|
|
1274
|
+
" console.log(value);",
|
|
1275
|
+
"}",
|
|
1276
|
+
].join("\n"));
|
|
1277
|
+
const programResult = createProgram([entryPath], {
|
|
1278
|
+
projectRoot: tempDir,
|
|
1279
|
+
sourceRoot: srcDir,
|
|
1280
|
+
rootNamespace: "TestApp",
|
|
1281
|
+
surface: "@fixture/js",
|
|
1282
|
+
});
|
|
1283
|
+
expect(programResult.ok).to.equal(true);
|
|
1284
|
+
if (!programResult.ok)
|
|
1285
|
+
return;
|
|
1286
|
+
const program = programResult.value;
|
|
1287
|
+
const sourceFile = program.sourceFiles.find((file) => path.resolve(file.fileName) === path.resolve(entryPath));
|
|
1288
|
+
expect(sourceFile).to.not.equal(undefined);
|
|
1289
|
+
if (!sourceFile)
|
|
1290
|
+
return;
|
|
1291
|
+
const ctx = createProgramContext(program, {
|
|
1292
|
+
sourceRoot: srcDir,
|
|
1293
|
+
rootNamespace: "TestApp",
|
|
1294
|
+
});
|
|
1295
|
+
const moduleResult = buildIrModule(sourceFile, program, {
|
|
1296
|
+
sourceRoot: srcDir,
|
|
1297
|
+
rootNamespace: "TestApp",
|
|
1298
|
+
}, ctx);
|
|
1299
|
+
expect(moduleResult.ok).to.equal(true);
|
|
1300
|
+
if (!moduleResult.ok)
|
|
1301
|
+
return;
|
|
1302
|
+
const fn = moduleResult.value.body.find((stmt) => stmt.kind === "functionDeclaration" && stmt.name === "main");
|
|
1303
|
+
expect(fn).to.not.equal(undefined);
|
|
1304
|
+
if (!fn)
|
|
1305
|
+
return;
|
|
1306
|
+
const firstStmt = fn.body.statements[0];
|
|
1307
|
+
expect(firstStmt?.kind).to.equal("variableDeclaration");
|
|
1308
|
+
if (!firstStmt || firstStmt.kind !== "variableDeclaration")
|
|
1309
|
+
return;
|
|
1310
|
+
const parseIntCall = firstStmt.declarations[0]?.initializer;
|
|
1311
|
+
expect(parseIntCall?.kind).to.equal("call");
|
|
1312
|
+
if (!parseIntCall || parseIntCall.kind !== "call")
|
|
1313
|
+
return;
|
|
1314
|
+
expect(parseIntCall.callee.kind).to.equal("identifier");
|
|
1315
|
+
if (parseIntCall.callee.kind !== "identifier")
|
|
1316
|
+
return;
|
|
1317
|
+
expect(parseIntCall.callee.name).to.equal("parseInt");
|
|
1318
|
+
expect(parseIntCall.callee.resolvedClrType).to.equal("fixture.js.Globals.parseInt");
|
|
1319
|
+
expect(parseIntCall.callee.resolvedAssembly).to.equal("fixture.js");
|
|
1320
|
+
const logStmt = fn.body.statements[1];
|
|
1321
|
+
expect(logStmt?.kind).to.equal("expressionStatement");
|
|
1322
|
+
if (!logStmt || logStmt.kind !== "expressionStatement")
|
|
1323
|
+
return;
|
|
1324
|
+
const logCall = logStmt.expression;
|
|
1325
|
+
expect(logCall.kind).to.equal("call");
|
|
1326
|
+
if (logCall.kind !== "call")
|
|
1327
|
+
return;
|
|
1328
|
+
const logCallee = logCall.callee.kind === "typeAssertion"
|
|
1329
|
+
? logCall.callee.expression
|
|
1330
|
+
: logCall.callee;
|
|
1331
|
+
expect(logCallee.kind).to.equal("memberAccess");
|
|
1332
|
+
if (logCallee.kind !== "memberAccess")
|
|
1333
|
+
return;
|
|
1334
|
+
expect(logCallee.object.kind).to.equal("identifier");
|
|
1335
|
+
if (logCallee.object.kind !== "identifier")
|
|
1336
|
+
return;
|
|
1337
|
+
expect(logCallee.object.name).to.equal("console");
|
|
1338
|
+
expect(logCallee.object.resolvedClrType).to.equal("fixture.js.console.console");
|
|
1339
|
+
expect(logCallee.object.resolvedAssembly).to.equal("fixture.js");
|
|
1340
|
+
}
|
|
1341
|
+
finally {
|
|
1342
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
1343
|
+
}
|
|
1344
|
+
});
|
|
1345
|
+
it("uses source-backed runtime parameter surfaces for ambient globals from dependent source packages", () => {
|
|
1346
|
+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "tsonic-builder-dependent-source-globals-"));
|
|
1347
|
+
try {
|
|
1348
|
+
fs.writeFileSync(path.join(tempDir, "package.json"), JSON.stringify({
|
|
1349
|
+
name: "app",
|
|
1350
|
+
version: "1.0.0",
|
|
1351
|
+
type: "module",
|
|
1352
|
+
devDependencies: {
|
|
1353
|
+
"@fixture/nodejs": "1.0.0",
|
|
1354
|
+
},
|
|
1355
|
+
}, null, 2));
|
|
1356
|
+
const srcDir = path.join(tempDir, "src");
|
|
1357
|
+
fs.mkdirSync(srcDir, { recursive: true });
|
|
1358
|
+
installMinimalClrRoots(tempDir);
|
|
1359
|
+
const jsSurfaceRoot = path.join(tempDir, "node_modules/@fixture/js");
|
|
1360
|
+
fs.mkdirSync(jsSurfaceRoot, { recursive: true });
|
|
1361
|
+
fs.writeFileSync(path.join(jsSurfaceRoot, "package.json"), JSON.stringify({ name: "@fixture/js", version: "1.0.0", type: "module" }, null, 2));
|
|
1362
|
+
fs.writeFileSync(path.join(jsSurfaceRoot, "index.js"), "export {};\n");
|
|
1363
|
+
fs.writeFileSync(path.join(jsSurfaceRoot, "index.d.ts"), [
|
|
1364
|
+
"declare global {",
|
|
1365
|
+
" function setInterval(",
|
|
1366
|
+
" handler: (...args: unknown[]) => void,",
|
|
1367
|
+
" timeout?: number,",
|
|
1368
|
+
" ...args: unknown[]",
|
|
1369
|
+
" ): number;",
|
|
1370
|
+
"}",
|
|
1371
|
+
"",
|
|
1372
|
+
"export {};",
|
|
1373
|
+
"",
|
|
1374
|
+
].join("\n"));
|
|
1375
|
+
fs.writeFileSync(path.join(jsSurfaceRoot, "tsonic.surface.json"), JSON.stringify({
|
|
1376
|
+
schemaVersion: 1,
|
|
1377
|
+
id: "@fixture/js",
|
|
1378
|
+
extends: ["clr"],
|
|
1379
|
+
requiredTypeRoots: ["."],
|
|
1380
|
+
}, null, 2));
|
|
1381
|
+
const nodejsRoot = path.join(tempDir, "node_modules/@fixture/nodejs");
|
|
1382
|
+
fs.mkdirSync(path.join(nodejsRoot, "src"), { recursive: true });
|
|
1383
|
+
fs.writeFileSync(path.join(nodejsRoot, "package.json"), JSON.stringify({
|
|
1384
|
+
name: "@fixture/nodejs",
|
|
1385
|
+
version: "1.0.0",
|
|
1386
|
+
type: "module",
|
|
1387
|
+
dependencies: {
|
|
1388
|
+
"@fixture/js": "1.0.0",
|
|
1389
|
+
},
|
|
1390
|
+
}, null, 2));
|
|
1391
|
+
fs.writeFileSync(path.join(nodejsRoot, "tsonic.package.json"), JSON.stringify({
|
|
1392
|
+
schemaVersion: 1,
|
|
1393
|
+
kind: "tsonic-source-package",
|
|
1394
|
+
surfaces: ["@fixture/js"],
|
|
1395
|
+
source: {
|
|
1396
|
+
namespace: "fixture.nodejs",
|
|
1397
|
+
ambient: ["./globals.ts"],
|
|
1398
|
+
exports: {
|
|
1399
|
+
"./timers.js": "./src/timers-module.ts",
|
|
1400
|
+
},
|
|
1401
|
+
},
|
|
1402
|
+
}, null, 2));
|
|
1403
|
+
fs.writeFileSync(path.join(nodejsRoot, "globals.ts"), [
|
|
1404
|
+
"declare global {",
|
|
1405
|
+
" function setInterval(",
|
|
1406
|
+
" handler: (...args: unknown[]) => void,",
|
|
1407
|
+
" timeout?: number,",
|
|
1408
|
+
" ...args: unknown[]",
|
|
1409
|
+
" ): number;",
|
|
1410
|
+
"}",
|
|
1411
|
+
"",
|
|
1412
|
+
"export {};",
|
|
1413
|
+
"",
|
|
1414
|
+
].join("\n"));
|
|
1415
|
+
fs.writeFileSync(path.join(nodejsRoot, "src/timers-module.ts"), [
|
|
1416
|
+
"export const setInterval = (callback: () => void, delay: number = 0): number => {",
|
|
1417
|
+
" void callback;",
|
|
1418
|
+
" return delay;",
|
|
1419
|
+
"};",
|
|
1420
|
+
].join("\n"));
|
|
1421
|
+
const entryPath = path.join(srcDir, "index.ts");
|
|
1422
|
+
fs.writeFileSync(entryPath, [
|
|
1423
|
+
"export function main(): void {",
|
|
1424
|
+
" setInterval(() => {}, 1000);",
|
|
1425
|
+
"}",
|
|
1426
|
+
].join("\n"));
|
|
1427
|
+
const programResult = createProgram([entryPath], {
|
|
1428
|
+
projectRoot: tempDir,
|
|
1429
|
+
sourceRoot: srcDir,
|
|
1430
|
+
rootNamespace: "TestApp",
|
|
1431
|
+
surface: "@fixture/js",
|
|
1432
|
+
});
|
|
1433
|
+
expect(programResult.ok).to.equal(true);
|
|
1434
|
+
if (!programResult.ok)
|
|
1435
|
+
return;
|
|
1436
|
+
const program = programResult.value;
|
|
1437
|
+
const sourceFile = program.sourceFiles.find((file) => path.resolve(file.fileName) === path.resolve(entryPath));
|
|
1438
|
+
expect(sourceFile).to.not.equal(undefined);
|
|
1439
|
+
if (!sourceFile)
|
|
1440
|
+
return;
|
|
1441
|
+
const ctx = createProgramContext(program, {
|
|
1442
|
+
sourceRoot: srcDir,
|
|
1443
|
+
rootNamespace: "TestApp",
|
|
1444
|
+
});
|
|
1445
|
+
const moduleResult = buildIrModule(sourceFile, program, {
|
|
1446
|
+
sourceRoot: srcDir,
|
|
1447
|
+
rootNamespace: "TestApp",
|
|
1448
|
+
}, ctx);
|
|
1449
|
+
expect(moduleResult.ok).to.equal(true);
|
|
1450
|
+
if (!moduleResult.ok)
|
|
1451
|
+
return;
|
|
1452
|
+
const fn = moduleResult.value.body.find((stmt) => stmt.kind === "functionDeclaration" && stmt.name === "main");
|
|
1453
|
+
expect(fn).to.not.equal(undefined);
|
|
1454
|
+
if (!fn)
|
|
1455
|
+
return;
|
|
1456
|
+
const exprStmt = fn.body.statements[0];
|
|
1457
|
+
expect(exprStmt?.kind).to.equal("expressionStatement");
|
|
1458
|
+
if (!exprStmt || exprStmt.kind !== "expressionStatement")
|
|
1459
|
+
return;
|
|
1460
|
+
const callExpr = exprStmt.expression;
|
|
1461
|
+
expect(callExpr.kind).to.equal("call");
|
|
1462
|
+
if (callExpr.kind !== "call")
|
|
1463
|
+
return;
|
|
1464
|
+
expect(callExpr.callee.kind).to.equal("identifier");
|
|
1465
|
+
if (callExpr.callee.kind !== "identifier")
|
|
1466
|
+
return;
|
|
1467
|
+
expect(callExpr.callee.resolvedClrType).to.equal("fixture.nodejs.TimersModule.setInterval");
|
|
1468
|
+
expect(callExpr.callee.resolvedAssembly).to.equal("fixture.nodejs");
|
|
1469
|
+
expect(callExpr.parameterTypes?.[0]).to.deep.equal({
|
|
1470
|
+
kind: "functionType",
|
|
1471
|
+
parameters: [],
|
|
1472
|
+
returnType: {
|
|
1473
|
+
kind: "voidType",
|
|
1474
|
+
},
|
|
1475
|
+
});
|
|
1476
|
+
expect(callExpr.parameterTypes?.[1]).to.deep.equal({
|
|
1477
|
+
kind: "primitiveType",
|
|
1478
|
+
name: "number",
|
|
1479
|
+
});
|
|
1480
|
+
expect(callExpr.surfaceParameterTypes?.[0]).to.deep.equal({
|
|
1481
|
+
kind: "functionType",
|
|
1482
|
+
parameters: [],
|
|
1483
|
+
returnType: {
|
|
1484
|
+
kind: "voidType",
|
|
1485
|
+
},
|
|
1486
|
+
});
|
|
1487
|
+
}
|
|
1488
|
+
finally {
|
|
1489
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
1490
|
+
}
|
|
1491
|
+
});
|
|
1492
|
+
it("applies the current project source-package ambient instance bindings to its own source files", () => {
|
|
1493
|
+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "tsonic-builder-self-source-package-"));
|
|
1494
|
+
try {
|
|
1495
|
+
fs.writeFileSync(path.join(tempDir, "package.json"), JSON.stringify({ name: "@fixture/lib", version: "1.0.0", type: "module" }, null, 2));
|
|
1496
|
+
fs.writeFileSync(path.join(tempDir, "tsonic.package.json"), JSON.stringify({
|
|
1497
|
+
schemaVersion: 1,
|
|
1498
|
+
kind: "tsonic-source-package",
|
|
1499
|
+
surfaces: ["@fixture/js"],
|
|
1500
|
+
source: {
|
|
1501
|
+
namespace: "fixture.lib",
|
|
1502
|
+
ambient: ["./globals.ts"],
|
|
1503
|
+
exports: {
|
|
1504
|
+
".": "./src/index.ts",
|
|
1505
|
+
"./index.js": "./src/index.ts",
|
|
1506
|
+
"./Globals.js": "./src/Globals.ts",
|
|
1507
|
+
"./String.js": "./src/String.ts",
|
|
1508
|
+
},
|
|
1509
|
+
},
|
|
1510
|
+
}, null, 2));
|
|
1511
|
+
installMinimalClrRoots(tempDir);
|
|
1512
|
+
const surfaceRoot = path.join(tempDir, "node_modules", "@fixture", "js");
|
|
1513
|
+
fs.mkdirSync(surfaceRoot, { recursive: true });
|
|
1514
|
+
fs.writeFileSync(path.join(surfaceRoot, "package.json"), JSON.stringify({ name: "@fixture/js", version: "1.0.0", type: "module" }, null, 2));
|
|
1515
|
+
fs.writeFileSync(path.join(surfaceRoot, "tsonic.surface.json"), JSON.stringify({
|
|
1516
|
+
schemaVersion: 1,
|
|
1517
|
+
id: "@fixture/js",
|
|
1518
|
+
extends: ["clr"],
|
|
1519
|
+
requiredTypeRoots: ["."],
|
|
1520
|
+
}, null, 2));
|
|
1521
|
+
const srcDir = path.join(tempDir, "src");
|
|
1522
|
+
fs.mkdirSync(srcDir, { recursive: true });
|
|
1523
|
+
fs.writeFileSync(path.join(tempDir, "globals.ts"), [
|
|
1524
|
+
'import { String as SourceString } from "./src/Globals.js";',
|
|
1525
|
+
"",
|
|
1526
|
+
"declare global {",
|
|
1527
|
+
" interface String {",
|
|
1528
|
+
" trimStart(): string;",
|
|
1529
|
+
" trim(): string;",
|
|
1530
|
+
" replaceAll(searchValue: string, replaceValue: string): string;",
|
|
1531
|
+
" charCodeAt(index: number): number;",
|
|
1532
|
+
" }",
|
|
1533
|
+
" const String: typeof SourceString;",
|
|
1534
|
+
"}",
|
|
1535
|
+
"",
|
|
1536
|
+
"export {};",
|
|
1537
|
+
].join("\n"));
|
|
1538
|
+
fs.writeFileSync(path.join(srcDir, "index.ts"), "export {};\n");
|
|
1539
|
+
fs.writeFileSync(path.join(srcDir, "String.ts"), [
|
|
1540
|
+
"export const trimStart = (value: string): string => value;",
|
|
1541
|
+
"export const trim = (value: string): string => value;",
|
|
1542
|
+
"export const replaceAll = (",
|
|
1543
|
+
" value: string,",
|
|
1544
|
+
" searchValue: string,",
|
|
1545
|
+
" replaceValue: string",
|
|
1546
|
+
"): string => {",
|
|
1547
|
+
" void searchValue;",
|
|
1548
|
+
" void replaceValue;",
|
|
1549
|
+
" return value;",
|
|
1550
|
+
"};",
|
|
1551
|
+
"export const charCodeAt = (value: string, index: number): number => {",
|
|
1552
|
+
" void value;",
|
|
1553
|
+
" return index;",
|
|
1554
|
+
"};",
|
|
1555
|
+
].join("\n"));
|
|
1556
|
+
const entryPath = path.join(srcDir, "Globals.ts");
|
|
1557
|
+
fs.writeFileSync(entryPath, [
|
|
1558
|
+
"export const String = (value?: unknown): string => {",
|
|
1559
|
+
" void value;",
|
|
1560
|
+
' return "";',
|
|
1561
|
+
"};",
|
|
1562
|
+
"",
|
|
1563
|
+
"export const digitValue = (ch: string): number => {",
|
|
1564
|
+
' return ch.charCodeAt(0) - "0".charCodeAt(0);',
|
|
1565
|
+
"};",
|
|
1566
|
+
"",
|
|
1567
|
+
"export const normalize = (value: string): string => {",
|
|
1568
|
+
' return value.trimStart().replaceAll("a", "b").trim();',
|
|
1569
|
+
"};",
|
|
1570
|
+
].join("\n"));
|
|
1571
|
+
const programResult = createProgram([entryPath], {
|
|
1572
|
+
projectRoot: tempDir,
|
|
1573
|
+
sourceRoot: srcDir,
|
|
1574
|
+
rootNamespace: "Fixture.Lib",
|
|
1575
|
+
surface: "@fixture/js",
|
|
1576
|
+
});
|
|
1577
|
+
expect(programResult.ok).to.equal(true);
|
|
1578
|
+
if (!programResult.ok)
|
|
1579
|
+
return;
|
|
1580
|
+
const program = programResult.value;
|
|
1581
|
+
const sourceFile = program.sourceFiles.find((file) => path.resolve(file.fileName) === path.resolve(entryPath));
|
|
1582
|
+
expect(sourceFile).to.not.equal(undefined);
|
|
1583
|
+
if (!sourceFile)
|
|
1584
|
+
return;
|
|
1585
|
+
const ctx = createProgramContext(program, {
|
|
1586
|
+
sourceRoot: srcDir,
|
|
1587
|
+
rootNamespace: "Fixture.Lib",
|
|
1588
|
+
});
|
|
1589
|
+
const moduleResult = buildIrModule(sourceFile, program, {
|
|
1590
|
+
sourceRoot: srcDir,
|
|
1591
|
+
rootNamespace: "Fixture.Lib",
|
|
1592
|
+
}, ctx);
|
|
1593
|
+
expect(moduleResult.ok).to.equal(true);
|
|
1594
|
+
if (!moduleResult.ok)
|
|
1595
|
+
return;
|
|
1596
|
+
const digitValue = moduleResult.value.body.find((stmt) => stmt.kind === "variableDeclaration" &&
|
|
1597
|
+
stmt.declarations[0]?.name.kind === "identifierPattern" &&
|
|
1598
|
+
stmt.declarations[0].name.name === "digitValue");
|
|
1599
|
+
expect(digitValue).to.not.equal(undefined);
|
|
1600
|
+
if (!digitValue)
|
|
1601
|
+
return;
|
|
1602
|
+
const digitInitializer = digitValue.declarations[0]?.initializer;
|
|
1603
|
+
expect(digitInitializer?.kind).to.equal("arrowFunction");
|
|
1604
|
+
if (!digitInitializer || digitInitializer.kind !== "arrowFunction") {
|
|
1605
|
+
return;
|
|
1606
|
+
}
|
|
1607
|
+
expect(digitInitializer.body.kind).to.equal("blockStatement");
|
|
1608
|
+
if (digitInitializer.body.kind !== "blockStatement")
|
|
1609
|
+
return;
|
|
1610
|
+
const digitReturn = digitInitializer.body.statements[0];
|
|
1611
|
+
expect(digitReturn?.kind).to.equal("returnStatement");
|
|
1612
|
+
if (!digitReturn || digitReturn.kind !== "returnStatement")
|
|
1613
|
+
return;
|
|
1614
|
+
const digitExpr = digitReturn.expression;
|
|
1615
|
+
expect(digitExpr?.kind).to.equal("binary");
|
|
1616
|
+
if (!digitExpr || digitExpr.kind !== "binary")
|
|
1617
|
+
return;
|
|
1618
|
+
expect(digitExpr.left.kind).to.equal("call");
|
|
1619
|
+
if (digitExpr.left.kind !== "call")
|
|
1620
|
+
return;
|
|
1621
|
+
expect(digitExpr.left.callee.kind).to.equal("memberAccess");
|
|
1622
|
+
if (digitExpr.left.callee.kind !== "memberAccess")
|
|
1623
|
+
return;
|
|
1624
|
+
expect(digitExpr.left.callee.memberBinding?.type).to.equal("fixture.lib.String");
|
|
1625
|
+
expect(digitExpr.left.callee.memberBinding?.member).to.equal("charCodeAt");
|
|
1626
|
+
const normalizeDecl = moduleResult.value.body.find((stmt) => stmt.kind === "variableDeclaration" &&
|
|
1627
|
+
stmt.declarations[0]?.name.kind === "identifierPattern" &&
|
|
1628
|
+
stmt.declarations[0].name.name === "normalize");
|
|
1629
|
+
expect(normalizeDecl).to.not.equal(undefined);
|
|
1630
|
+
if (!normalizeDecl)
|
|
1631
|
+
return;
|
|
1632
|
+
const normalizeInitializer = normalizeDecl.declarations[0]?.initializer;
|
|
1633
|
+
expect(normalizeInitializer?.kind).to.equal("arrowFunction");
|
|
1634
|
+
if (!normalizeInitializer ||
|
|
1635
|
+
normalizeInitializer.kind !== "arrowFunction") {
|
|
1636
|
+
return;
|
|
1637
|
+
}
|
|
1638
|
+
expect(normalizeInitializer.body.kind).to.equal("blockStatement");
|
|
1639
|
+
if (normalizeInitializer.body.kind !== "blockStatement")
|
|
1640
|
+
return;
|
|
1641
|
+
const normalizeReturn = normalizeInitializer.body.statements[0];
|
|
1642
|
+
expect(normalizeReturn?.kind).to.equal("returnStatement");
|
|
1643
|
+
if (!normalizeReturn ||
|
|
1644
|
+
normalizeReturn.kind !== "returnStatement" ||
|
|
1645
|
+
!normalizeReturn.expression) {
|
|
1646
|
+
return;
|
|
1647
|
+
}
|
|
1648
|
+
const trimCall = normalizeReturn.expression;
|
|
1649
|
+
expect(trimCall.kind).to.equal("call");
|
|
1650
|
+
if (trimCall.kind !== "call")
|
|
1651
|
+
return;
|
|
1652
|
+
expect(trimCall.callee.kind).to.equal("memberAccess");
|
|
1653
|
+
if (trimCall.callee.kind !== "memberAccess")
|
|
1654
|
+
return;
|
|
1655
|
+
expect(trimCall.callee.memberBinding?.type).to.equal("fixture.lib.String");
|
|
1656
|
+
expect(trimCall.callee.memberBinding?.member).to.equal("trim");
|
|
1657
|
+
expect(trimCall.callee.object.kind).to.equal("call");
|
|
1658
|
+
if (trimCall.callee.object.kind !== "call")
|
|
1659
|
+
return;
|
|
1660
|
+
expect(trimCall.callee.object.callee.kind).to.equal("memberAccess");
|
|
1661
|
+
if (trimCall.callee.object.callee.kind !== "memberAccess")
|
|
1662
|
+
return;
|
|
1663
|
+
expect(trimCall.callee.object.callee.memberBinding?.type).to.equal("fixture.lib.String");
|
|
1664
|
+
expect(trimCall.callee.object.callee.memberBinding?.member).to.equal("replaceAll");
|
|
1665
|
+
expect(trimCall.callee.object.callee.object.kind).to.equal("call");
|
|
1666
|
+
if (trimCall.callee.object.callee.object.kind !== "call")
|
|
1667
|
+
return;
|
|
1668
|
+
expect(trimCall.callee.object.callee.object.callee.kind).to.equal("memberAccess");
|
|
1669
|
+
if (trimCall.callee.object.callee.object.callee.kind !== "memberAccess") {
|
|
1670
|
+
return;
|
|
1671
|
+
}
|
|
1672
|
+
expect(trimCall.callee.object.callee.object.callee.memberBinding?.type).to.equal("fixture.lib.String");
|
|
1673
|
+
expect(trimCall.callee.object.callee.object.callee.memberBinding?.member).to.equal("trimStart");
|
|
1674
|
+
}
|
|
1675
|
+
finally {
|
|
1676
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
1677
|
+
}
|
|
1678
|
+
});
|
|
1679
|
+
it("treats source-package ambient constructor globals as real type identities", () => {
|
|
1680
|
+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "tsonic-builder-source-package-type-identity-"));
|
|
1681
|
+
try {
|
|
1682
|
+
fs.writeFileSync(path.join(tempDir, "package.json"), JSON.stringify({ name: "app", version: "1.0.0", type: "module" }, null, 2));
|
|
1683
|
+
const srcDir = path.join(tempDir, "src");
|
|
1684
|
+
fs.mkdirSync(srcDir, { recursive: true });
|
|
1685
|
+
installMinimalClrRoots(tempDir);
|
|
1686
|
+
const surfaceRoot = path.join(tempDir, "node_modules/@fixture/js");
|
|
1687
|
+
fs.mkdirSync(path.join(surfaceRoot, "src"), { recursive: true });
|
|
1688
|
+
fs.writeFileSync(path.join(surfaceRoot, "package.json"), JSON.stringify({ name: "@fixture/js", version: "1.0.0", type: "module" }, null, 2));
|
|
1689
|
+
fs.writeFileSync(path.join(surfaceRoot, "tsonic.package.json"), JSON.stringify({
|
|
1690
|
+
schemaVersion: 1,
|
|
1691
|
+
kind: "tsonic-source-package",
|
|
1692
|
+
surfaces: ["@fixture/js"],
|
|
1693
|
+
source: {
|
|
1694
|
+
namespace: "fixture.js",
|
|
1695
|
+
ambient: ["./globals.ts"],
|
|
1696
|
+
exports: {
|
|
1697
|
+
"./Widget.js": "./src/Widget.ts",
|
|
1698
|
+
},
|
|
1699
|
+
},
|
|
1700
|
+
}, null, 2));
|
|
1701
|
+
fs.writeFileSync(path.join(surfaceRoot, "tsonic.surface.json"), JSON.stringify({
|
|
1702
|
+
schemaVersion: 1,
|
|
1703
|
+
id: "@fixture/js",
|
|
1704
|
+
extends: ["clr"],
|
|
1705
|
+
requiredTypeRoots: ["."],
|
|
1706
|
+
}, null, 2));
|
|
1707
|
+
fs.writeFileSync(path.join(surfaceRoot, "globals.ts"), [
|
|
1708
|
+
'import { Widget as SourceWidget } from "./src/Widget.js";',
|
|
1709
|
+
"",
|
|
1710
|
+
"declare global {",
|
|
1711
|
+
" interface Widget extends SourceWidget {}",
|
|
1712
|
+
" const Widget: typeof SourceWidget;",
|
|
1713
|
+
"}",
|
|
1714
|
+
"",
|
|
1715
|
+
"export {};",
|
|
1716
|
+
].join("\n"));
|
|
1717
|
+
fs.writeFileSync(path.join(surfaceRoot, "src/Widget.ts"), [
|
|
1718
|
+
"export class Widget {",
|
|
1719
|
+
" public isWidget(): boolean {",
|
|
1720
|
+
" return true;",
|
|
1721
|
+
" }",
|
|
1722
|
+
"}",
|
|
1723
|
+
"",
|
|
1724
|
+
].join("\n"));
|
|
1725
|
+
const entryPath = path.join(srcDir, "index.ts");
|
|
1726
|
+
fs.writeFileSync(entryPath, [
|
|
1727
|
+
"export function check(value: string | Widget): boolean {",
|
|
1728
|
+
" if (value instanceof Widget) {",
|
|
1729
|
+
" return value.isWidget();",
|
|
1730
|
+
" }",
|
|
1731
|
+
" return value.length > 0;",
|
|
1732
|
+
"}",
|
|
1733
|
+
].join("\n"));
|
|
1734
|
+
const programResult = createProgram([entryPath], {
|
|
1735
|
+
projectRoot: tempDir,
|
|
1736
|
+
sourceRoot: srcDir,
|
|
1737
|
+
rootNamespace: "TestApp",
|
|
1738
|
+
surface: "@fixture/js",
|
|
1739
|
+
});
|
|
1740
|
+
expect(programResult.ok).to.equal(true);
|
|
1741
|
+
if (!programResult.ok)
|
|
1742
|
+
return;
|
|
1743
|
+
const program = programResult.value;
|
|
1744
|
+
const sourceFile = program.sourceFiles.find((file) => path.resolve(file.fileName) === path.resolve(entryPath));
|
|
1745
|
+
expect(sourceFile).to.not.equal(undefined);
|
|
1746
|
+
if (!sourceFile)
|
|
1747
|
+
return;
|
|
1748
|
+
const ctx = createProgramContext(program, {
|
|
1749
|
+
sourceRoot: srcDir,
|
|
1750
|
+
rootNamespace: "TestApp",
|
|
1751
|
+
});
|
|
1752
|
+
const moduleResult = buildIrModule(sourceFile, program, {
|
|
1753
|
+
sourceRoot: srcDir,
|
|
1754
|
+
rootNamespace: "TestApp",
|
|
1755
|
+
}, ctx);
|
|
1756
|
+
expect(moduleResult.ok).to.equal(true);
|
|
1757
|
+
}
|
|
1758
|
+
finally {
|
|
1759
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
1760
|
+
}
|
|
1761
|
+
});
|
|
1762
|
+
it("converts regex literals into RegExp constructor expressions on js surface", () => {
|
|
1763
|
+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "tsonic-builder-js-regex-literal-"));
|
|
1764
|
+
try {
|
|
1765
|
+
fs.writeFileSync(path.join(tempDir, "package.json"), JSON.stringify({ name: "app", version: "1.0.0", type: "module" }, null, 2));
|
|
1766
|
+
const srcDir = path.join(tempDir, "src");
|
|
1767
|
+
fs.mkdirSync(srcDir, { recursive: true });
|
|
1768
|
+
writeFixtureJsSurface(tempDir, {
|
|
1769
|
+
"./RegExp.js": "./src/RegExp.ts",
|
|
1770
|
+
}, {
|
|
1771
|
+
"src/RegExp.ts": [
|
|
1772
|
+
"export class RegExp {",
|
|
1773
|
+
" public constructor(_pattern: string, _flags?: string) {}",
|
|
1774
|
+
" public test(_value: string): boolean {",
|
|
1775
|
+
" return true;",
|
|
1776
|
+
" }",
|
|
1777
|
+
"}",
|
|
1778
|
+
].join("\n"),
|
|
1779
|
+
}, [
|
|
1780
|
+
"declare global {",
|
|
1781
|
+
' const RegExp: typeof import("./src/RegExp.js").RegExp;',
|
|
1782
|
+
"}",
|
|
1783
|
+
"",
|
|
1784
|
+
"export {};",
|
|
1785
|
+
"",
|
|
1786
|
+
].join("\n"));
|
|
1787
|
+
const entryPath = path.join(srcDir, "index.ts");
|
|
1788
|
+
fs.writeFileSync(entryPath, [
|
|
1789
|
+
"export function isUpper(text: string): boolean {",
|
|
1790
|
+
" return /^[A-Z]+$/i.test(text);",
|
|
1791
|
+
"}",
|
|
1792
|
+
].join("\n"));
|
|
1793
|
+
const programResult = createProgram([entryPath], {
|
|
1794
|
+
projectRoot: tempDir,
|
|
1795
|
+
sourceRoot: srcDir,
|
|
1796
|
+
rootNamespace: "TestApp",
|
|
1797
|
+
surface: "@fixture/js",
|
|
1798
|
+
});
|
|
1799
|
+
expect(programResult.ok).to.equal(true);
|
|
1800
|
+
if (!programResult.ok)
|
|
1801
|
+
return;
|
|
1802
|
+
const program = programResult.value;
|
|
1803
|
+
const sourceFile = program.sourceFiles.find((file) => path.resolve(file.fileName) === path.resolve(entryPath));
|
|
1804
|
+
expect(sourceFile).to.not.equal(undefined);
|
|
1805
|
+
if (!sourceFile)
|
|
1806
|
+
return;
|
|
1807
|
+
const ctx = createProgramContext(program, {
|
|
1808
|
+
sourceRoot: srcDir,
|
|
1809
|
+
rootNamespace: "TestApp",
|
|
1810
|
+
});
|
|
1811
|
+
const moduleResult = buildIrModule(sourceFile, program, {
|
|
1812
|
+
sourceRoot: srcDir,
|
|
1813
|
+
rootNamespace: "TestApp",
|
|
1814
|
+
}, ctx);
|
|
1815
|
+
expect(moduleResult.ok).to.equal(true);
|
|
1816
|
+
if (!moduleResult.ok)
|
|
1817
|
+
return;
|
|
1818
|
+
const fn = moduleResult.value.body.find((stmt) => stmt.kind === "functionDeclaration" && stmt.name === "isUpper");
|
|
1819
|
+
expect(fn).to.not.equal(undefined);
|
|
1820
|
+
if (!fn)
|
|
1821
|
+
return;
|
|
1822
|
+
const returnStmt = fn.body.statements[0];
|
|
1823
|
+
expect(returnStmt?.kind).to.equal("returnStatement");
|
|
1824
|
+
if (!returnStmt || returnStmt.kind !== "returnStatement")
|
|
1825
|
+
return;
|
|
1826
|
+
const testCall = returnStmt.expression;
|
|
1827
|
+
expect(testCall?.kind).to.equal("call");
|
|
1828
|
+
if (!testCall || testCall.kind !== "call")
|
|
1829
|
+
return;
|
|
1830
|
+
expect(testCall.callee.kind).to.equal("memberAccess");
|
|
1831
|
+
if (testCall.callee.kind !== "memberAccess")
|
|
1832
|
+
return;
|
|
1833
|
+
const regexCtor = testCall.callee.object;
|
|
1834
|
+
expect(regexCtor.kind).to.equal("new");
|
|
1835
|
+
if (regexCtor.kind !== "new")
|
|
1836
|
+
return;
|
|
1837
|
+
expect(regexCtor.callee.kind).to.equal("identifier");
|
|
1838
|
+
if (regexCtor.callee.kind !== "identifier")
|
|
1839
|
+
return;
|
|
1840
|
+
expect(regexCtor.callee.name).to.equal("RegExp");
|
|
1841
|
+
expect(regexCtor.callee.resolvedClrType).to.equal("fixture.js.RegExp");
|
|
1842
|
+
expect(regexCtor.arguments).to.deep.equal([
|
|
1843
|
+
{
|
|
1844
|
+
kind: "literal",
|
|
1845
|
+
value: "^[A-Z]+$",
|
|
1846
|
+
raw: JSON.stringify("^[A-Z]+$"),
|
|
1847
|
+
inferredType: { kind: "primitiveType", name: "string" },
|
|
1848
|
+
sourceSpan: regexCtor.arguments[0]?.sourceSpan,
|
|
1849
|
+
},
|
|
1850
|
+
{
|
|
1851
|
+
kind: "literal",
|
|
1852
|
+
value: "i",
|
|
1853
|
+
raw: JSON.stringify("i"),
|
|
1854
|
+
inferredType: { kind: "primitiveType", name: "string" },
|
|
1855
|
+
sourceSpan: regexCtor.arguments[1]?.sourceSpan,
|
|
1856
|
+
},
|
|
1857
|
+
]);
|
|
1858
|
+
expect(regexCtor.parameterTypes?.[0]).to.deep.equal({
|
|
1859
|
+
kind: "primitiveType",
|
|
1860
|
+
name: "string",
|
|
1861
|
+
});
|
|
1862
|
+
expect(regexCtor.surfaceParameterTypes?.[0]).to.deep.equal({
|
|
1863
|
+
kind: "primitiveType",
|
|
1864
|
+
name: "string",
|
|
1865
|
+
});
|
|
1866
|
+
expect(regexCtor.parameterTypes?.[1]).to.deep.equal({
|
|
1867
|
+
kind: "primitiveType",
|
|
1868
|
+
name: "string",
|
|
1869
|
+
});
|
|
1870
|
+
expect(regexCtor.surfaceParameterTypes?.[1]).to.deep.equal({
|
|
1871
|
+
kind: "unionType",
|
|
1872
|
+
types: [
|
|
1873
|
+
{ kind: "primitiveType", name: "string" },
|
|
1874
|
+
{ kind: "primitiveType", name: "undefined" },
|
|
1875
|
+
],
|
|
1876
|
+
});
|
|
1877
|
+
}
|
|
1878
|
+
finally {
|
|
1879
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
1880
|
+
}
|
|
1881
|
+
});
|
|
1882
|
+
it("preserves spread-only array element types on js surface", () => {
|
|
1883
|
+
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "tsonic-builder-js-spread-array-"));
|
|
1884
|
+
try {
|
|
1885
|
+
fs.writeFileSync(path.join(tempDir, "package.json"), JSON.stringify({ name: "app", version: "1.0.0", type: "module" }, null, 2));
|
|
1886
|
+
const srcDir = path.join(tempDir, "src");
|
|
1887
|
+
fs.mkdirSync(srcDir, { recursive: true });
|
|
1888
|
+
writeFixtureJsSurface(tempDir, {
|
|
1889
|
+
"./Array.js": "./src/Array.ts",
|
|
1890
|
+
}, {
|
|
1891
|
+
"src/Array.ts": [
|
|
1892
|
+
"export abstract class Array<T> {",
|
|
1893
|
+
" public abstract sort(compareFn?: (a: T, b: T) => number): T[];",
|
|
1894
|
+
"}",
|
|
1895
|
+
].join("\n"),
|
|
1896
|
+
}, [
|
|
1897
|
+
'import { Array as SourceArray } from "./src/Array.js";',
|
|
1898
|
+
"",
|
|
1899
|
+
"declare global {",
|
|
1900
|
+
" interface Array<T> extends SourceArray<T> {}",
|
|
1901
|
+
" const Array: typeof SourceArray;",
|
|
1902
|
+
"}",
|
|
1903
|
+
"",
|
|
1904
|
+
"export {};",
|
|
1905
|
+
"",
|
|
1906
|
+
].join("\n"));
|
|
1907
|
+
const entryPath = path.join(srcDir, "index.ts");
|
|
1908
|
+
fs.writeFileSync(entryPath, [
|
|
1909
|
+
"type MenuEntry = { weight: number };",
|
|
1910
|
+
"export const sortMenuEntries = (entries: MenuEntry[]): MenuEntry[] => {",
|
|
1911
|
+
" return [...entries].sort((a: MenuEntry, b: MenuEntry) => a.weight - b.weight);",
|
|
1912
|
+
"};",
|
|
1913
|
+
].join("\n"));
|
|
1914
|
+
const programResult = createProgram([entryPath], {
|
|
1915
|
+
projectRoot: tempDir,
|
|
1916
|
+
sourceRoot: srcDir,
|
|
1917
|
+
rootNamespace: "TestApp",
|
|
1918
|
+
surface: "@fixture/js",
|
|
1919
|
+
});
|
|
1920
|
+
expect(programResult.ok).to.equal(true);
|
|
1921
|
+
if (!programResult.ok)
|
|
1922
|
+
return;
|
|
1923
|
+
const program = programResult.value;
|
|
1924
|
+
const sourceFile = program.sourceFiles.find((file) => path.resolve(file.fileName) === path.resolve(entryPath));
|
|
1925
|
+
expect(sourceFile).to.not.equal(undefined);
|
|
1926
|
+
if (!sourceFile)
|
|
1927
|
+
return;
|
|
1928
|
+
const ctx = createProgramContext(program, {
|
|
1929
|
+
sourceRoot: srcDir,
|
|
1930
|
+
rootNamespace: "TestApp",
|
|
1931
|
+
});
|
|
1932
|
+
const moduleResult = buildIrModule(sourceFile, program, {
|
|
1933
|
+
sourceRoot: srcDir,
|
|
1934
|
+
rootNamespace: "TestApp",
|
|
1935
|
+
}, ctx);
|
|
1936
|
+
expect(moduleResult.ok).to.equal(true);
|
|
1937
|
+
if (!moduleResult.ok)
|
|
1938
|
+
return;
|
|
1939
|
+
const sortDecl = moduleResult.value.body.find((stmt) => stmt.kind === "variableDeclaration" &&
|
|
1940
|
+
stmt.declarations[0]?.name.kind === "identifierPattern" &&
|
|
1941
|
+
stmt.declarations[0]?.name.name === "sortMenuEntries");
|
|
1942
|
+
expect(sortDecl).to.not.equal(undefined);
|
|
1943
|
+
if (!sortDecl)
|
|
1944
|
+
return;
|
|
1945
|
+
const initializer = sortDecl.declarations[0]?.initializer;
|
|
1946
|
+
expect(initializer?.kind).to.equal("arrowFunction");
|
|
1947
|
+
if (!initializer || initializer.kind !== "arrowFunction")
|
|
1948
|
+
return;
|
|
1949
|
+
expect(initializer.body.kind).to.equal("blockStatement");
|
|
1950
|
+
if (initializer.body.kind !== "blockStatement")
|
|
1951
|
+
return;
|
|
1952
|
+
const returnStmt = initializer.body.statements[0];
|
|
1953
|
+
expect(returnStmt?.kind).to.equal("returnStatement");
|
|
1954
|
+
if (!returnStmt || returnStmt.kind !== "returnStatement")
|
|
1955
|
+
return;
|
|
1956
|
+
const sortCall = returnStmt.expression;
|
|
1957
|
+
expect(sortCall?.kind).to.equal("call");
|
|
1958
|
+
if (!sortCall || sortCall.kind !== "call")
|
|
1959
|
+
return;
|
|
1960
|
+
expect(sortCall.callee.kind).to.equal("memberAccess");
|
|
1961
|
+
if (sortCall.callee.kind !== "memberAccess")
|
|
1962
|
+
return;
|
|
1963
|
+
expect(sortCall.callee.object.kind).to.equal("array");
|
|
1964
|
+
if (sortCall.callee.object.kind !== "array")
|
|
1965
|
+
return;
|
|
1966
|
+
const inferredType = sortCall.callee.object.inferredType;
|
|
1967
|
+
expect(inferredType?.kind).to.equal("arrayType");
|
|
1968
|
+
if (!inferredType || inferredType.kind !== "arrayType")
|
|
1969
|
+
return;
|
|
1970
|
+
expect(inferredType.elementType.kind).to.equal("referenceType");
|
|
1971
|
+
if (inferredType.elementType.kind !== "referenceType")
|
|
1972
|
+
return;
|
|
1973
|
+
expect(inferredType.elementType.name).to.equal("MenuEntry");
|
|
1974
|
+
const weightMember = inferredType.elementType.structuralMembers?.find((member) => member.kind === "propertySignature" && member.name === "weight");
|
|
1975
|
+
expect(weightMember).to.not.equal(undefined);
|
|
1976
|
+
expect(weightMember?.kind).to.equal("propertySignature");
|
|
1977
|
+
if (!weightMember || weightMember.kind !== "propertySignature")
|
|
1978
|
+
return;
|
|
1979
|
+
expect(weightMember.type).to.deep.equal({
|
|
1980
|
+
kind: "primitiveType",
|
|
1981
|
+
name: "number",
|
|
1982
|
+
});
|
|
1983
|
+
}
|
|
1984
|
+
finally {
|
|
1985
|
+
fs.rmSync(tempDir, { recursive: true, force: true });
|
|
1986
|
+
}
|
|
1987
|
+
});
|
|
1988
|
+
});
|
|
1989
|
+
});
|
|
1990
|
+
//# sourceMappingURL=js-surface-helpers.test.js.map
|