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

Unified Diff: src/parser.cc

Issue 1282093002: Split function block scoping into a separate flag (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Propagate flag Created 5 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
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 45202cb3a82b922c7d487061cfff03578cc3a3c9..6d143965bef7b6cba4c3afa4ff5dc487f455a3ed 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -911,6 +911,7 @@ Parser::Parser(ParseInfo* info)
set_allow_lazy(info->allow_lazy_parsing());
set_allow_natives(FLAG_allow_natives_syntax || info->is_native());
set_allow_harmony_arrow_functions(FLAG_harmony_arrow_functions);
+ set_allow_harmony_block_function(FLAG_harmony_block_function);
set_allow_harmony_sloppy(FLAG_harmony_sloppy);
set_allow_harmony_sloppy_let(FLAG_harmony_sloppy_let);
set_allow_harmony_rest_parameters(FLAG_harmony_rest_parameters);
@@ -2222,8 +2223,10 @@ Statement* Parser::ParseFunctionDeclaration(
VariableMode mode =
is_strong(language_mode())
? CONST
- : (is_strict(language_mode()) || allow_harmony_sloppy()) &&
- !scope_->is_declaration_scope() ? LET : VAR;
+ : (is_strict(language_mode()) || allow_harmony_block_function()) &&
+ !scope_->is_declaration_scope()
+ ? LET
+ : VAR;
VariableProxy* proxy = NewUnresolved(name, mode);
Declaration* declaration =
factory()->NewFunctionDeclaration(proxy, mode, fun, scope_, pos);
« src/flag-definitions.h ('K') | « src/flag-definitions.h ('k') | src/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698