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

Unified Diff: src/scopes.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
Index: src/scopes.h
diff --git a/src/scopes.h b/src/scopes.h
index 021b7b3b17820a8aae3da5aa20096c846d7f056d..f2ba050c7b997731a3d434d06a81fe0b38ffca8d 100644
--- a/src/scopes.h
+++ b/src/scopes.h
@@ -403,6 +403,8 @@ class Scope: public ZoneObject {
return has_simple_parameters_;
}
+ bool has_parameter_expressions() const { return has_parameter_expressions_; }
+
// TODO(caitp): manage this state in a better way. PreParser must be able to
// communicate that the scope is non-simple, without allocating any parameters
// as the Parser does. This is necessary to ensure that TC39's proposed early
@@ -419,6 +421,16 @@ class Scope: public ZoneObject {
return !scope->is_function_scope() || scope->has_simple_parameters();
}
+ void SetHasParameterExpressions() {
+ DCHECK(is_function_scope());
+ has_parameter_expressions_ = true;
+ }
+
+ bool HasParameterExpressions() {
+ Scope* scope = ClosureScope();
+ return !scope->is_function_scope() || scope->has_parameter_expressions();
+ }
+
// The local variable 'arguments' if we need to allocate it; NULL otherwise.
Variable* arguments() const {
DCHECK(!is_arrow_scope() || arguments_ == nullptr);
@@ -661,6 +673,7 @@ class Scope: public ZoneObject {
// Info about the parameter list of a function.
int arity_;
bool has_simple_parameters_;
+ bool has_parameter_expressions_;
Variable* rest_parameter_;
int rest_index_;
« no previous file with comments | « src/preparser.cc ('k') | src/scopes.cc » ('j') | test/mjsunit/harmony/destructuring.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698