Skip to content

Commit 18d3b29

Browse files
asgerfCopilot
andauthored
Allow MemberExpression in RestElement argument
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 627f35b commit 18d3b29

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎javascript/extractor/src/com/semmle/jcorn/Parser.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2359,7 +2359,8 @@ protected List<Expression> toAssignableList(List<Expression> exprList, boolean i
23592359
} else if (last != null && last instanceof SpreadElement) {
23602360
Expression arg = ((SpreadElement) last).getArgument();
23612361
arg = (Expression) this.toAssignable(arg, isBinding);
2362-
if (!(arg instanceof IPattern)) this.unexpected(arg.getLoc().getStart());
2362+
if (!(arg instanceof IPattern || arg instanceof MemberExpression))
2363+
this.unexpected(arg.getLoc().getStart());
23632364
exprList.set(end - 1, last = new RestElement(last.getLoc(), arg));
23642365
--end;
23652366
}

0 commit comments

Comments
 (0)