Index: src/runtime/runtime-function.cc |
diff --git a/src/runtime/runtime-function.cc b/src/runtime/runtime-function.cc |
index b294835916124dd11dd2c6dba11cf32e0b4aa8aa..73e690a7b917314fdfb742a6ac44499406efa805 100644 |
--- a/src/runtime/runtime-function.cc |
+++ b/src/runtime/runtime-function.cc |
@@ -77,10 +77,13 @@ RUNTIME_FUNCTION(Runtime_CompleteFunctionConstruction) { |
JSFunction::GetDerivedMap(isolate, constructor, new_target)); |
Handle<SharedFunctionInfo> shared_info(func->shared(), isolate); |
+ |
+ Handle<Map> function_map = |
+ Map::AsLanguageMode(initial_map, shared_info->language_mode()); |
Handle<Context> context(func->context(), isolate); |
Handle<JSFunction> result = |
isolate->factory()->NewFunctionFromSharedFunctionInfo( |
- initial_map, shared_info, context, NOT_TENURED); |
+ function_map, shared_info, context, NOT_TENURED); |
DCHECK_EQ(func->IsConstructor(), result->IsConstructor()); |
return *result; |
} |