Index: src/api-natives.cc |
diff --git a/src/api-natives.cc b/src/api-natives.cc |
index c95f2ce2553210a33374c1fee23282096b05b862..978c21114e10b3495d5d1461d3c1fd4e1b7af03b 100644 |
--- a/src/api-natives.cc |
+++ b/src/api-natives.cc |
@@ -205,6 +205,10 @@ MaybeHandle<JSObject> InstantiateObject(Isolate* isolate, |
auto object = isolate->factory()->NewJSObject(cons); |
ASSIGN_RETURN_ON_EXCEPTION( |
isolate, result, ConfigureInstance(isolate, object, info), JSFunction); |
+ if (!constructor->IsUndefined()) { |
+ RETURN_ON_EXCEPTION( |
+ isolate, Execution::Call(isolate, cons, result, 0, nullptr), JSObject); |
+ } |
// TODO(dcarney): is this necessary? |
JSObject::MigrateSlowToFast(result, 0, "ApiNatives::InstantiateObject"); |
return scope.CloseAndEscape(result); |