Skip to content

Commit cf02f73

Browse files
author
Gabriel Schulhof
committed
examples: fix abort in nan version of 7_object_wrap
When creating a prototype method, the `FunctionTemplate` must be attached to the `PrototypeTemplate`, not the resulting `Function`. Fixes: #64 PR-URL: #70 Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
1 parent 41cda31 commit cf02f73

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

7_factory_wrap/nan/myobject.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void MyObject::Init() {
1717
tpl->InstanceTemplate()->SetInternalFieldCount(1);
1818
// Prototype
1919
tpl->PrototypeTemplate()->Set(Nan::New("plusOne").ToLocalChecked(),
20-
Nan::New<v8::FunctionTemplate>(PlusOne)->GetFunction());
20+
Nan::New<v8::FunctionTemplate>(PlusOne));
2121

2222
constructor.Reset(tpl->GetFunction());
2323
}

0 commit comments

Comments
 (0)