Skip to content

Commit 186e141

Browse files
committed
Capture refDestructuringErrors.
1 parent d4b7b02 commit 186e141

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/parse.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ export class CellParser extends Parser {
163163
this.O_function = 0;
164164
this.O_async = false;
165165
this.O_generator = false;
166+
this.O_destructuring = null;
166167
this.strict = true;
167168
this.enterScope(SCOPE_FUNCTION | SCOPE_ASYNC | SCOPE_GENERATOR);
168169

@@ -179,7 +180,7 @@ export class CellParser extends Parser {
179180
if (token.type === tt.parenL) {
180181
id = this.parseParenAndDistinguishExpression(true);
181182
if (id.type !== "ArrowFunctionExpression" && this.eat(tt.eq)) {
182-
id = this.toAssignable(id, true);
183+
id = this.toAssignable(id, true, this.O_destructuring);
183184
} else {
184185
body = id;
185186
id = null;
@@ -241,6 +242,10 @@ export class CellParser extends Parser {
241242
? node
242243
: super.toAssignable(node, isBinding, refDestructuringErrors);
243244
}
245+
checkExpressionErrors(refDestructuringErrors, andThrow) {
246+
this.O_destructuring = refDestructuringErrors;
247+
return super.checkExpressionErrors(refDestructuringErrors, andThrow);
248+
}
244249
checkUnreserved(node) {
245250
if (node.name === "viewof" || node.name === "mutable") {
246251
this.raise(node.start, `Unexpected keyword '${node.name}'`);

0 commit comments

Comments
 (0)