Fixed XJSEmptyExpression location tracking.
This commit is contained in:
parent
f53f89a0ae
commit
77e05c4edc
20
acorn.js
20
acorn.js
@ -2982,11 +2982,27 @@
|
||||
}
|
||||
|
||||
function parseXJSEmptyExpression() {
|
||||
var node = startNode();
|
||||
if (tokType !== _braceR) {
|
||||
unexpected();
|
||||
}
|
||||
return finishNode(node, "XJSEmptyExpression");
|
||||
|
||||
/**
|
||||
* XJSEmptyExpression is unique type since it doesn't actually parse anything,
|
||||
* and so it should start at the end of last read token (left brace) and finish
|
||||
* at the beginning of the next one (right brace).
|
||||
*/
|
||||
|
||||
var tmp;
|
||||
|
||||
tmp = tokStart;
|
||||
tokStart = lastEnd;
|
||||
lastEnd = tmp;
|
||||
|
||||
tmp = tokStartLoc;
|
||||
tokStartLoc = lastEndLoc;
|
||||
lastEndLoc = tmp;
|
||||
|
||||
return finishNode(startNode(), "XJSEmptyExpression");
|
||||
}
|
||||
|
||||
function parseXJSExpressionContainer() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user