Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: src/api-natives.cc

Issue 1137693003: Added constructor call on object in InstantiateObject method (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Wrapped Execution::Call in RETURN_ON_EXCEPTION Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698