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

Unified Diff: src/parsing/parser.cc

Issue 1895973002: Remove all non-function-name uses of CONST_LEGACY (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove now-unused bits in TF and CS Created 4 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 | « src/interpreter/bytecode-generator.cc ('k') | src/runtime/runtime.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 53d18fb3e9b9304d1def1dfcd04806924f298231..819c768546f9718f79a2154bc115c57b55bf74d3 100644
--- a/src/parsing/parser.cc
+++ b/src/parsing/parser.cc
@@ -1416,7 +1416,7 @@ ZoneList<ImportDeclaration*>* Parser::ParseNamedImports(int pos, bool* ok) {
ReportMessage(MessageTemplate::kStrictEvalArguments);
return NULL;
}
- VariableProxy* proxy = NewUnresolved(local_name, IMPORT);
+ VariableProxy* proxy = NewUnresolved(local_name, CONST);
ImportDeclaration* declaration =
factory()->NewImportDeclaration(proxy, import_name, NULL, scope_, pos);
Declare(declaration, DeclarationDescriptor::NORMAL, true, CHECK_OK);
@@ -1464,7 +1464,7 @@ Statement* Parser::ParseImportDeclaration(bool* ok) {
if (tok != Token::MUL && tok != Token::LBRACE) {
const AstRawString* local_name =
ParseIdentifier(kDontAllowRestrictedIdentifiers, CHECK_OK);
- VariableProxy* proxy = NewUnresolved(local_name, IMPORT);
+ VariableProxy* proxy = NewUnresolved(local_name, CONST);
import_default_declaration = factory()->NewImportDeclaration(
proxy, ast_value_factory()->default_string(), NULL, scope_, pos);
Declare(import_default_declaration, DeclarationDescriptor::NORMAL, true,
@@ -1870,6 +1870,7 @@ Variable* Parser::Declare(Declaration* declaration,
DCHECK(proxy->raw_name() != NULL);
const AstRawString* name = proxy->raw_name();
VariableMode mode = declaration->mode();
+ DCHECK(IsDeclaredVariableMode(mode) && mode != CONST_LEGACY);
bool is_function_declaration = declaration->IsFunctionDeclaration();
if (scope == nullptr) scope = scope_;
Scope* declaration_scope =
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698