jsdom/js-symbol-tree

Add a method to tell if a node is part of the symbol tree

domenic opened this issue · 3 comments

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.

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.

initialize() is also needed for compatibility with Object.freeze()

Yeah, you're right; the problem was actually that I was passing undefined to domSymbolTree.hasChildren.