Chromium Code Reviews| 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.
|
| }; |