Reviewers: dcarney, Sven Panne,

Description:
Added constructor call on object in InstantiateObject method

I found after upgrading from 4.2.2 where apinatives.js still
existed to 4.4.56 where everything had been converted to C++ in
api-natives.cc, my constructors for ObjectTemplate instantiated objects
were no longer being called.  After investigation, I noticed in
apinatives.js that a new call would handle that, but there was no
corresponding constructor call in api-natives.cc (or anywhere else
along the chain of InstantiateObject), so I added a call to
Execution::Call to actually construct the object.  Forgive me if that
isn't the right place to add it (InitializeBody in objects-inl.h also
looked like a good place), or if there's a reason constructors are
not being called.

I also added myself to the AUTHORS file in this CL.

[email protected]
[email protected]
BUG=

Please review this at https://codereview.chromium.org/1137693003/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+2, -0 lines):
  M AUTHORS
  M src/api-natives.cc


Index: AUTHORS
diff --git a/AUTHORS b/AUTHORS
index b0a9765b4436a596aa75dc626df5a38e9dcf4732..2ac9cbf63b4ff54e3d6d8c828ff5e86b59a99816 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -98,3 +98,4 @@ Vladimir Shutoff <[email protected]>
 Yu Yin <[email protected]>
 Zhongping Wang <[email protected]>
 柳荣一 <[email protected]>
+David Talley <[email protected]>
\ No newline at end of file
Index: src/api-natives.cc
diff --git a/src/api-natives.cc b/src/api-natives.cc
index c95f2ce2553210a33374c1fee23282096b05b862..612d86c89700c6221d98ed73b84535305b525ec7 100644
--- a/src/api-natives.cc
+++ b/src/api-natives.cc
@@ -206,6 +206,7 @@ MaybeHandle<JSObject> InstantiateObject(Isolate* isolate,
   ASSIGN_RETURN_ON_EXCEPTION(
isolate, result, ConfigureInstance(isolate, object, info), JSFunction);
   // TODO(dcarney): is this necessary?
+  Execution::Call(isolate, cons, object, 0, nullptr);
   JSObject::MigrateSlowToFast(result, 0, "ApiNatives::InstantiateObject");
   return scope.CloseAndEscape(result);
 }


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to