The way Node stores string fragments alongside internal fields is problematic:
new Trie(['child']).optimize()
Uncaught TypeError: this.child is not a function
at Node.isTerminalString (node.js:51)
at Node.isTerminal (node.js:56)
at Trie.collapseChains (trie.js:207)
at Trie.optimize (trie.js:126)
at <anonymous>:1:26
"child" is a property holding a Node reference, not the child method from the prototype.
This could possibly be worked around by usage of Symbols to insure internal fields/method never conflict with string fragment properties.
The way Node stores string fragments alongside internal fields is problematic:
"child"
is a property holding aNode
reference, not thechild
method from the prototype.This could possibly be worked around by usage of
Symbol
s to insure internal fields/method never conflict with string fragment properties.