From 898fc9070fbf161cc9bfa03d055024654cfb2769 Mon Sep 17 00:00:00 2001 From: Evan Lucas Date: Thu, 28 Apr 2016 12:59:51 -0500 Subject: [PATCH] src: don't use deprecated v8::Template::Set() 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] https://github.com/nodejs/node/issues/6216 [1] https://github.com/nodejs/node/pull/6228 --- src/onig-scanner.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/onig-scanner.cc b/src/onig-scanner.cc index 3df65a5..5db6cc3 100644 --- a/src/onig-scanner.cc +++ b/src/onig-scanner.cc @@ -7,8 +7,8 @@ void OnigScanner::Init(Local target) { Local tpl = Nan::New(OnigScanner::New); tpl->SetClassName(Nan::New("OnigScanner").ToLocalChecked()); tpl->InstanceTemplate()->SetInternalFieldCount(1); - tpl->PrototypeTemplate()->Set(Nan::New("_findNextMatch").ToLocalChecked(), Nan::New(OnigScanner::FindNextMatch)->GetFunction()); - tpl->PrototypeTemplate()->Set(Nan::New("_findNextMatchSync").ToLocalChecked(), Nan::New(OnigScanner::FindNextMatchSync)->GetFunction()); + tpl->PrototypeTemplate()->Set(Nan::New("_findNextMatch").ToLocalChecked(), Nan::New(OnigScanner::FindNextMatch)); + tpl->PrototypeTemplate()->Set(Nan::New("_findNextMatchSync").ToLocalChecked(), Nan::New(OnigScanner::FindNextMatchSync)); target->Set(Nan::New("OnigScanner").ToLocalChecked(), tpl->GetFunction()); }