Index: src/runtime/runtime-function.cc |
diff --git a/src/runtime/runtime-function.cc b/src/runtime/runtime-function.cc |
index b294835916124dd11dd2c6dba11cf32e0b4aa8aa..499d4a9783f9dd7cc716610390d4636159b50cc3 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> map = Map::AsLanguageMode( |
+ initial_map, shared_info->language_mode(), shared_info->kind()); |
+ |
Handle<Context> context(func->context(), isolate); |
Handle<JSFunction> result = |
isolate->factory()->NewFunctionFromSharedFunctionInfo( |
- initial_map, shared_info, context, NOT_TENURED); |
+ map, shared_info, context, NOT_TENURED); |
DCHECK_EQ(func->IsConstructor(), result->IsConstructor()); |
return *result; |
} |