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

Unified Diff: src/ast/scopes.cc

Issue 1723313002: [parser] Enforce module-specific identifier restriction (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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/ast/scopes.cc
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc
index 7c87ce39e95a44a8f8e8e1932b1a3f67b16e1d8f..bb5581bd28f040725dfc45cfaf12674205137e86 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -171,6 +171,7 @@ void Scope::SetDefaults(ScopeType scope_type, Scope* outer_scope,
this_function_ = nullptr;
illegal_redecl_ = nullptr;
scope_inside_with_ = false;
+ scope_inside_module_ = false;
scope_contains_with_ = false;
scope_calls_eval_ = false;
scope_uses_arguments_ = false;
@@ -311,8 +312,11 @@ void Scope::Initialize() {
if (outer_scope_ != NULL) {
outer_scope_->inner_scopes_.Add(this, zone());
scope_inside_with_ = outer_scope_->scope_inside_with_ || is_with_scope();
+ scope_inside_module_ =
+ outer_scope_->scope_inside_module_ || is_module_scope();
} else {
scope_inside_with_ = is_with_scope();
+ scope_inside_module_ = is_module_scope();
}
// Declare convenience variables and the receiver.
@@ -999,6 +1003,7 @@ void Scope::Print(int n) {
Indent(n1, "// strict mode scope\n");
}
if (scope_inside_with_) Indent(n1, "// scope inside 'with'\n");
+ if (scope_inside_module_) Indent(n1, "// scope inside module code\n");
if (scope_contains_with_) Indent(n1, "// scope contains 'with'\n");
if (scope_calls_eval_) Indent(n1, "// scope calls 'eval'\n");
if (scope_uses_arguments_) Indent(n1, "// scope uses 'arguments'\n");

Powered by Google App Engine
This is Rietveld 408576698