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

Unified Diff: src/ast/scopes.h

Issue 2232633002: Function name variable does not need a VariableDeclaration (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased Created 4 years, 4 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/ast/scopeinfo.cc ('k') | src/ast/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopes.h
diff --git a/src/ast/scopes.h b/src/ast/scopes.h
index d71f084ddc848571ebf964bd13e255e6b8ccc278..40fa7e9279b684a7d4ef47bb53fa7698908bd2b2 100644
--- a/src/ast/scopes.h
+++ b/src/ast/scopes.h
@@ -689,19 +689,12 @@ class DeclarationScope : public Scope {
// between this scope and the outer scope. (ECMA-262, 3rd., requires that
// the name of named function literal is kept in an intermediate scope
// in between this scope and the next outer scope.)
- Variable* LookupFunctionVar(const AstRawString* name,
- AstNodeFactory* factory);
+ Variable* LookupFunctionVar(const AstRawString* name);
// Declare the function variable for a function literal. This variable
// is in an intermediate scope between this function scope and the the
// outer scope. Only possible for function scopes; at most one variable.
- void DeclareFunctionVar(VariableDeclaration* declaration) {
- DCHECK(is_function_scope());
- // Handle implicit declaration of the function name in named function
- // expressions before other declarations.
- declarations()->InsertAt(0, declaration, zone());
- function_ = declaration;
- }
+ Variable* DeclareFunctionVar(const AstRawString* name);
// Declare a parameter in this scope. When there are duplicated
// parameters the rightmost one 'wins'. However, the implementation
@@ -735,7 +728,7 @@ class DeclarationScope : public Scope {
// The variable holding the function literal for named function
// literals, or NULL. Only valid for function scopes.
- VariableDeclaration* function() const {
+ Variable* function_var() const {
DCHECK(is_function_scope());
return function_;
}
@@ -889,7 +882,7 @@ class DeclarationScope : public Scope {
// Convenience variable.
Variable* receiver_;
// Function variable, if any; function scopes only.
- VariableDeclaration* function_;
+ Variable* function_;
// new.target variable, function scopes only.
Variable* new_target_;
// Convenience variable; function scopes only.
« no previous file with comments | « src/ast/scopeinfo.cc ('k') | src/ast/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698