{"action":"created","issue":{"url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/179","repository_url":"https://api.github.com/repos/mishoo/UglifyJS2","labels_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/179/labels{/name}","comments_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/179/comments","events_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/179/events","html_url":"https://github.com/mishoo/UglifyJS2/issues/179","id":12673789,"number":179,"title":"Mangling named functions in strict mode can cause syntax errors in Safari","user":{"login":"markmevans","id":2829024,"avatar_url":"https://avatars.githubusercontent.com/u/2829024?v=3","gravatar_id":"","url":"https://api.github.com/users/markmevans","html_url":"https://github.com/markmevans","followers_url":"https://api.github.com/users/markmevans/followers","following_url":"https://api.github.com/users/markmevans/following{/other_user}","gists_url":"https://api.github.com/users/markmevans/gists{/gist_id}","starred_url":"https://api.github.com/users/markmevans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markmevans/subscriptions","organizations_url":"https://api.github.com/users/markmevans/orgs","repos_url":"https://api.github.com/users/markmevans/repos","events_url":"https://api.github.com/users/markmevans/events{/privacy}","received_events_url":"https://api.github.com/users/markmevans/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2013-04-01T19:53:42Z","updated_at":"2016-04-23T17:49:02Z","closed_at":"2013-04-02T08:18:45Z","body":"In strict mode, Safari 6.0.3 on OS X 10.8.3 raises an exception if a named function's name is the same as one of the function's argument names (at least in some scenarios).  For example:\r\n\r\n    $ cat <<EOF | ./bin/uglifyjs -  --mangle\r\n    > \"use strict\";\r\n    > \r\n    > function f1() {\r\n    >   return function f2(a,b,c) {\r\n    >   }\r\n    > }\r\n    > EOF\r\n\r\nresults in the following code:\r\n\r\n    \"use strict\";function f1(){return function n(n,t,u){}}\r\n\r\nSafari parses the original code without errors, but the generated code causes the following error:\r\n\r\n    SyntaxError: Cannot declare a parameter named 'n'  in strict mode\r\n\r\nManually converting the inner function to be anonymous or renaming to something not matching an argument's name resolves the problem.\r\n\r\nAlso, the generated code runs fine in Chrome and Firefox and Safari does not raise a syntax error for functions declared globally."},"comment":{"url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/comments/213796302","html_url":"https://github.com/mishoo/UglifyJS2/issues/179#issuecomment-213796302","issue_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/179","id":213796302,"user":{"login":"mgol","id":1758366,"avatar_url":"https://avatars.githubusercontent.com/u/1758366?v=3","gravatar_id":"","url":"https://api.github.com/users/mgol","html_url":"https://github.com/mgol","followers_url":"https://api.github.com/users/mgol/followers","following_url":"https://api.github.com/users/mgol/following{/other_user}","gists_url":"https://api.github.com/users/mgol/gists{/gist_id}","starred_url":"https://api.github.com/users/mgol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgol/subscriptions","organizations_url":"https://api.github.com/users/mgol/orgs","repos_url":"https://api.github.com/users/mgol/repos","events_url":"https://api.github.com/users/mgol/events{/privacy}","received_events_url":"https://api.github.com/users/mgol/received_events","type":"User","site_admin":false},"created_at":"2016-04-23T17:49:02Z","updated_at":"2016-04-23T17:49:02Z","body":"A related issue (#1052) has just broken jQuery minification in current (!) Firefox, Safari as well as IE 10."}}