Skip to content

Commit

Permalink
package.json: expand to include electron 4.0.4 (#108)
Browse files Browse the repository at this point in the history
* package.json: expand to include electron 4.0.4

https://github.com/lgeiger/node-abi/blob/master/index.js#L71
rubyide/vscode-ruby#486

* Prebuild electron 4, 4.0.4, and 5

* ⬆️ tree-sitter-cli

Former-commit-id: 248c663f9aa63037eda72cdf9c74301fab2eb7b3 [formerly 5252a6b56960ab4b8d30ad7a883de48bcf118808]
Former-commit-id: d130faef48a9f9393cc07685ac87fdce8d058e29
  • Loading branch information
maletor authored and maxbrunsfeld committed Jul 11, 2019
1 parent 55a4ba5 commit 89e2916
Show file tree
Hide file tree
Showing 5 changed files with 237,403 additions and 230,261 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
},
"devDependencies": {
"prebuild": "^7.6.0",
"tree-sitter-cli": "^0.15.3",
"tree-sitter-cli": "^0.15.5",
"tree-sitter-highlight-schema": "^0.1.3"
},
"scripts": {
"install": "prebuild-install || node-gyp rebuild",
"prebuild": "prebuild -r electron -t 1.8.0 -t 2.0.0 -t 3.0.0 -t 4.0.0 --strip && prebuild -t 8.16.0 -t 10.12.0 --strip",
"prebuild": "prebuild -r electron -t 4.0.0 -t 4.0.4 -t 5.0.0 --strip && prebuild -t 8.16.0 -t 10.12.0 --strip",
"prebuild:upload": "prebuild --upload-all",
"test": "tree-sitter test && script/parse-examples",
"test-windows": "tree-sitter test"
Expand Down
8 changes: 4 additions & 4 deletions src/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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_ruby());

instance->Set(Nan::New("name").ToLocalChecked(), Nan::New("ruby").ToLocalChecked());
module->Set(Nan::New("exports").ToLocalChecked(), instance);
Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("ruby").ToLocalChecked());
Nan::Set(module, Nan::New("exports").ToLocalChecked(), instance);
}

NODE_MODULE(tree_sitter_ruby_binding, Init)
Expand Down
Loading

0 comments on commit 89e2916

Please sign in to comment.