Commit 626f110f authored by dslomov's avatar dslomov Committed by Commit bot

Introduce legacy const slots in correct context.

R=rossberg@chromium.org
BUG=chromium:410030
LOG=Y

Review URL: https://codereview.chromium.org/756293004

Cr-Commit-Position: refs/heads/master@{#25519}
parent 4695abca
......@@ -314,9 +314,11 @@ RUNTIME_FUNCTION(Runtime_InitializeLegacyConstLookupSlot) {
// The declared const was configurable, and may have been deleted in the
// meanwhile. If so, re-introduce the variable in the context extension.
DCHECK(context_arg->has_extension());
if (attributes == ABSENT) {
holder = handle(context_arg->extension(), isolate);
Handle<Context> declaration_context(context_arg->declaration_context());
DCHECK(declaration_context->has_extension());
holder = handle(declaration_context->extension(), isolate);
CHECK(holder->IsJSObject());
} else {
// For JSContextExtensionObjects, the initializer can be run multiple times
// if in a for loop: for (var i = 0; i < 2; i++) { const x = i; }. Only the
......
// Copyright 2014 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
try {
throw 0;
} catch(e) {
assertSame(3, eval("delete x; const x=3; x"));
}
try {
throw 0;
} catch(e) {
assertSame(3, (1,eval)("delete x1; const x1=3; x1"));
}
try {
throw 0;
} catch(e) {
with({}) {
assertSame(3, eval("delete x2; const x2=3; x2"));
}
}
(function f() {
try {
throw 0;
} catch(e) {
assertSame(3, eval("delete x; const x=3; x"));
}
}());
(function f() {
try {
throw 0;
} catch(e) {
assertSame(3, (1,eval)("delete x4; const x4=3; x4"));
}
}());
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment