Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index 649f1ee9878a44c06c0a286ad82908a792d95f78..85e7a438613bfb89d91f626a7eca2bc39626c2f4 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -800,6 +800,22 @@ Handle<Context> Factory::NewCatchContext(Handle<JSFunction> function, |
return context; |
} |
+Handle<Context> Factory::NewDebugEvaluateContext(Handle<Context> previous, |
+ Handle<JSReceiver> extension, |
+ Handle<Context> wrapped, |
+ Handle<StringSet> whitelist) { |
+ STATIC_ASSERT(Context::WHITE_LIST_INDEX == Context::MIN_CONTEXT_SLOTS + 1); |
+ 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); |
+ if (!wrapped.is_null()) c->set(Context::WRAPPED_CONTEXT_INDEX, *wrapped); |
+ if (!whitelist.is_null()) c->set(Context::WHITE_LIST_INDEX, *whitelist); |
+ return c; |
+} |
Handle<Context> Factory::NewWithContext(Handle<JSFunction> function, |
Handle<Context> previous, |