Fix React whitespace emit #4376

This commit is contained in:
Ryan Cavanaugh
2015-08-20 11:38:03 -07:00
parent 5035559c59
commit f659c9098c
8 changed files with 133 additions and 9 deletions

View File

@@ -6463,7 +6463,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
function trimReactWhitespace(node: JsxText): string {
let result: string = undefined;
let text = getTextOfNode(node);
let text = getTextOfNode(node, true);
let firstNonWhitespace = 0;
let lastNonWhitespace = -1;
@@ -6498,7 +6498,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
switch (compilerOptions.jsx) {
case JsxEmit.React:
let text = trimReactWhitespace(node);
if (text.length === 0) {
if (text === undefined || text.length === 0) {
return undefined;
}
else {