diff --git a/internal/transformers/utilities.go b/internal/transformers/utilities.go index fd1ff7f2fd..3aab629e81 100644 --- a/internal/transformers/utilities.go +++ b/internal/transformers/utilities.go @@ -119,6 +119,8 @@ func isIdentifierReference(name *ast.IdentifierNode, parent *ast.Node) bool { return parent.AsImportAttribute().Value == name case ast.KindJsxOpeningElement: return parent.AsJsxOpeningElement().TagName == name + case ast.KindJsxClosingElement: + return parent.AsJsxClosingElement().TagName == name default: return false } diff --git a/testdata/baselines/reference/submodule/conformance/inlineJsxFactoryDeclarations.js b/testdata/baselines/reference/submodule/conformance/inlineJsxFactoryDeclarations.js index b4ab215907..b1e864f83d 100644 --- a/testdata/baselines/reference/submodule/conformance/inlineJsxFactoryDeclarations.js +++ b/testdata/baselines/reference/submodule/conformance/inlineJsxFactoryDeclarations.js @@ -49,7 +49,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.prerendered = void 0; /** @jsx h */ const renderer_1 = require("./renderer"); -exports.prerendered = ; +exports.prerendered = ; //// [othernoalias.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/testdata/baselines/reference/submodule/conformance/inlineJsxFactoryDeclarations.js.diff b/testdata/baselines/reference/submodule/conformance/inlineJsxFactoryDeclarations.js.diff index a76a931fff..d19b53d00a 100644 --- a/testdata/baselines/reference/submodule/conformance/inlineJsxFactoryDeclarations.js.diff +++ b/testdata/baselines/reference/submodule/conformance/inlineJsxFactoryDeclarations.js.diff @@ -16,7 +16,7 @@ -var renderer_1 = require("./renderer"); -exports.prerendered = (0, renderer_1.dom)("h", null); +const renderer_1 = require("./renderer"); -+exports.prerendered = ; ++exports.prerendered = ; //// [othernoalias.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/testdata/baselines/reference/submodule/conformance/inlineJsxFactoryDeclarationsLocalTypes.js b/testdata/baselines/reference/submodule/conformance/inlineJsxFactoryDeclarationsLocalTypes.js index f2d226654d..bf04289599 100644 --- a/testdata/baselines/reference/submodule/conformance/inlineJsxFactoryDeclarationsLocalTypes.js +++ b/testdata/baselines/reference/submodule/conformance/inlineJsxFactoryDeclarationsLocalTypes.js @@ -109,7 +109,7 @@ class MyClass { } } exports.MyClass = MyClass; -exports.tree = ; +exports.tree = ; exports.default = ; //// [index.js] "use strict"; @@ -133,6 +133,6 @@ class DOMClass { // Should work, everything is a DOM element const _tree = ; // Should fail, no dom elements -const _brokenTree = ; +const _brokenTree = ; // Should fail, nondom isn't allowed as children of dom const _brokenTree2 = {component_1.tree}{component_1.tree}; diff --git a/testdata/baselines/reference/submodule/conformance/inlineJsxFactoryDeclarationsLocalTypes.js.diff b/testdata/baselines/reference/submodule/conformance/inlineJsxFactoryDeclarationsLocalTypes.js.diff index fc97366235..ee44bca997 100644 --- a/testdata/baselines/reference/submodule/conformance/inlineJsxFactoryDeclarationsLocalTypes.js.diff +++ b/testdata/baselines/reference/submodule/conformance/inlineJsxFactoryDeclarationsLocalTypes.js.diff @@ -55,7 +55,7 @@ - (0, renderer2_1.predom)(MyClass, { x: 3, y: 4 }), - (0, renderer2_1.predom)(MyClass, { x: 5, y: 6 })); -exports.default = (0, renderer2_1.predom)("h", null); -+exports.tree = ; ++exports.tree = ; +exports.default = ; //// [index.js] "use strict"; @@ -116,7 +116,7 @@ -var _brokenTree = (0, renderer_1.dom)(component_1.MySFC, { x: 1, y: 2 }, - (0, renderer_1.dom)(component_1.MyClass, { x: 3, y: 4 }), - (0, renderer_1.dom)(component_1.MyClass, { x: 5, y: 6 })); -+const _brokenTree = ; ++const _brokenTree = ; // Should fail, nondom isn't allowed as children of dom -var _brokenTree2 = (0, renderer_1.dom)(DOMSFC, { x: 1, y: 2 }, - component_1.tree,