mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-12 04:17:34 -06:00
Revert "Instead of creating clone of the jsxFactory's leaf node, create synthesized node"
This reverts commit 4e7313b4f69682df92c48feac6aa50910a592d04.
This commit is contained in:
parent
4e7313b4f6
commit
79bf477b67
@ -1677,10 +1677,16 @@ namespace ts {
|
||||
|
||||
function createJsxFactoryExpressionFromEntityName(jsxFactory: EntityName, parent: JsxOpeningLikeElement): Expression {
|
||||
if (isQualifiedName(jsxFactory)) {
|
||||
const left = createJsxFactoryExpressionFromEntityName(jsxFactory.left, parent);
|
||||
const right = <Identifier>createSynthesizedNode(SyntaxKind.Identifier);
|
||||
right.text = jsxFactory.right.text;
|
||||
return createPropertyAccess(left, right);
|
||||
return createPropertyAccess(
|
||||
createJsxFactoryExpressionFromEntityName(
|
||||
jsxFactory.left,
|
||||
parent
|
||||
),
|
||||
setEmitFlags(
|
||||
getMutableClone(jsxFactory.right),
|
||||
EmitFlags.NoSourceMap
|
||||
)
|
||||
);
|
||||
}
|
||||
else {
|
||||
return createReactNamespace(jsxFactory.text, parent);
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
//// [index.tsx]
|
||||
|
||||
import "./jsx";
|
||||
|
||||
var skate: any;
|
||||
const React = { createElement: skate.h };
|
||||
|
||||
class Component {
|
||||
renderCallback() {
|
||||
return <div>test</div>;
|
||||
}
|
||||
};
|
||||
|
||||
//// [index.js]
|
||||
"use strict";
|
||||
require("./jsx");
|
||||
var skate;
|
||||
var React = { createElement: skate.h };
|
||||
var Component = (function () {
|
||||
function Component() {
|
||||
}
|
||||
Component.prototype.renderCallback = function () {
|
||||
return skate.h("div", null, "test");
|
||||
};
|
||||
return Component;
|
||||
}());
|
||||
;
|
||||
@ -1,23 +0,0 @@
|
||||
=== tests/cases/compiler/index.tsx ===
|
||||
|
||||
import "./jsx";
|
||||
|
||||
var skate: any;
|
||||
>skate : Symbol(skate, Decl(index.tsx, 3, 3))
|
||||
|
||||
const React = { createElement: skate.h };
|
||||
>React : Symbol(React, Decl(index.tsx, 4, 5))
|
||||
>createElement : Symbol(createElement, Decl(index.tsx, 4, 15))
|
||||
>skate : Symbol(skate, Decl(index.tsx, 3, 3))
|
||||
|
||||
class Component {
|
||||
>Component : Symbol(Component, Decl(index.tsx, 4, 41))
|
||||
|
||||
renderCallback() {
|
||||
>renderCallback : Symbol(Component.renderCallback, Decl(index.tsx, 6, 17))
|
||||
|
||||
return <div>test</div>;
|
||||
>div : Symbol(unknown)
|
||||
>div : Symbol(unknown)
|
||||
}
|
||||
};
|
||||
@ -1,27 +0,0 @@
|
||||
=== tests/cases/compiler/index.tsx ===
|
||||
|
||||
import "./jsx";
|
||||
|
||||
var skate: any;
|
||||
>skate : any
|
||||
|
||||
const React = { createElement: skate.h };
|
||||
>React : { createElement: any; }
|
||||
>{ createElement: skate.h } : { createElement: any; }
|
||||
>createElement : any
|
||||
>skate.h : any
|
||||
>skate : any
|
||||
>h : any
|
||||
|
||||
class Component {
|
||||
>Component : Component
|
||||
|
||||
renderCallback() {
|
||||
>renderCallback : () => any
|
||||
|
||||
return <div>test</div>;
|
||||
><div>test</div> : any
|
||||
>div : any
|
||||
>div : any
|
||||
}
|
||||
};
|
||||
@ -1,17 +0,0 @@
|
||||
//@module: commonjs
|
||||
//@target: es5
|
||||
//@jsx: react
|
||||
//@jsxFactory: skate.h
|
||||
//@noEmit: false
|
||||
|
||||
// @filename: index.tsx
|
||||
import "./jsx";
|
||||
|
||||
var skate: any;
|
||||
const React = { createElement: skate.h };
|
||||
|
||||
class Component {
|
||||
renderCallback() {
|
||||
return <div>test</div>;
|
||||
}
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user