Fix incorrect emit for JSX/React

This commit is contained in:
Ron Buckton committed 2016-04-04 18:33:41 -07:00
1 parent 4d8c00f43d
commit 40a38001ad
2 files changed
+6 -6

No files matched your search

+4 -4
View File
@@ -528,12 +528,16 @@ const _super = (function (geti, seti) {
// JSX (non-expression)
case SyntaxKind.JsxText:
return emitJsxText(<JsxText>node);
case SyntaxKind.JsxOpeningElement:
return emitJsxOpeningElement(<JsxOpeningElement>node);
case SyntaxKind.JsxClosingElement:
return emitJsxClosingElement(<JsxClosingElement>node);
case SyntaxKind.JsxAttribute:
return emitJsxAttribute(<JsxAttribute>node);
case SyntaxKind.JsxSpreadAttribute:
return emitJsxSpreadAttribute(<JsxSpreadAttribute>node);
case SyntaxKind.JsxExpression:
return emitJsxExpression(<JsxExpression>node);
// Clauses
case SyntaxKind.CaseClause:
@@ -652,10 +656,6 @@ const _super = (function (geti, seti) {
return emitJsxElement(<JsxElement>node);
case SyntaxKind.JsxSelfClosingElement:
return emitJsxSelfClosingElement(<JsxSelfClosingElement>node);
case SyntaxKind.JsxOpeningElement:
return emitJsxOpeningElement(<JsxOpeningElement>node);
case SyntaxKind.JsxExpression:
return emitJsxExpression(<JsxExpression>node);
// Transformation nodes
case SyntaxKind.PartiallyEmittedExpression:
+2 -2
View File
@@ -234,10 +234,10 @@ namespace ts {
function getAttributeName(node: JsxAttribute): StringLiteral | Identifier {
const name = node.name;
if (/^[A-Za-z_]\w*$/.test(name.text)) {
return createLiteral(name.text);
return name;
}
else {
return name;
return createLiteral(name.text);
}
}