Skip to content

Commit

Permalink
add missing overload for Nan::NewInstance that takes argc/argv
Browse files Browse the repository at this point in the history
  • Loading branch information
demmer authored and kkoopa committed Aug 6, 2015
1 parent e281d4e commit 29450ed
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/maybe_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ Signature:

```c++
Nan::MaybeLocal<v8::Object> Nan::NewInstance(v8::Local<v8::Function> h);
Nan::MaybeLocal<v8::Object> Nan::NewInstance(v8::Local<v8::Function> h, int argc, v8::Local<v8::Value> argv[]);
Nan::MaybeLocal<v8::Object> Nan::NewInstance(v8::Local<v8::ObjectTemplate> h);
```
Expand Down
9 changes: 9 additions & 0 deletions nan_maybe_43_inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ MaybeLocal<v8::Object> NewInstance(v8::Local<v8::Function> h) {
return MaybeLocal<v8::Object>(h->NewInstance(GetCurrentContext()));
}

NAN_INLINE
MaybeLocal<v8::Object> NewInstance(
v8::Local<v8::Function> h
, int argc
, v8::Local<v8::Value> argv[]) {
return MaybeLocal<v8::Object>(h->NewInstance(GetCurrentContext(),
argc, argv));
}

NAN_INLINE
MaybeLocal<v8::Object> NewInstance(v8::Local<v8::ObjectTemplate> h) {
return MaybeLocal<v8::Object>(h->NewInstance(GetCurrentContext()));
Expand Down
8 changes: 8 additions & 0 deletions nan_maybe_pre_43_inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ MaybeLocal<v8::Object> NewInstance(v8::Handle<v8::Function> h) {
return MaybeLocal<v8::Object>(h->NewInstance());
}

NAN_INLINE
MaybeLocal<v8::Object> NewInstance(
v8::Local<v8::Function> h
, int argc
, v8::Local<v8::Value> argv[]) {
return MaybeLocal<v8::Object>(h->NewInstance(argc, argv));
}

NAN_INLINE
MaybeLocal<v8::Object> NewInstance(v8::Handle<v8::ObjectTemplate> h) {
return MaybeLocal<v8::Object>(h->NewInstance());
Expand Down

0 comments on commit 29450ed

Please sign in to comment.