Index: src/parsing/parser-base.h |
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h |
index a5e757782b064ccae49e4c49f20cc47e70abdd8b..b19767d9a40d3516f45455790f8027c717e8bef8 100644 |
--- a/src/parsing/parser-base.h |
+++ b/src/parsing/parser-base.h |
@@ -3277,12 +3277,19 @@ void ParserBase<Traits>::CheckDestructuringElement( |
MessageTemplate::kInvalidDestructuringTarget; |
const Scanner::Location location(begin, end); |
if (expression->IsArrayLiteral() || expression->IsObjectLiteral() || |
- expression->IsAssignment()) |
+ expression->IsAssignment()) { |
+ if (expression->is_parenthesized()) { |
+ classifier->RecordPatternError(location, message); |
+ } |
return; |
+ } |
+ |
if (expression->IsProperty()) { |
classifier->RecordBindingPatternError(location, message); |
} else if (!this->IsAssignableIdentifier(expression)) { |
classifier->RecordPatternError(location, message); |
+ } else if (expression->is_parenthesized()) { |
+ classifier->RecordBindingPatternError(location, message); |
caitp (gmail)
2016/01/12 23:15:16
technically, this bit isn't needed because of an U
adamk
2016/01/12 23:17:11
I'd rather leave this out of the change if we were
caitp (gmail)
2016/01/12 23:31:18
Alright, done, anything else?
|
} |
} |