@@ -40,7 +40,7 @@ namespace ts {
40
40
function transformJsxChildToExpression ( node : JsxChild ) : Expression {
41
41
switch ( node . kind ) {
42
42
case SyntaxKind . JsxText :
43
- return visitNonEmptyJsxText ( < JsxText > node ) ;
43
+ return visitJsxText ( < JsxText > node ) ;
44
44
45
45
case SyntaxKind . JsxExpression :
46
46
return visitJsxExpression ( < JsxExpression > node ) ;
@@ -69,7 +69,7 @@ namespace ts {
69
69
let objectProperties : Expression ;
70
70
if ( node . attributes . length === 0 ) {
71
71
// When there are no attributes, React wants "null"
72
- objectProperties = createLiteral ( null ) ;
72
+ objectProperties = createNull ( ) ;
73
73
}
74
74
else {
75
75
// Either emit one big object literal (no spread attribs), or
@@ -124,7 +124,7 @@ namespace ts {
124
124
return createPropertyAssignment ( name , expression ) ;
125
125
}
126
126
127
- function visitNonEmptyJsxText ( node : JsxText ) {
127
+ function visitJsxText ( node : JsxText ) {
128
128
const text = getTextToEmit ( node ) ;
129
129
if ( text !== undefined ) {
130
130
return createLiteral ( text ) ;
@@ -155,7 +155,7 @@ namespace ts {
155
155
const c = text . charCodeAt ( i ) ;
156
156
if ( isLineBreak ( c ) ) {
157
157
if ( firstNonWhitespace !== - 1 && ( lastNonWhitespace - firstNonWhitespace + 1 > 0 ) ) {
158
- let part = text . substr ( firstNonWhitespace , lastNonWhitespace - firstNonWhitespace + 1 ) ;
158
+ const part = text . substr ( firstNonWhitespace , lastNonWhitespace - firstNonWhitespace + 1 ) ;
159
159
result = ( result ? result + "\" + ' ' + \"" : "" ) + part ;
160
160
}
161
161
firstNonWhitespace = - 1 ;
@@ -218,11 +218,6 @@ namespace ts {
218
218
}
219
219
}
220
220
221
- function visitJsxText ( node : JsxText ) {
222
- const text = trimReactWhitespaceAndApplyEntities ( node ) ;
223
- return createLiteral ( text || "" ) ;
224
- }
225
-
226
221
function visitJsxExpression ( node : JsxExpression ) {
227
222
return visitNode ( node . expression , visitor , isExpression ) ;
228
223
}
0 commit comments