Allow multiline JSX string attributes.

This commit is contained in:
Andy VanWagoner 2015-02-12 19:05:07 -07:00
parent 3cbad64c1e
commit 9f73a10f61
2 changed files with 37 additions and 1 deletions

View File

@ -1190,7 +1190,7 @@
out += readJSXEntity();
chunkStart = tokPos;
} else {
if (isNewLine(ch)) raise(tokStart, "Unterminated string constant");
if (isNewLine(ch) && !isJSX) raise(tokStart, "Unterminated string constant");
++tokPos;
}
}

View File

@ -3587,6 +3587,42 @@ var fbTestFixture = {
closingElement: null,
children: []
}
},
'<path d="M230 80\n\t\tA 45 45, 0, 1, 0, 275 125 \r\n L 275 80 Z"/>': {
type: "ExpressionStatement",
expression: {
type: "JSXElement",
range: [0, 64],
openingElement: {
type: "JSXOpeningElement",
range: [0, 64],
attributes: [
{
type: "JSXAttribute",
range: [6, 62],
name: {
type: "JSXIdentifier",
range: [6, 7],
name: "d"
},
value: {
type: "Literal",
range: [8, 62],
value: "M230 80\n\t\tA 45 45, 0, 1, 0, 275 125 \r\n L 275 80 Z",
raw: "\"M230 80\n\t\tA 45 45, 0, 1, 0, 275 125 \r\n L 275 80 Z\""
}
}
],
name: {
type: "JSXIdentifier",
range: [1, 5],
name: "path"
},
selfClosing: true
},
closingElement: null,
children: []
}
}
}
};