fix(wasm): allow passing in ERROR in descendantsOfType
This commit is contained in:
parent
95fd37ecf8
commit
cd6e766365
2 changed files with 22 additions and 0 deletions
|
|
@ -501,6 +501,11 @@ class Node {
|
|||
// Convert the type strings to numeric type symbols.
|
||||
const symbols = [];
|
||||
const typesBySymbol = this.tree.language.types;
|
||||
for (let i = 0; i < types.length; i++) {
|
||||
if (types[i] == "ERROR") {
|
||||
symbols.push(65535); // Internally, ts_builtin_sym_error is -1, which is UINT_16MAX
|
||||
}
|
||||
}
|
||||
for (let i = 0, n = typesBySymbol.length; i < n; i++) {
|
||||
if (types.includes(typesBySymbol[i])) {
|
||||
symbols.push(i);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue