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

Unified Diff: src/expression-classifier.h

Issue 1308123007: [es6] conditionally ignore TDZ semantics for formals (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « no previous file | src/parser.cc » ('j') | test/mjsunit/harmony/destructuring.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/expression-classifier.h
diff --git a/src/expression-classifier.h b/src/expression-classifier.h
index fb45f41fa169368b998aacf33afdeaf33e44ec51..a20d29f011d85c4c59a7be7010a25095e5f71a2c 100644
--- a/src/expression-classifier.h
+++ b/src/expression-classifier.h
@@ -48,7 +48,11 @@ class ExpressionClassifier {
ArrowFormalParametersProduction)
};
- enum FunctionProperties { NonSimpleParameter = 1 << 0 };
+ enum FunctionProperties {
+ NonSimpleParameter = 1 << 0,
+ ContainsExpressions = 1 << 1,
+ ArgumentsParameter = 1 << 2
+ };
ExpressionClassifier()
: invalid_productions_(0),
@@ -136,6 +140,22 @@ class ExpressionClassifier {
function_properties_ |= NonSimpleParameter;
}
+ bool contains_expressions() const {
+ return (function_properties_ & ContainsExpressions);
+ }
+
+ void RecordContainsExpressions() {
+ function_properties_ |= ContainsExpressions;
+ }
+
+ bool has_arguments_parameter() const {
+ return (function_properties_ & ArgumentsParameter);
+ }
+
+ void RecordArgumentsParameter() {
+ function_properties_ |= ArgumentsParameter;
+ }
+
void RecordExpressionError(const Scanner::Location& loc,
MessageTemplate::Template message,
const char* arg = nullptr) {
« no previous file with comments | « no previous file | src/parser.cc » ('j') | test/mjsunit/harmony/destructuring.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698