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

Unified Diff: src/parsing/parser.cc

Issue 2158913005: Introduce NewScriptScope that creates a top-level scope (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 | « no previous file | src/parsing/parser-base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.cc
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
index 37e62c30907a9ce5d3905706c1474220b59e8ed3..6a1e86370b520390f7251b95200d3f62cf6f5d72 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -939,7 +939,7 @@ FunctionLiteral* Parser::DoParseProgram(ParseInfo* info) {
{
// TODO(wingo): Add an outer SCRIPT_SCOPE corresponding to the native
// context, which will have the "this" binding for script scopes.
- Scope* scope = NewScope(nullptr, SCRIPT_SCOPE);
+ Scope* scope = NewScriptScope();
info->set_script_scope(scope);
if (!info->context().is_null() && !info->context()->IsNativeContext()) {
scope = Scope::DeserializeScopeChain(info->isolate(), zone(),
@@ -1103,7 +1103,7 @@ FunctionLiteral* Parser::ParseLazy(Isolate* isolate, ParseInfo* info,
{
// Parse the function literal.
- Scope* scope = NewScope(nullptr, SCRIPT_SCOPE);
+ Scope* scope = NewScriptScope();
info->set_script_scope(scope);
if (!info->context().is_null()) {
// Ok to use Isolate here, since lazy function parsing is only done in the
« no previous file with comments | « no previous file | src/parsing/parser-base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698