Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
domenic opened this issue Aug 30, 2015 · 3 comments
Closed

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

domenic opened this issue Aug 30, 2015 · 3 comments

Comments

@domenic
Copy link
Member

domenic commented Aug 30, 2015

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
Copy link
Member

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
Copy link
Member

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

@domenic
Copy link
Member Author

domenic commented Aug 30, 2015

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

@domenic domenic closed this as completed Aug 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants