diff --git a/lib/core/tree.js b/lib/core/tree.js index 17dfca4cc4e..84293816721 100644 --- a/lib/core/tree.js +++ b/lib/core/tree.js @@ -47,6 +47,9 @@ class TstNode { throw new TypeError('Unreachable') } let index = 0 + /** + * @type {TstNode} + */ let node = this while (true) { const code = key.charCodeAt(index) @@ -87,6 +90,9 @@ class TstNode { search (key) { const keylength = key.length let index = 0 + /** + * @type {TstNode} + */ let node = this while (node !== null && index < keylength) { let code = key[index]