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

Unified Diff: src/scopes.cc

Issue 749633002: harmony-scoping: make assignment to 'const' a late error. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Comment update 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 | « src/runtime/runtime-scopes.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scopes.cc
diff --git a/src/scopes.cc b/src/scopes.cc
index bfadc211ca534eb8ca547669b9521446e1ea5949..65a91fc1b6ad0dd084eb7e1c1dd68954a8bc5b76 100644
--- a/src/scopes.cc
+++ b/src/scopes.cc
@@ -1093,21 +1093,6 @@ bool Scope::ResolveVariable(CompilationInfo* info, VariableProxy* proxy,
DCHECK(var != NULL);
if (proxy->is_assigned()) var->set_maybe_assigned();
- if (FLAG_harmony_scoping && strict_mode() == STRICT &&
- var->is_const_mode() && proxy->is_assigned()) {
- // Assignment to const. Throw a syntax error.
- MessageLocation location(
- info->script(), proxy->position(), proxy->position());
- Isolate* isolate = info->isolate();
- Factory* factory = isolate->factory();
- Handle<JSArray> array = factory->NewJSArray(0);
- Handle<Object> error;
- MaybeHandle<Object> maybe_error =
- factory->NewSyntaxError("harmony_const_assign", array);
- if (maybe_error.ToHandle(&error)) isolate->Throw(*error, &location);
- return false;
- }
-
if (FLAG_harmony_modules) {
bool ok;
#ifdef DEBUG
« no previous file with comments | « src/runtime/runtime-scopes.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698