Skip to content

Commit

Permalink
src: don't use deprecated v8::Template::Set()
Browse files Browse the repository at this point in the history
See [0] and [1]: starting with node.js v6, setting non-primitive values
on FunctionTemplate and ObjectTemplate instances is discouraged; v7 will
downright disallow it. Update the code base.

[0] nodejs/node#6216
[1] nodejs/node#6228
  • Loading branch information
evanlucas committed Apr 28, 2016
1 parent d293af0 commit 898fc90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/onig-scanner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ void OnigScanner::Init(Local<Object> target) {
Local<FunctionTemplate> tpl = Nan::New<FunctionTemplate>(OnigScanner::New);
tpl->SetClassName(Nan::New<String>("OnigScanner").ToLocalChecked());
tpl->InstanceTemplate()->SetInternalFieldCount(1);
tpl->PrototypeTemplate()->Set(Nan::New<String>("_findNextMatch").ToLocalChecked(), Nan::New<FunctionTemplate>(OnigScanner::FindNextMatch)->GetFunction());
tpl->PrototypeTemplate()->Set(Nan::New<String>("_findNextMatchSync").ToLocalChecked(), Nan::New<FunctionTemplate>(OnigScanner::FindNextMatchSync)->GetFunction());
tpl->PrototypeTemplate()->Set(Nan::New<String>("_findNextMatch").ToLocalChecked(), Nan::New<FunctionTemplate>(OnigScanner::FindNextMatch));
tpl->PrototypeTemplate()->Set(Nan::New<String>("_findNextMatchSync").ToLocalChecked(), Nan::New<FunctionTemplate>(OnigScanner::FindNextMatchSync));

target->Set(Nan::New<String>("OnigScanner").ToLocalChecked(), tpl->GetFunction());
}
Expand Down

0 comments on commit 898fc90

Please sign in to comment.