-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keep legit code working even when --screw-ie is not passed.
Previously: Without `--screw-ie`, UglifyJS would always leak names of function expressions into the containing scope, as if they were function declarations. That was to emulate IE<9 behavior. Code relying on this IE bug would continue to work properly after mangling, although it would only work in IE (since other engines don't share the bug). Sometimes this broke legitimage code (see #153 and #155). With `--screw-ie` the names would not be leaked into the current scope, working properly in legit cases; but still it broke legit code when running in IE<9 (see #24). Currently: Regardless of the `--screw-ie` setting, the names will not be leaked. Code relying on the IE bug will not work properly after mangling. <evil laughter here> Without `--screw-ie`: a hack has been added to the mangler to avoid using the same name for a function expression and some other variable in the same scope. This keeps legit code working, at the (negligible, indeed) cost of one more identifier. With `--screw-ie` you allow the mangler to name function expressions with the same identifier as another variable in scope. After mangling code might break in IE<9. Oh man, the commit message is longer than the patch. Fix #153, #155
- Loading branch information
Showing
3 changed files
with
17 additions
and
19 deletions.
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
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
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