fix(wasm): restore passing in ERROR to descendantsOfType (#4226)
This commit is contained in:
parent
b26b7f8d62
commit
3b67861def
2 changed files with 24 additions and 1 deletions
|
|
@ -416,6 +416,11 @@ export class Node {
|
|||
// Convert the type strings to numeric type symbols
|
||||
const symbols: number[] = [];
|
||||
const typesBySymbol = this.tree.language.types;
|
||||
for (const node_type of types) {
|
||||
if (node_type == "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