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

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: 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 | « no previous file | src/parser.cc » ('j') | no next file with comments »
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 18d19af67fb216e9952b5630f35d536bba7ce43e..f8c0b504deaa17f8b0066bbe0bfe1db764a77ee3 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -570,13 +570,22 @@ 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 declaration_group_start() const { return 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 declaration_group_start = -1)
: Declaration(zone, proxy, mode, scope, pos),
- is_class_declaration_(is_class_declaration) {}
+ is_class_declaration_(is_class_declaration),
+ declaration_group_start_(declaration_group_start) {}
bool is_class_declaration_;
+ int declaration_group_start_;
};
@@ -3216,9 +3225,10 @@ class AstNodeFactory final BASE_EMBEDDED {
VariableDeclaration* NewVariableDeclaration(
VariableProxy* proxy, VariableMode mode, Scope* scope, int pos,
- bool is_class_declaration = false) {
- return new (zone_) VariableDeclaration(zone_, proxy, mode, scope, pos,
- is_class_declaration);
+ bool is_class_declaration = false, int declaration_group_start = -1) {
+ return new (zone_)
+ VariableDeclaration(zone_, proxy, mode, scope, pos,
+ is_class_declaration, declaration_group_start);
}
FunctionDeclaration* NewFunctionDeclaration(VariableProxy* proxy,
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698