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

Unified Diff: src/parsing/parser-base.h

Issue 2168563002: Implicitly pass 'scope()' as parent scope for function scopes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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/parsing/parser.cc ('k') | src/parsing/preparser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser-base.h
diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h
index a9a631132104242c8ef2b204d4325b35d0e669ef..b6cf8218e56daf14a554ff82e750d7dcf40d7508 100644
--- a/src/parsing/parser-base.h
+++ b/src/parsing/parser-base.h
@@ -625,9 +625,9 @@ class ParserBase : public Traits {
return result;
}
- Scope* NewFunctionScope(Scope* parent, FunctionKind kind) {
+ Scope* NewFunctionScope(FunctionKind kind) {
DCHECK(ast_value_factory());
- Scope* result = new (zone()) Scope(zone(), parent, FUNCTION_SCOPE, kind);
+ Scope* result = new (zone()) Scope(zone(), scope(), FUNCTION_SCOPE, kind);
result->Initialize();
if (!IsArrowFunction(kind)) {
result->DeclareThis(ast_value_factory());
@@ -2314,9 +2314,9 @@ ParserBase<Traits>::ParseAssignmentExpression(bool accept_IN,
ValidateFormalParameterInitializer(&arrow_formals_classifier, ok);
Scanner::Location loc(lhs_beg_pos, scanner()->location().end_pos);
- Scope* scope = this->NewFunctionScope(
- this->scope(), is_async ? FunctionKind::kAsyncArrowFunction
- : FunctionKind::kArrowFunction);
+ Scope* scope =
+ this->NewFunctionScope(is_async ? FunctionKind::kAsyncArrowFunction
+ : FunctionKind::kArrowFunction);
// Because the arrow's parameters were parsed in the outer scope, any
// usage flags that might have been triggered there need to be copied
// to the arrow scope.
« no previous file with comments | « src/parsing/parser.cc ('k') | src/parsing/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698