Chromium Code Reviews| Index: src/factory.cc |
| diff --git a/src/factory.cc b/src/factory.cc |
| index 649f1ee9878a44c06c0a286ad82908a792d95f78..6dda60c07a374bcca9d0ce7e74cdffb45ed1a509 100644 |
| --- a/src/factory.cc |
| +++ b/src/factory.cc |
| @@ -800,6 +800,25 @@ Handle<Context> Factory::NewCatchContext(Handle<JSFunction> function, |
| return context; |
| } |
| +Handle<Context> Factory::NewDebugEvaluateContext( |
| + Handle<Context> previous, Handle<JSReceiver> extension, |
| + Handle<Context> wrapped, Handle<NameDictionary> 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> context = Handle<Context>::cast(array); |
| + context->set_closure(wrapped.is_null() ? previous->closure() |
| + : wrapped->closure()); |
| + context->set_previous(*previous); |
| + context->set_native_context(previous->native_context()); |
| + context->set(Context::EXTENSION_INDEX, |
| + extension.is_null() ? NULL : *extension); |
|
Camillo Bruni
2016/03/30 22:54:51
nit: should probably use nullptr here
|
| + context->set(Context::WRAPPED_CONTEXT_INDEX, |
| + wrapped.is_null() ? NULL : *wrapped); |
| + context->set(Context::WHITE_LIST_INDEX, |
| + whitelist.is_null() ? NULL : *whitelist); |
| + return context; |
| +} |
| Handle<Context> Factory::NewWithContext(Handle<JSFunction> function, |
| Handle<Context> previous, |