Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(768)

Unified Diff: src/parsing/preparser.h

Issue 1570793002: [parser] parenthesized Literals are not valid AssignmentPatterns (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/parsing/preparser.h
diff --git a/src/parsing/preparser.h b/src/parsing/preparser.h
index 9253ad5e518f93b9cfc08393a475912eb6377e85..d3fc145ccbb0c6c5041a46295aeddc38c518bb9f 100644
--- a/src/parsing/preparser.h
+++ b/src/parsing/preparser.h
@@ -279,6 +279,10 @@ class PreParserExpression {
int position() const { return RelocInfo::kNoPosition; }
void set_function_token_position(int position) {}
+ // Parenthesized expressions in the form `( Expression )`.
+ void set_is_parenthesized() { code_ |= ParenthesizedField::encode(true); }
+ bool is_parenthesized() const { return ParenthesizedField::decode(code_); }
+
private:
enum Type {
kExpression,
@@ -314,6 +318,7 @@ class PreParserExpression {
typedef BitField<PreParserIdentifier::Type, TypeField::kNext, 10>
IdentifierTypeField;
typedef BitField<bool, TypeField::kNext, 1> HasCoverInitializedNameField;
+ typedef BitField<bool, 31, 1> ParenthesizedField;
uint32_t code_;
};

Powered by Google App Engine
This is Rietveld 408576698