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

Log statement causing trouble #13

Open
orslumen opened this issue Mar 21, 2011 · 0 comments
Open

Log statement causing trouble #13

orslumen opened this issue Mar 21, 2011 · 0 comments

Comments

@orslumen
Copy link

The method insertBefore in dom.js starts with the following debug statement:

log.debug('insert %s Before %s', newChild.nodeName, refChild.nodeName);

But results in a TypeError: Cannot read property 'nodeName' of null when the refChild (or newChild is undefined). This can be fixed as follows:

log.debug('insert %s Before %s', newChild && newChild.nodeName, refChild && refChild.nodeName);

See commit orslumen@c22faaf

But would it not be better (performance wise) to comment out all log statements, or to add something like if (Log.level <= debug) { log.debug(...) } to all debug statements?

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

1 participant