Index: src/runtime/runtime-scopes.cc |
diff --git a/src/runtime/runtime-scopes.cc b/src/runtime/runtime-scopes.cc |
index c935cdabef7728503710995105291e5da72eca51..cd13b39e9467af314c41eb0dd87d072dd42f2242 100644 |
--- a/src/runtime/runtime-scopes.cc |
+++ b/src/runtime/runtime-scopes.cc |
@@ -298,9 +298,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 |