{"action":"created","issue":{"url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/690","labels_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/690/labels{/name}","comments_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/690/comments","events_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/690/events","html_url":"https://github.com/mishoo/UglifyJS2/issues/690","id":69370958,"number":690,"title":"OPTION: mangle-only-these-names","user":{"login":"timo22345","id":2405021,"avatar_url":"https://avatars.githubusercontent.com/u/2405021?v=3","gravatar_id":"","url":"https://api.github.com/users/timo22345","html_url":"https://github.com/timo22345","followers_url":"https://api.github.com/users/timo22345/followers","following_url":"https://api.github.com/users/timo22345/following{/other_user}","gists_url":"https://api.github.com/users/timo22345/gists{/gist_id}","starred_url":"https://api.github.com/users/timo22345/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timo22345/subscriptions","organizations_url":"https://api.github.com/users/timo22345/orgs","repos_url":"https://api.github.com/users/timo22345/repos","events_url":"https://api.github.com/users/timo22345/events{/privacy}","received_events_url":"https://api.github.com/users/timo22345/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-19T01:56:50Z","updated_at":"2015-11-20T18:03:20Z","closed_at":null,"body":"There is `--mangle-props` with `--reserved` and `--reserved-file`, which can exclude some names from mangling, but there is missing a `--mangle-props` with `--mangle-only-these-names` and `--mangle-only-these-names-file`.\r\n\r\nThe logic could be the same as in reserved and these should be exclusive (either --reserved or --mangle-only-these-names).\r\n\r\nThe reason for this is that --mangle-props is very likely to break the code as it mangles nearly everything except those named in --reserved or --reserved-file. In nearly all cases (I assume) it would be better to select what to mangle, because the developer KNOWS what is safe to mangle, but UglifyJS cannot KNOW this for sure, it can only make assumptions.\r\n\r\nCurrently I have no idea how to achieve this using current implementation."},"comment":{"url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/comments/158476954","html_url":"https://github.com/mishoo/UglifyJS2/issues/690#issuecomment-158476954","issue_url":"https://api.github.com/repos/mishoo/UglifyJS2/issues/690","id":158476954,"user":{"login":"milkisevil","id":309607,"avatar_url":"https://avatars.githubusercontent.com/u/309607?v=3","gravatar_id":"","url":"https://api.github.com/users/milkisevil","html_url":"https://github.com/milkisevil","followers_url":"https://api.github.com/users/milkisevil/followers","following_url":"https://api.github.com/users/milkisevil/following{/other_user}","gists_url":"https://api.github.com/users/milkisevil/gists{/gist_id}","starred_url":"https://api.github.com/users/milkisevil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milkisevil/subscriptions","organizations_url":"https://api.github.com/users/milkisevil/orgs","repos_url":"https://api.github.com/users/milkisevil/repos","events_url":"https://api.github.com/users/milkisevil/events{/privacy}","received_events_url":"https://api.github.com/users/milkisevil/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T18:03:20Z","updated_at":"2015-11-20T18:03:20Z","body":"@timo22345 if you want to literally declare all prop names (as would be done in the exclude list), I reckon you should be able just use a long regex:\r\n\r\n    uglifyjs --compress --mangle --mangle-props --mangle-regex=\"/myPropertyA|myPropertyB|myPropertyC|myPropertyD|myPropertyE|anotherProp|soManyProps/\"\r\n\r\nSure, it's a bit crazy, but you could have hundreds of properties in there. And if your build is scripted, you could read these props in from a JSON file:\r\n\r\n    new RegExp(myPropsArray.join('|'))"}}