Index: src/bootstrapper.cc |
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
index a7754dba1a861935354ad2be18e793cb650e9f26..be2f58e8754783763333d37ecf6b88e172dc9454 100644 |
--- a/src/bootstrapper.cc |
+++ b/src/bootstrapper.cc |
@@ -766,10 +766,20 @@ void Genesis::CreateStrictModeFunctionMaps(Handle<JSFunction> empty) { |
strict_function_map_writable_prototype_ = |
CreateStrictFunctionMap(FUNCTION_WITH_WRITEABLE_PROTOTYPE, empty); |
- // Special map for bound functions. |
- Handle<Map> bound_function_map = |
+ // Special map for non-constructor bound functions. |
+ // TODO(bmeurer): Bound functions should not be represented as JSFunctions. |
+ Handle<Map> bound_function_without_constructor_map = |
CreateStrictFunctionMap(BOUND_FUNCTION, empty); |
- native_context()->set_bound_function_map(*bound_function_map); |
+ native_context()->set_bound_function_without_constructor_map( |
+ *bound_function_without_constructor_map); |
+ |
+ // Special map for constructor bound functions. |
+ // TODO(bmeurer): Bound functions should not be represented as JSFunctions. |
+ Handle<Map> bound_function_with_constructor_map = |
+ Map::Copy(bound_function_without_constructor_map, "IsConstructor"); |
+ bound_function_with_constructor_map->set_is_constructor(true); |
+ native_context()->set_bound_function_with_constructor_map( |
+ *bound_function_with_constructor_map); |
} |