Skip to content

Commit

Permalink
Fix node binding
Browse files Browse the repository at this point in the history
  • Loading branch information
calebdw committed Nov 18, 2023
1 parent f383e72 commit 8de0912
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bindings/node/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ void Init(Local<Object> exports, Local<Object> module) {
Nan::SetInternalFieldPointer(php_only_instance, 0, tree_sitter_php_only());
Nan::Set(php_only_instance, Nan::New("name").ToLocalChecked(), Nan::New("php_only").ToLocalChecked());

Nan::Set(module, Nan::New("php").ToLocalChecked(), php_instance);
Nan::Set(module, Nan::New("php_only").ToLocalChecked(), php_only_instance);
Nan::Set(exports, Nan::New("php").ToLocalChecked(), php_instance);
Nan::Set(exports, Nan::New("php_only").ToLocalChecked(), php_only_instance);
}

NODE_MODULE(tree_sitter_php_binding, Init)
Expand Down
2 changes: 1 addition & 1 deletion bindings/node/php.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./index.js').php;
module.exports = require('./index').php;
2 changes: 1 addition & 1 deletion bindings/node/php_only.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('./index.js').php_only;
module.exports = require('./index').php_only;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"shelljs": "^0.8.4"
},
"scripts": {
"build": "npm run build-php && npm run build-php_only && node-gyp build",
"build": "npm run build-php && npm run build-php_only",
"build-php": "cd php && tree-sitter generate --no-bindings",
"build-php_only": "cd php_only && tree-sitter generate --no-bindings",
"test-load": "node -e \"console.log(require('./php').name, require('./php_only').name)\"",
Expand Down

0 comments on commit 8de0912

Please sign in to comment.