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

Unified Diff: src/ast.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
« no previous file with comments | « no previous file | src/parser.cc » ('j') | src/parser.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index 7040ff78350bcfdc524114752ca33e559b0f1199..62d3b3ae52a447f40db77ea722bb9a7384648ed3 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -570,13 +570,25 @@ class VariableDeclaration FINAL : public Declaration {
bool is_class_declaration() const { return is_class_declaration_; }
+ // VariableDeclarations can be grouped into consecutive declaration
+ // groups. Each VariableDeclaration is associated with the start position of
+ // the group it belongs to. The positions are used for strong mode scope
+ // checks for classes and functions.
+ int consecutive_declaration_group_start() const {
rossberg 2015/04/21 13:30:02 Nit: also drop the "consecutive" (here and elsewhe
marja 2015/04/23 09:52:37 Done.
+ return consecutive_declaration_group_start_;
+ }
+
protected:
VariableDeclaration(Zone* zone, VariableProxy* proxy, VariableMode mode,
- Scope* scope, int pos, bool is_class_declaration = false)
+ Scope* scope, int pos, bool is_class_declaration = false,
+ int consecutive_declaration_group_start = -1)
: Declaration(zone, proxy, mode, scope, pos),
- is_class_declaration_(is_class_declaration) {}
+ is_class_declaration_(is_class_declaration),
+ consecutive_declaration_group_start_(
+ consecutive_declaration_group_start) {}
bool is_class_declaration_;
+ int consecutive_declaration_group_start_;
};
@@ -3218,9 +3230,11 @@ class AstNodeFactory FINAL BASE_EMBEDDED {
VariableDeclaration* NewVariableDeclaration(
VariableProxy* proxy, VariableMode mode, Scope* scope, int pos,
- bool is_class_declaration = false) {
+ bool is_class_declaration = false,
+ int consecutive_declaration_group_start = -1) {
return new (zone_) VariableDeclaration(zone_, proxy, mode, scope, pos,
- is_class_declaration);
+ is_class_declaration,
+ consecutive_declaration_group_start);
}
FunctionDeclaration* NewFunctionDeclaration(VariableProxy* proxy,
« no previous file with comments | « no previous file | src/parser.cc » ('j') | src/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698