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

Unified Diff: src/hydrogen.cc

Issue 745963002: harmony-scoping: Disallow cross-script assignment to const (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years, 1 month 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 | test/cctest/test-decls.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 46a3810c75e840f16b9039d86ab9219962e761df..3044622fa35a18265fb9dd696df6a13f7ab64fbf 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -6556,6 +6556,9 @@ void HOptimizedGraphBuilder::HandleGlobalVariableAssignment(
global->native_context()->script_context_table());
ScriptContextTable::LookupResult lookup;
if (ScriptContextTable::Lookup(script_contexts, var->name(), &lookup)) {
+ if (lookup.mode == CONST) {
+ return Bailout(kNonInitializerAssignmentToConst);
+ }
Handle<Context> script_context =
ScriptContextTable::GetContext(script_contexts, lookup.context_index);
HStoreNamedField* instr = Add<HStoreNamedField>(
« no previous file with comments | « no previous file | test/cctest/test-decls.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698