@@ -343,7 +343,7 @@ pp.parseCallExpressionArguments = function (close, possibleAsyncArrow) {
|
||||
innerParenStart = this.state.start;
|
||||
}
|
||||
|
||||
elts.push(this.parseExprListItem(undefined, possibleAsyncArrow ? { start: 0 } : undefined));
|
||||
elts.push(this.parseExprListItem(false, possibleAsyncArrow ? { start: 0 } : undefined, possibleAsyncArrow ? { start: 0 } : undefined));
|
||||
}
|
||||
|
||||
// we found an async arrow function so let's not allow any inner parens
|
||||
@@ -1021,14 +1021,14 @@ pp.parseExprList = function (close, allowEmpty, refShorthandDefaultPos) {
|
||||
return elts;
|
||||
};
|
||||
|
||||
pp.parseExprListItem = function (allowEmpty, refShorthandDefaultPos) {
|
||||
pp.parseExprListItem = function (allowEmpty, refShorthandDefaultPos, refNeedsArrowPos) {
|
||||
let elt;
|
||||
if (allowEmpty && this.match(tt.comma)) {
|
||||
elt = null;
|
||||
} else if (this.match(tt.ellipsis)) {
|
||||
elt = this.parseSpread(refShorthandDefaultPos);
|
||||
} else {
|
||||
elt = this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem);
|
||||
elt = this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem, refNeedsArrowPos);
|
||||
}
|
||||
return elt;
|
||||
};
|
||||
|
||||
@@ -1087,9 +1087,9 @@ export default function (instance) {
|
||||
// parse an item inside a expression list eg. `(NODE, NODE)` where NODE represents
|
||||
// the position where this function is called
|
||||
instance.extend("parseExprListItem", function (inner) {
|
||||
return function (allowEmpty, refShorthandDefaultPos) {
|
||||
return function (...args) {
|
||||
const container = this.startNode();
|
||||
const node = inner.call(this, allowEmpty, refShorthandDefaultPos);
|
||||
const node = inner.call(this, ...args);
|
||||
if (this.match(tt.colon)) {
|
||||
container._exprListItem = true;
|
||||
container.expression = node;
|
||||
|
||||
Reference in New Issue
Block a user