Skip to content

Commit

Permalink
Fix failure to marshal the last language field name
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbrunsfeld committed Jun 21, 2019
1 parent b22ade8 commit 4b0bebc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"main": "index.js",
"types": "tree-sitter.d.ts",
"dependencies": {
"nan": "^2.13.2",
"nan": "^2.14.0",
"prebuild-install": "^5.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/language.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static void GetNodeFieldNamesById(const Nan::FunctionCallbackInfo<Value> &info)

auto result = Nan::New<Array>();
uint32_t length = ts_language_field_count(language);
for (uint32_t i = 0; i < length; i++) {
for (uint32_t i = 0; i < length + 1; i++) {
const char *name = ts_language_field_name_for_id(language, i);
if (name) {
result->Set(i, Nan::New(name).ToLocalChecked());
Expand Down

0 comments on commit 4b0bebc

Please # to comment.