Permalink
4 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.
Browse files
CSS: Don't name the anonymous swap function
IE8 doesn't like named anonymous expressions. Not naming the function expression reduces the gzipped size by 5 bytes. In ECMAScript 2015 the function will get the name inferred from the variable name (here: swap) anyway. (cherry-picked from e847574) Refs 02a9d9f
- Loading branch information
This comment has been minimized.
In what way?
This comment has been minimized.
https://kangax.github.io/nfe/#jscript-bugs
This comment has been minimized.
Yeah i know about this, i was wondering about real implication on our code, i thought it like throws exceptions or something
This comment has been minimized.
@markelog It doesn't seem to leak for us, I'm not sure if it's because the variable name matches the function name or because we have more than one wrapping function because of the factory defined in
intro.jsbut either way it seems dangerous. Besides, we usually don't name anonymous functions in the jQuery codebase, I accidentally did what I often do in other projects. And since it saves size and in ES6 the built file will effectively have this function named...