{"action":"created","issue":{"url":"https://api.github.com/repos/google/closure-compiler/issues/1087","labels_url":"https://api.github.com/repos/google/closure-compiler/issues/1087/labels{/name}","comments_url":"https://api.github.com/repos/google/closure-compiler/issues/1087/comments","events_url":"https://api.github.com/repos/google/closure-compiler/issues/1087/events","html_url":"https://github.com/google/closure-compiler/pull/1087","id":101686019,"number":1087,"title":"Better control over what gets renamed","user":{"login":"dchambers","id":283294,"avatar_url":"https://avatars.githubusercontent.com/u/283294?v=3","gravatar_id":"","url":"https://api.github.com/users/dchambers","html_url":"https://github.com/dchambers","followers_url":"https://api.github.com/users/dchambers/followers","following_url":"https://api.github.com/users/dchambers/following{/other_user}","gists_url":"https://api.github.com/users/dchambers/gists{/gist_id}","starred_url":"https://api.github.com/users/dchambers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchambers/subscriptions","organizations_url":"https://api.github.com/users/dchambers/orgs","repos_url":"https://api.github.com/users/dchambers/repos","events_url":"https://api.github.com/users/dchambers/events{/privacy}","received_events_url":"https://api.github.com/users/dchambers/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/google/closure-compiler/labels/cla:%20no","name":"cla: no","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-18T15:42:07Z","updated_at":"2015-08-18T16:17:45Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/google/closure-compiler/pulls/1087","html_url":"https://github.com/google/closure-compiler/pull/1087","diff_url":"https://github.com/google/closure-compiler/pull/1087.diff","patch_url":"https://github.com/google/closure-compiler/pull/1087.patch"},"body":"The heuristic used to determine whether member properties can be renamed is very liberal (it accepts any names containing symbols or non lower-case characters) which reduces the effectiveness of the `CodeConventions.isPrivate()` method for determining whether properties can be renamed. By providing a `PropertyRenamingPolicy.PRIVATE` flag, it becomes possible to let the `CodeConventions` instance better drive which properties get renamed or not.\r\n\r\nI've also taken the opportunity to update the documentation so it better represents what actually happens in code, and to make the code easier to follow.\r\n"},"comment":{"url":"https://api.github.com/repos/google/closure-compiler/issues/comments/132264236","html_url":"https://github.com/google/closure-compiler/pull/1087#issuecomment-132264236","issue_url":"https://api.github.com/repos/google/closure-compiler/issues/1087","id":132264236,"user":{"login":"dchambers","id":283294,"avatar_url":"https://avatars.githubusercontent.com/u/283294?v=3","gravatar_id":"","url":"https://api.github.com/users/dchambers","html_url":"https://github.com/dchambers","followers_url":"https://api.github.com/users/dchambers/followers","following_url":"https://api.github.com/users/dchambers/following{/other_user}","gists_url":"https://api.github.com/users/dchambers/gists{/gist_id}","starred_url":"https://api.github.com/users/dchambers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchambers/subscriptions","organizations_url":"https://api.github.com/users/dchambers/orgs","repos_url":"https://api.github.com/users/dchambers/repos","events_url":"https://api.github.com/users/dchambers/events{/privacy}","received_events_url":"https://api.github.com/users/dchambers/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T16:17:45Z","updated_at":"2015-08-18T16:17:45Z","body":"Hi @ChadKillingsworth, thanks for the quick response. I wasn't actually trying to use heuristic renaming, I just wanted to be able to provide a custom coding-convention that defined private members as being anything starting with `_` (e.g. `_privateMethod`).\r\n\r\nSince `CodingConvention.isPrivate()` is only used by `RenamePrototypes` (heuristic renaming), but not by `RenameProperties` (all-unquoted renaming), that's the route I went down. Unfortunately, I quickly found that the heuristic used to determine if things should be renamed breaks my coding convention, since it thinks `publicMethod` should be renamed since it has an upper-case letter!\r\n\r\nWe've been using Google Closure for years, but we've realized that we're never going to be able to make use of `ADVANCED_OPTIMIZATIONS` since some of the code that forms the app won't always be part of the main bundle. On the other hand, we've consistently adopted the norm of indicating private methods and variables using `_`.\r\n\r\nWhat if I submitted a pull-request that causes re-naming of private members to happen even under `SIMPLE_OPTIMIZATIONS`? This would have no effect for most users since only `GoogleCodingConvention` currently defines what private members look like (anything ending with an `_`).\r\n"}}