Fixed skipping spaces at the beginning of JSX contents.

Conflicts:
	acorn.js
This commit is contained in:
Ingvar Stepanyan 2014-07-10 13:43:16 +03:00
parent 2c3740c159
commit 3253f56602

View File

@ -544,7 +544,9 @@
tokEnd = tokPos;
if (options.locations) tokEndLoc = new Position;
tokType = type;
if (shouldSkipSpace !== false) skipSpace();
if (shouldSkipSpace !== false && !(inXJSTag && val === '>')) {
skipSpace();
}
tokVal = val;
tokRegexpAllowed = type.beforeExpr;
if (options.onToken) {
@ -830,15 +832,15 @@
if (options.locations) tokStartLoc = new Position;
if (forceRegexp) return readRegexp();
if (tokPos >= inputLen) return finishToken(_eof);
if (inXJSChild) {
readXJSText(['<', '{']);
if (tokEnd > tokStart) {
return;
}
}
var code = input.charCodeAt(tokPos);
// JSX content - either simple text, start of <tag> or {expression}
if (inXJSChild && code !== 60 && code !== 123) {
return readXJSText(['<', '{']);
}
if (inTemplate) return getTemplateToken(code);
// Identifier or keyword. '\uXXXX' sequences are allowed in