Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index 0a02a877495b35d543b67b5621ff99f80962913f..0910c98312b09d395b6cf478bd3d8fc785df2034 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -104,7 +104,6 @@ Handle<PrototypeInfo> Factory::NewPrototypeInfo() { |
Handle<ContextExtension> Factory::NewContextExtension( |
Handle<ScopeInfo> scope_info, Handle<Object> extension) { |
- DCHECK(scope_info->is_declaration_scope()); |
Handle<ContextExtension> result = |
Handle<ContextExtension>::cast(NewStruct(CONTEXT_EXTENSION_TYPE)); |
result->set_scope_info(*scope_info); |
@@ -816,18 +815,19 @@ Handle<Context> Factory::NewFunctionContext(int length, |
return context; |
} |
- |
Handle<Context> Factory::NewCatchContext(Handle<JSFunction> function, |
Handle<Context> previous, |
+ Handle<ScopeInfo> scope_info, |
Handle<String> name, |
Handle<Object> thrown_object) { |
STATIC_ASSERT(Context::MIN_CONTEXT_SLOTS == Context::THROWN_OBJECT_INDEX); |
+ Handle<ContextExtension> extension = NewContextExtension(scope_info, name); |
Handle<FixedArray> array = NewFixedArray(Context::MIN_CONTEXT_SLOTS + 1); |
array->set_map_no_write_barrier(*catch_context_map()); |
Handle<Context> context = Handle<Context>::cast(array); |
context->set_closure(*function); |
context->set_previous(*previous); |
- context->set_extension(*name); |
+ context->set_extension(*extension); |
context->set_native_context(previous->native_context()); |
context->set(Context::THROWN_OBJECT_INDEX, *thrown_object); |
return context; |