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

Unified Diff: src/scopes.h

Issue 1060913005: [strong] Stricter check for referring to other classes inside methods. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: code review (rossberg@) Created 5 years, 8 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 | « src/parser.cc ('k') | src/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scopes.h
diff --git a/src/scopes.h b/src/scopes.h
index 409fa2f2523f58c492670ca4b3188d6e31167dd5..5e3dc1f0654bf65c3ee738665fcb7bf2107be63b 100644
--- a/src/scopes.h
+++ b/src/scopes.h
@@ -23,7 +23,8 @@ class VariableMap: public ZoneHashMap {
Variable* Declare(Scope* scope, const AstRawString* name, VariableMode mode,
Variable::Kind kind, InitializationFlag initialization_flag,
- MaybeAssignedFlag maybe_assigned_flag = kNotAssigned);
+ MaybeAssignedFlag maybe_assigned_flag = kNotAssigned,
+ int declaration_group_start = -1);
Variable* Lookup(const AstRawString* name);
@@ -131,7 +132,8 @@ class Scope: public ZoneObject {
// declared before, the previously declared variable is returned.
Variable* DeclareLocal(const AstRawString* name, VariableMode mode,
InitializationFlag init_flag, Variable::Kind kind,
- MaybeAssignedFlag maybe_assigned_flag = kNotAssigned);
+ MaybeAssignedFlag maybe_assigned_flag = kNotAssigned,
+ int declaration_group_start = -1);
// Declare an implicit global variable in this scope which must be a
// script scope. The variable was introduced (possibly from an inner
@@ -411,6 +413,15 @@ class Scope: public ZoneObject {
// The ModuleDescriptor for this scope; only for module scopes.
ModuleDescriptor* module() const { return module_descriptor_; }
+
+ void set_class_declaration_group_start(int position) {
+ class_declaration_group_start_ = position;
+ }
+
+ int class_declaration_group_start() const {
+ return class_declaration_group_start_;
+ }
+
// ---------------------------------------------------------------------------
// Variable allocation.
@@ -677,7 +688,7 @@ class Scope: public ZoneObject {
// If this scope is a method scope of a class, return the corresponding
// class variable, otherwise nullptr.
- Variable* ClassVariableForMethod() const;
+ ClassVariable* ClassVariableForMethod() const;
// Scope analysis.
void PropagateScopeInfo(bool outer_scope_calls_sloppy_eval);
@@ -732,6 +743,10 @@ class Scope: public ZoneObject {
Zone* zone_;
PendingCompilationErrorHandler pending_error_handler_;
+
+ // For tracking which classes are declared consecutively. Needed for strong
+ // mode.
+ int class_declaration_group_start_;
};
} } // namespace v8::internal
« no previous file with comments | « src/parser.cc ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698