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

Unified Diff: src/parsing/parser.cc

Issue 1836183002: Remove vestigial legacy const handling from parser (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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/pattern-rewriter.cc » ('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 e3063d8b1fc251ddc5b493391e5fbb858ad097ad..daa0a2df6dcc3f944493a0fc7dd4632cf260a1db 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -1982,14 +1982,6 @@ Variable* Parser::Declare(Declaration* declaration,
// RuntimeHidden_DeclareLookupSlot calls.
declaration_scope->AddDeclaration(declaration);
- if (mode == CONST_LEGACY && declaration_scope->is_script_scope()) {
- // For global const variables we bind the proxy to a variable.
- DCHECK(resolve); // should be set by all callers
- Variable::Kind kind = Variable::NORMAL;
- var = new (zone()) Variable(declaration_scope, name, mode, kind,
- kNeedsInitialization, kNotAssigned);
- }
-
// If requested and we have a local variable, bind the proxy to the variable
// at parse-time. This is used for functions (and consts) declared inside
// statements: the corresponding function (or const) variable must be in the
@@ -2366,9 +2358,8 @@ Block* Parser::ParseVariableDeclarations(
return nullptr;
}
- // 'let x' and (legacy) 'const x' initialize 'x' to undefined.
- if (parsing_result->descriptor.mode == LET ||
- parsing_result->descriptor.mode == CONST_LEGACY) {
+ // 'let x' initializes 'x' to undefined.
+ if (parsing_result->descriptor.mode == LET) {
caitp (gmail) 2016/04/14 00:17:30 This is not really the job of this CL, but this lo
caitp (gmail) 2016/04/14 00:25:16 eh, other vendors seem to behave the same, did the
adamk 2016/04/14 00:37:24 Nope, nothing recent here. Let variables are hole-
value = GetLiteralUndefined(position());
}
}
« no previous file with comments | « no previous file | src/parsing/pattern-rewriter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698