Version 3.30.33.9 (cherry-pick)
Merged 626f110f0b39ae30d5787c38357ac6c85202a2d7
Introduce legacy const slots in correct context.
BUG=chromium:410030
LOG=N
R=svenpanne@chromium.org
Review URL: https://codereview.chromium.org/812493002
Cr-Commit-Position: refs/branch-heads/3.30@{#25263}
diff --git a/src/runtime/runtime-scopes.cc b/src/runtime/runtime-scopes.cc
index c935cda..cd13b39 100644
--- a/src/runtime/runtime-scopes.cc
+++ b/src/runtime/runtime-scopes.cc
@@ -298,9 +298,11 @@
// 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
diff --git a/src/version.cc b/src/version.cc
index 0e3a188..60eb703 100644
--- a/src/version.cc
+++ b/src/version.cc
@@ -35,7 +35,7 @@
#define MAJOR_VERSION 3
#define MINOR_VERSION 30
#define BUILD_NUMBER 33
-#define PATCH_LEVEL 8
+#define PATCH_LEVEL 9
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
#define IS_CANDIDATE_VERSION 0
diff --git a/test/mjsunit/regress/regress-410030.js b/test/mjsunit/regress/regress-410030.js
new file mode 100644
index 0000000..efd4b1e
--- /dev/null
+++ b/test/mjsunit/regress/regress-410030.js
@@ -0,0 +1,43 @@
+// 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"));
+ }
+}());