Index: src/runtime/runtime-debug.cc |
diff --git a/src/runtime/runtime-debug.cc b/src/runtime/runtime-debug.cc |
index 660fc7ffa2b1055010db4f37751b3a297c8b2e26..d071cbf7f9ddfb721c417899d422ecf83c6e2520 100644 |
--- a/src/runtime/runtime-debug.cc |
+++ b/src/runtime/runtime-debug.cc |
@@ -2500,18 +2500,21 @@ class EvaluationContextBuilder { |
outer_info_ = handle(function->shared()); |
Handle<Context> inner_context; |
- // The "this" binding, if any, can't be bound via "with". If we need to, |
- // add another node onto the outer context to bind "this". |
- if (!MaterializeReceiver(isolate, outer_context, function, frame) |
- .ToHandle(&outer_context)) |
- return; |
- |
bool stop = false; |
for (ScopeIterator it(isolate, frame, inlined_jsframe_index); |
!it.Failed() && !it.Done() && !stop; it.Next()) { |
ScopeIterator::ScopeType scope_type = it.Type(); |
if (scope_type == ScopeIterator::ScopeTypeLocal) { |
+ Handle<Context> parent_context = |
+ it.HasContext() ? it.CurrentContext() : outer_context; |
+ |
+ // The "this" binding, if any, can't be bound via "with". If we need |
+ // to, add another node onto the outer context to bind "this". |
+ if (!MaterializeReceiver(isolate, parent_context, function, frame) |
+ .ToHandle(&parent_context)) |
+ return; |
+ |
Handle<JSObject> materialized_function = |
NewJSObjectWithNullProto(isolate); |
@@ -2525,8 +2528,6 @@ class EvaluationContextBuilder { |
.ToHandle(&materialized_function)) |
return; |
- Handle<Context> parent_context = |
- it.HasContext() ? it.CurrentContext() : outer_context; |
Handle<Context> with_context = isolate->factory()->NewWithContext( |
function, parent_context, materialized_function); |