Add a method to tell if a node is part of the symbol tree
domenic opened this issue · 3 comments
domenic commented
I am running into some tricky initialization time issues in jsdom and need something like domSymbolTree.isInitialized(node), so I can bail out early if we're still in the pre-symbol-tree phase.
Joris-van-der-Wel commented
Are you sure that is needed? domSymbolTree.initialize() is optional, any method will implicitly initialize your node as needed (example).
This initialize function is intended to help the javascript engine optimize. v8 likes it if you always assign new properties in the same order.
Joris-van-der-Wel commented
initialize() is also needed for compatibility with Object.freeze()
domenic commented
Yeah, you're right; the problem was actually that I was passing undefined to domSymbolTree.hasChildren.