Avoid UnaryExpression-specific properties in SpreadElement (just in case).
This commit is contained in:
parent
72df78cc88
commit
b47696eecf
13
acorn.js
13
acorn.js
@ -1949,11 +1949,14 @@
|
||||
|
||||
function parseMaybeUnary() {
|
||||
if (tokType.prefix) {
|
||||
var node = startNode(), update = tokType.isUpdate;
|
||||
var nodeType = tokType === _ellipsis ? "SpreadElement" :
|
||||
(update ? "UpdateExpression" : "UnaryExpression");
|
||||
node.operator = tokVal;
|
||||
node.prefix = true;
|
||||
var node = startNode(), update = tokType.isUpdate, nodeType;
|
||||
if (tokType === _ellipsis) {
|
||||
nodeType = "SpreadElement";
|
||||
} else {
|
||||
nodeType = update ? "UpdateExpression" : "UnaryExpression";
|
||||
node.operator = tokVal;
|
||||
node.prefix = true;
|
||||
}
|
||||
tokRegexpAllowed = true;
|
||||
next();
|
||||
node.argument = parseMaybeUnary();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user