Skip to content

require a newer version of uglify that fixes a bug with regexp #4902

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

Merged
merged 1 commit into from
May 20, 2017

Conversation

bdwain
Copy link
Contributor

@bdwain bdwain commented May 19, 2017

What kind of change does this PR introduce?
Just requiring a newer version of uglify js that includes a bugfix mishoo/UglifyJS#1964

Did you add tests for your changes?
No code changes were made.

Summary
There was a bug in earlier versions of uglify where the reduce_vars option (which is on by default) was causing some changes to the global RegExp prototype in certain scenarios (such as if babel-polyfill is included). This could break methods like string.split when using node 6 or chrome 51.

Does this PR introduce a breaking change?
No

@bdwain
Copy link
Contributor Author

bdwain commented May 19, 2017

cc @gaearon

@bdwain
Copy link
Contributor Author

bdwain commented May 19, 2017

trying to get the tests passing. i can't even run the master tests locally though. i get an Error: Cannot find module 'webpack/lib/removeAndDo'

@sokra
Copy link
Member

sokra commented May 19, 2017

see CONTRIBUTING.md.

yarn link
yarn link webpack

To update the test snapshots:

mocha -g "Stats"
node test/statsCases/accept-stats.js

Copy link
Member

@sokra sokra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update test snapshots

@webpack-bot
Copy link
Contributor

@bdwain Thanks for your update.

I labeled the Pull Request so reviewers will review it again.

@sokra Please review the new changes.

@bdwain
Copy link
Contributor Author

bdwain commented May 19, 2017

it's passing in travis but i still get an error locally.

  1. ConfigTestCases extract-text issue-14 should compile:
    Error: global leak detected: addresses

@@ -20,7 +20,7 @@ it("should pass mangle options", function() {
var fs = require("fs"),
path = require("path");
var source = fs.readFileSync(path.join(__dirname, "ie8.js"), "utf-8");
source.should.containEql("function r(n){return function(n){try{t()}catch(t){n(t)}}}");
source.should.containEql("function r(n){return function(t){try{n()}catch(n){t(n)}}}");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on second thought not sure i should have switched n and t. it looks like it might change the behavior of the resulting code. but i'm not sure why the output switched either.

@webpack-bot
Copy link
Contributor

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

@sokra sokra merged commit 6bd3a82 into webpack:master May 20, 2017
@sokra
Copy link
Member

sokra commented May 20, 2017

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants