Permalink
8 comments
on commit
sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1feb92a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot to thank kangax for the recommendation!
1feb92a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, why not
?
1feb92a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, I forgot "@"
if ( window.attachEvent && /@cc_on 1 @/ ) {
1feb92a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NV
Or just —
if (/*@cc_on ! @*/0)
. I guess removal of conditional comments is to cater to Closure Compiler (which strips them).if (window.attachEvent && !window.addEventListener)
is a decent inference, but might fail when someone defines customaddEventListener
onwindow
(as, for example, MSDN demonstrates — http://msdn.microsoft.com/en-us/library/dd229916%28VS.85%29.aspx). The chance of someone following MSDN example is too big, as for my taste, so I'd rather go with something similar to what Garrett does in APE —var isMaybeLeak/*@cc_on=(@_jscript_version<5.7)@*/
(http://github.com/GarrettS/ape-javascript-library/blob/master/src/EventPublisher.js)1feb92a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kangax, you are right about
if (/*@cc_on ! @*/0)
. My code doesn't even work.isMaybeLeak/*@cc_on=(@_jscript_version<5.7)@*/
looks much bulletproof.1feb92a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Closure compiler strips out comments, so I think the goal was to eliminate conditional comments completely from jQuery so that it is easy to build the compressed version.
1feb92a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The just do not use the "closure compiler", I guess ?
Is Microsoft Ajax Minifier any good?
http://stephenwalther.com/blog/archive/2009/10/16/using-the-new-microsoft-ajax-minifier.aspx
1feb92a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MS tool also strips out conditional comments, it seems:
http://ajaxian.com/archives/microsoft-ajax-minifier-vs-yui-compressor