Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index 0910c98312b09d395b6cf478bd3d8fc785df2034..2dfe4a75a3ae9cbc349eef99623cb707bd2a3d6c 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -834,17 +834,21 @@ Handle<Context> Factory::NewCatchContext(Handle<JSFunction> function, |
} |
Handle<Context> Factory::NewDebugEvaluateContext(Handle<Context> previous, |
+ Handle<ScopeInfo> scope_info, |
Handle<JSReceiver> extension, |
Handle<Context> wrapped, |
Handle<StringSet> whitelist) { |
STATIC_ASSERT(Context::WHITE_LIST_INDEX == Context::MIN_CONTEXT_SLOTS + 1); |
+ Handle<ContextExtension> context_extension = NewContextExtension( |
+ scope_info, extension.is_null() ? Handle<Object>::cast(undefined_value()) |
+ : Handle<Object>::cast(extension)); |
Handle<FixedArray> array = NewFixedArray(Context::MIN_CONTEXT_SLOTS + 2); |
array->set_map_no_write_barrier(*debug_evaluate_context_map()); |
Handle<Context> c = Handle<Context>::cast(array); |
c->set_closure(wrapped.is_null() ? previous->closure() : wrapped->closure()); |
c->set_previous(*previous); |
c->set_native_context(previous->native_context()); |
- if (!extension.is_null()) c->set(Context::EXTENSION_INDEX, *extension); |
+ c->set_extension(*context_extension); |
if (!wrapped.is_null()) c->set(Context::WRAPPED_CONTEXT_INDEX, *wrapped); |
if (!whitelist.is_null()) c->set(Context::WHITE_LIST_INDEX, *whitelist); |
return c; |
@@ -852,13 +856,16 @@ Handle<Context> Factory::NewDebugEvaluateContext(Handle<Context> previous, |
Handle<Context> Factory::NewWithContext(Handle<JSFunction> function, |
Handle<Context> previous, |
+ Handle<ScopeInfo> scope_info, |
Handle<JSReceiver> extension) { |
+ Handle<ContextExtension> context_extension = |
+ NewContextExtension(scope_info, extension); |
Handle<FixedArray> array = NewFixedArray(Context::MIN_CONTEXT_SLOTS); |
array->set_map_no_write_barrier(*with_context_map()); |
Handle<Context> context = Handle<Context>::cast(array); |
context->set_closure(*function); |
context->set_previous(*previous); |
- context->set_extension(*extension); |
+ context->set_extension(*context_extension); |
context->set_native_context(previous->native_context()); |
return context; |
} |