Constructor should wrap the this pointer.

This commit is contained in:
Cheng Zhao
2014-04-16 10:36:54 +08:00
parent bdfbef41c6
commit ac5be7dad7
3 changed files with 14 additions and 5 deletions

View File

@@ -143,10 +143,12 @@ class Constructor {
}
private:
static void New(const WrappableFactoryFunction& factory, Arguments* args) {
static void New(const WrappableFactoryFunction& factory,
v8::Isolate* isolate,
Arguments* args) {
WrappableBase* object = internal::InvokeFactory(args, factory);
if (object)
MATE_SET_INTERNAL_FIELD_POINTER(args->GetThis(), 0, object);
object->Wrap(isolate, args->GetThis());
else
args->ThrowError();