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

Unified Diff: src/variables.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: . 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
« src/scopes.cc ('K') | « src/scopes.cc ('k') | src/variables.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/variables.h
diff --git a/src/variables.h b/src/variables.h
index de7f39045af934d8a7d13320f58cbc8cb88588a2..94371609b0d860cd8823e649bf2442adeb17dabf 100644
--- a/src/variables.h
+++ b/src/variables.h
@@ -49,7 +49,8 @@ class Variable: public ZoneObject {
Variable(Scope* scope, const AstRawString* name, VariableMode mode, Kind kind,
InitializationFlag initialization_flag,
- MaybeAssignedFlag maybe_assigned_flag = kNotAssigned);
+ MaybeAssignedFlag maybe_assigned_flag = kNotAssigned,
+ int consecutive_declaration_group_start = -1);
// Printing support
static const char* Mode2String(VariableMode mode);
@@ -74,6 +75,9 @@ class Variable: public ZoneObject {
void set_is_used() { is_used_ = true; }
MaybeAssignedFlag maybe_assigned() const { return maybe_assigned_; }
void set_maybe_assigned() { maybe_assigned_ = kMaybeAssigned; }
+ int consecutive_declaration_group_start() const {
+ return consecutive_declaration_group_start_;
+ }
int initializer_position() { return initializer_position_; }
void set_initializer_position(int pos) { initializer_position_ = pos; }
@@ -148,6 +152,13 @@ class Variable: public ZoneObject {
return strong_mode_reference_end_position_;
}
+ Variable* corresponding_outer_class_variable() const {
+ return corresponding_outer_class_variable_;
+ }
+ void set_corresponding_outer_class_variable(Variable* var) {
+ corresponding_outer_class_variable_ = var;
+ }
+
private:
Scope* scope_;
const AstRawString* name_;
@@ -173,6 +184,13 @@ class Variable: public ZoneObject {
bool is_used_;
InitializationFlag initialization_flag_;
MaybeAssignedFlag maybe_assigned_;
+
+ // For classes and functions we keep track of consecutive groups of class /
+ // function delcarations. They are needed for strong mode scoping
+ // checks. TODO(marja, rossberg): Implement checks for functions too.
+ int consecutive_declaration_group_start_;
+ // For classes.
+ Variable* corresponding_outer_class_variable_;
rossberg 2015/04/21 13:30:02 As discussed offline, maybe we want to introduce a
marja 2015/04/23 09:52:37 Done.
};
« src/scopes.cc ('K') | « src/scopes.cc ('k') | src/variables.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698