Fixed skipping spaces at the beginning of JSX contents.
Conflicts: acorn.js
This commit is contained in:
parent
2c3740c159
commit
3253f56602
16
acorn.js
16
acorn.js
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user