Fix spaceSkip after inXJSChildExpression
This commit is contained in:
parent
ae9fae6c76
commit
d3cece14fd
8
acorn.js
8
acorn.js
@ -273,7 +273,8 @@
|
|||||||
// that `break` and `continue` have somewhere to jump to, and
|
// that `break` and `continue` have somewhere to jump to, and
|
||||||
// `strict` indicates whether strict mode is on.
|
// `strict` indicates whether strict mode is on.
|
||||||
|
|
||||||
var inFunction, inGenerator, labels, strict, inXJSChild, inXJSTag;
|
var inFunction, inGenerator, labels, strict,
|
||||||
|
inXJSChild, inXJSTag, inXJSChildExpression;
|
||||||
|
|
||||||
// This counter is used for checking that arrow expressions did
|
// This counter is used for checking that arrow expressions did
|
||||||
// not contain nested parentheses in argument list.
|
// not contain nested parentheses in argument list.
|
||||||
@ -580,7 +581,8 @@
|
|||||||
tokEnd = tokPos;
|
tokEnd = tokPos;
|
||||||
if (options.locations) tokEndLoc = new Position;
|
if (options.locations) tokEndLoc = new Position;
|
||||||
tokType = type;
|
tokType = type;
|
||||||
if (shouldSkipSpace !== false && !(inXJSTag && type === _gt) && !(inXJSChild && tokType !== _braceL)) {
|
if (shouldSkipSpace !== false && !(inXJSTag && type === _gt) &&
|
||||||
|
!((inXJSChild && tokType !== _braceL) || (inXJSChildExpression && tokType === _braceR))) {
|
||||||
skipSpace();
|
skipSpace();
|
||||||
}
|
}
|
||||||
tokVal = val;
|
tokVal = val;
|
||||||
@ -3059,12 +3061,14 @@
|
|||||||
|
|
||||||
inXJSTag = false;
|
inXJSTag = false;
|
||||||
inXJSChild = false;
|
inXJSChild = false;
|
||||||
|
inXJSChildExpression = origInXJSChild;
|
||||||
|
|
||||||
next();
|
next();
|
||||||
node.expression = tokType === _braceR ? parseXJSEmptyExpression() : parseExpression();
|
node.expression = tokType === _braceR ? parseXJSEmptyExpression() : parseExpression();
|
||||||
|
|
||||||
inXJSTag = origInXJSTag;
|
inXJSTag = origInXJSTag;
|
||||||
inXJSChild = origInXJSChild;
|
inXJSChild = origInXJSChild;
|
||||||
|
inXJSChildExpression = false;
|
||||||
|
|
||||||
expect(_braceR);
|
expect(_braceR);
|
||||||
return finishNode(node, "XJSExpressionContainer");
|
return finishNode(node, "XJSExpressionContainer");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user