tree-sitter / tree-sitter-javascript

Javascript grammar for tree-sitter
MIT License
314 stars 108 forks source link

Misc bug fixes #288

Closed amaanq closed 3 months ago

amaanq commented 3 months ago
vird commented 3 months ago

Can I ask you release node-tree-sitter with up to date tree-sitter (0.20.9)?

String.prototype.isUpperCase = function() {

(\n is important, and number of characters in property names are important) works with tree-sitter-cli (ERROR is expected) But with tree-sitter 0.20.6 is not working

#!/usr/bin/env node
Parser = require("tree-sitter")
ts_js  = require("tree-sitter-javascript")
parser = new Parser().setLanguage(ts_js)
code = "String.prototype.isUpperCase = function() {\n"
parser.parse(code)

Causes Segmentation fault (core dumped)

N.b. I tried to fix it with newer tree-sitter but no luck with install from github:tree-sitter/tree-sitter https://github.com/hu2prod/node-tree-sitter/blob/master/package.json#L31

amaanq commented 3 months ago

I'll get to it when I can, catching up with a lot of tree-sitter stuff atm - so hopefully within a week or two