parent
58a475fcdf
commit
97e13b8145
|
@ -16,7 +16,7 @@
|
|||
"devDependencies": {
|
||||
"nodemon": "^1.18.3",
|
||||
"prebuild": "^7.6.1",
|
||||
"tree-sitter-cli": "^0.14.5"
|
||||
"tree-sitter-cli": "^0.14.7"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tree-sitter generate && node-gyp build",
|
||||
|
|
|
@ -10,17 +10,17 @@ namespace {
|
|||
|
||||
NAN_METHOD(New) {}
|
||||
|
||||
void Init(Handle<Object> exports, Handle<Object> module) {
|
||||
void Init(Local<Object> exports, Local<Object> module) {
|
||||
Local<FunctionTemplate> tpl = Nan::New<FunctionTemplate>(New);
|
||||
tpl->SetClassName(Nan::New("Language").ToLocalChecked());
|
||||
tpl->InstanceTemplate()->SetInternalFieldCount(1);
|
||||
|
||||
Local<Function> constructor = tpl->GetFunction();
|
||||
Local<Function> constructor = Nan::GetFunction(tpl).ToLocalChecked();
|
||||
Local<Object> instance = constructor->NewInstance(Nan::GetCurrentContext()).ToLocalChecked();
|
||||
Nan::SetInternalFieldPointer(instance, 0, tree_sitter_bash());
|
||||
|
||||
instance->Set(Nan::New("name").ToLocalChecked(), Nan::New("bash").ToLocalChecked());
|
||||
module->Set(Nan::New("exports").ToLocalChecked(), instance);
|
||||
Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("bash").ToLocalChecked());
|
||||
Nan::Set(module, Nan::New("exports").ToLocalChecked(), instance);
|
||||
}
|
||||
|
||||
NODE_MODULE(tree_sitter_bash_binding, Init)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue