{"action":"created","comment":{"url":"https://api.github.com/repos/google/closure-compiler/pulls/comments/65631848","id":65631848,"diff_hunk":"@@ -457,56 +457,73 @@ public void visit(NodeTraversal t, Node n, Node parent) {\n         }\n         case Token.CALL: {\n           Node target = n.getFirstChild();\n-          if (!target.isName()) {\n+          if (!target.isQualifiedName()) {\n             break;\n           }\n \n-          String renameFunctionName = target.getOriginalName();\n-          if (renameFunctionName == null) {\n-            renameFunctionName = target.getString();\n-          }\n-          if (renameFunctionName == null\n-              || !compiler.getCodingConvention().isPropertyRenameFunction(renameFunctionName)) {\n-            break;\n-          }\n+          String renameFunctionName = target.getOriginalQualifiedName();\n+          if (renameFunctionName != null\n+              && compiler.getCodingConvention().isPropertyRenameFunction(renameFunctionName)) {\n+\n+            if (n.getChildCount() != 2 && n.getChildCount() != 3) {\n+              compiler.report(\n+                  JSError.make(\n+                      n,\n+                      DisambiguateProperties.Warnings.INVALID_RENAME_FUNCTION,\n+                      renameFunctionName,\n+                      \" Must be called with 1 or 2 arguments.\"));\n+              break;\n+            }\n \n-          if (n.getChildCount() != 2 && n.getChildCount() != 3) {\n-            compiler.report(\n-                JSError.make(\n-                    n,\n-                    DisambiguateProperties.Warnings.INVALID_RENAME_FUNCTION,\n-                    renameFunctionName,\n-                    \" Must be called with 1 or 2 arguments.\"));\n-            break;\n-          }\n+            Node propName = n.getSecondChild();\n+            if (!propName.isString()) {\n+              compiler.report(\n+                  JSError.make(\n+                      n,\n+                      DisambiguateProperties.Warnings.INVALID_RENAME_FUNCTION,\n+                      renameFunctionName,\n+                      \" The first argument must be a string literal.\"));\n+              break;\n+            }\n \n-          Node propName = n.getSecondChild();\n-          if (!propName.isString()) {\n-            compiler.report(\n-                JSError.make(\n-                    n,\n-                    DisambiguateProperties.Warnings.INVALID_RENAME_FUNCTION,\n-                    renameFunctionName,\n-                    \" The first argument must be a string literal.\"));\n-            break;\n-          }\n+            if (propName.getString().contains(\".\")) {\n+              compiler.report(\n+                  JSError.make(\n+                      n,\n+                      DisambiguateProperties.Warnings.INVALID_RENAME_FUNCTION,\n+                      renameFunctionName,\n+                      \" The first argument must not be a property path.\"));\n+              break;\n+            }\n \n-          if (propName.getString().contains(\".\")) {\n-            compiler.report(\n-                JSError.make(\n-                    n,\n-                    DisambiguateProperties.Warnings.INVALID_RENAME_FUNCTION,\n-                    renameFunctionName,\n-                    \" The first argument must not be a property path.\"));\n-            break;\n-          }\n+            JSType jstype = getJSType(n.getSecondChild());\n+\n+            maybeMarkCandidate(propName, jstype);\n+          } else if (NodeUtil.isObjectDefinePropertiesDefinition(n)) {\n+            Node typeObj = n.getSecondChild();\n+            JSType jstype = getJSType(typeObj);\n+            Node objectLiteral = typeObj.getNext();\n \n-          JSType jstype = getJSType(n.getChildAtIndex(2));\n+            if (!objectLiteral.isObjectLit()) {\n+              break;\n+            }\n \n-          maybeMarkCandidate(propName, jstype);\n+            for (Node key : objectLiteral.children()) {\n+              if (key.isQuotedString()) {\n+                continue;","path":"src/com/google/javascript/jscomp/AmbiguateProperties.java","position":null,"original_position":96,"commit_id":"bc55c7da9d514273e59cd559de6cb9621b68827f","original_commit_id":"59c07546611fd436a1f5b46ef33279217e93631d","user":{"login":"ChadKillingsworth","id":1247639,"avatar_url":"https://avatars.githubusercontent.com/u/1247639?v=3","gravatar_id":"","url":"https://api.github.com/users/ChadKillingsworth","html_url":"https://github.com/ChadKillingsworth","followers_url":"https://api.github.com/users/ChadKillingsworth/followers","following_url":"https://api.github.com/users/ChadKillingsworth/following{/other_user}","gists_url":"https://api.github.com/users/ChadKillingsworth/gists{/gist_id}","starred_url":"https://api.github.com/users/ChadKillingsworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChadKillingsworth/subscriptions","organizations_url":"https://api.github.com/users/ChadKillingsworth/orgs","repos_url":"https://api.github.com/users/ChadKillingsworth/repos","events_url":"https://api.github.com/users/ChadKillingsworth/events{/privacy}","received_events_url":"https://api.github.com/users/ChadKillingsworth/received_events","type":"User","site_admin":false},"body":"We totally do. Nice catch. Fixed.","created_at":"2016-06-02T22:43:45Z","updated_at":"2016-06-02T22:43:45Z","html_url":"https://github.com/google/closure-compiler/pull/1823#discussion_r65631848","pull_request_url":"https://api.github.com/repos/google/closure-compiler/pulls/1823","_links":{"self":{"href":"https://api.github.com/repos/google/closure-compiler/pulls/comments/65631848"},"html":{"href":"https://github.com/google/closure-compiler/pull/1823#discussion_r65631848"},"pull_request":{"href":"https://api.github.com/repos/google/closure-compiler/pulls/1823"}}},"pull_request":{"url":"https://api.github.com/repos/google/closure-compiler/pulls/1823","id":71810750,"html_url":"https://github.com/google/closure-compiler/pull/1823","diff_url":"https://github.com/google/closure-compiler/pull/1823.diff","patch_url":"https://github.com/google/closure-compiler/pull/1823.patch","issue_url":"https://api.github.com/repos/google/closure-compiler/issues/1823","number":1823,"state":"open","locked":false,"title":"Add support for Object.defineProperties to type-based renaming passes","user":{"login":"ChadKillingsworth","id":1247639,"avatar_url":"https://avatars.githubusercontent.com/u/1247639?v=3","gravatar_id":"","url":"https://api.github.com/users/ChadKillingsworth","html_url":"https://github.com/ChadKillingsworth","followers_url":"https://api.github.com/users/ChadKillingsworth/followers","following_url":"https://api.github.com/users/ChadKillingsworth/following{/other_user}","gists_url":"https://api.github.com/users/ChadKillingsworth/gists{/gist_id}","starred_url":"https://api.github.com/users/ChadKillingsworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChadKillingsworth/subscriptions","organizations_url":"https://api.github.com/users/ChadKillingsworth/orgs","repos_url":"https://api.github.com/users/ChadKillingsworth/repos","events_url":"https://api.github.com/users/ChadKillingsworth/events{/privacy}","received_events_url":"https://api.github.com/users/ChadKillingsworth/received_events","type":"User","site_admin":false},"body":"Improves renaming opportunities for ES6 getters/setters who share names with extern properties.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"35\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/google/closure-compiler/1823)\n<!-- Reviewable:end -->\n","created_at":"2016-05-28T20:13:01Z","updated_at":"2016-06-02T22:43:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0570aef60ef96ff5c8b7840ffcee6bbaf413119b","assignee":{"login":"blickly","id":36416,"avatar_url":"https://avatars.githubusercontent.com/u/36416?v=3","gravatar_id":"","url":"https://api.github.com/users/blickly","html_url":"https://github.com/blickly","followers_url":"https://api.github.com/users/blickly/followers","following_url":"https://api.github.com/users/blickly/following{/other_user}","gists_url":"https://api.github.com/users/blickly/gists{/gist_id}","starred_url":"https://api.github.com/users/blickly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blickly/subscriptions","organizations_url":"https://api.github.com/users/blickly/orgs","repos_url":"https://api.github.com/users/blickly/repos","events_url":"https://api.github.com/users/blickly/events{/privacy}","received_events_url":"https://api.github.com/users/blickly/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/google/closure-compiler/pulls/1823/commits","review_comments_url":"https://api.github.com/repos/google/closure-compiler/pulls/1823/comments","review_comment_url":"https://api.github.com/repos/google/closure-compiler/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/closure-compiler/issues/1823/comments","statuses_url":"https://api.github.com/repos/google/closure-compiler/statuses/bc55c7da9d514273e59cd559de6cb9621b68827f","head":{"label":"ChadKillingsworth:define-properties-renaming","ref":"define-properties-renaming","sha":"bc55c7da9d514273e59cd559de6cb9621b68827f","user":{"login":"ChadKillingsworth","id":1247639,"avatar_url":"https://avatars.githubusercontent.com/u/1247639?v=3","gravatar_id":"","url":"https://api.github.com/users/ChadKillingsworth","html_url":"https://github.com/ChadKillingsworth","followers_url":"https://api.github.com/users/ChadKillingsworth/followers","following_url":"https://api.github.com/users/ChadKillingsworth/following{/other_user}","gists_url":"https://api.github.com/users/ChadKillingsworth/gists{/gist_id}","starred_url":"https://api.github.com/users/ChadKillingsworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChadKillingsworth/subscriptions","organizations_url":"https://api.github.com/users/ChadKillingsworth/orgs","repos_url":"https://api.github.com/users/ChadKillingsworth/repos","events_url":"https://api.github.com/users/ChadKillingsworth/events{/privacy}","received_events_url":"https://api.github.com/users/ChadKillingsworth/received_events","type":"User","site_admin":false},"repo":{"id":19463857,"name":"closure-compiler","full_name":"ChadKillingsworth/closure-compiler","owner":{"login":"ChadKillingsworth","id":1247639,"avatar_url":"https://avatars.githubusercontent.com/u/1247639?v=3","gravatar_id":"","url":"https://api.github.com/users/ChadKillingsworth","html_url":"https://github.com/ChadKillingsworth","followers_url":"https://api.github.com/users/ChadKillingsworth/followers","following_url":"https://api.github.com/users/ChadKillingsworth/following{/other_user}","gists_url":"https://api.github.com/users/ChadKillingsworth/gists{/gist_id}","starred_url":"https://api.github.com/users/ChadKillingsworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChadKillingsworth/subscriptions","organizations_url":"https://api.github.com/users/ChadKillingsworth/orgs","repos_url":"https://api.github.com/users/ChadKillingsworth/repos","events_url":"https://api.github.com/users/ChadKillingsworth/events{/privacy}","received_events_url":"https://api.github.com/users/ChadKillingsworth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ChadKillingsworth/closure-compiler","description":"A JavaScript checker and optimizer.","fork":true,"url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler","forks_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/forks","keys_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/teams","hooks_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/hooks","issue_events_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/issues/events{/number}","events_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/events","assignees_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/assignees{/user}","branches_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/branches{/branch}","tags_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/tags","blobs_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/git/refs{/sha}","trees_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/statuses/{sha}","languages_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/languages","stargazers_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/stargazers","contributors_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/contributors","subscribers_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/subscribers","subscription_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/subscription","commits_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/commits{/sha}","git_commits_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/git/commits{/sha}","comments_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/comments{/number}","issue_comment_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/issues/comments{/number}","contents_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/contents/{+path}","compare_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/merges","archive_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/downloads","issues_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/issues{/number}","pulls_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/pulls{/number}","milestones_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/milestones{/number}","notifications_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/labels{/name}","releases_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/releases{/id}","deployments_url":"https://api.github.com/repos/ChadKillingsworth/closure-compiler/deployments","created_at":"2014-05-05T17:09:47Z","updated_at":"2016-01-13T12:24:09Z","pushed_at":"2016-06-02T22:43:13Z","git_url":"git://github.com/ChadKillingsworth/closure-compiler.git","ssh_url":"git@github.com:ChadKillingsworth/closure-compiler.git","clone_url":"https://github.com/ChadKillingsworth/closure-compiler.git","svn_url":"https://github.com/ChadKillingsworth/closure-compiler","homepage":" https://developers.google.com/closure/compiler/","size":107232,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"ec922f496504e9ff65e96a07424202a1f288832e","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":18845024,"name":"closure-compiler","full_name":"google/closure-compiler","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/closure-compiler","description":"A JavaScript checker and optimizer.","fork":false,"url":"https://api.github.com/repos/google/closure-compiler","forks_url":"https://api.github.com/repos/google/closure-compiler/forks","keys_url":"https://api.github.com/repos/google/closure-compiler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/closure-compiler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/closure-compiler/teams","hooks_url":"https://api.github.com/repos/google/closure-compiler/hooks","issue_events_url":"https://api.github.com/repos/google/closure-compiler/issues/events{/number}","events_url":"https://api.github.com/repos/google/closure-compiler/events","assignees_url":"https://api.github.com/repos/google/closure-compiler/assignees{/user}","branches_url":"https://api.github.com/repos/google/closure-compiler/branches{/branch}","tags_url":"https://api.github.com/repos/google/closure-compiler/tags","blobs_url":"https://api.github.com/repos/google/closure-compiler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/closure-compiler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/closure-compiler/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/closure-compiler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/closure-compiler/statuses/{sha}","languages_url":"https://api.github.com/repos/google/closure-compiler/languages","stargazers_url":"https://api.github.com/repos/google/closure-compiler/stargazers","contributors_url":"https://api.github.com/repos/google/closure-compiler/contributors","subscribers_url":"https://api.github.com/repos/google/closure-compiler/subscribers","subscription_url":"https://api.github.com/repos/google/closure-compiler/subscription","commits_url":"https://api.github.com/repos/google/closure-compiler/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/closure-compiler/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/closure-compiler/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/closure-compiler/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/closure-compiler/contents/{+path}","compare_url":"https://api.github.com/repos/google/closure-compiler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/closure-compiler/merges","archive_url":"https://api.github.com/repos/google/closure-compiler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/closure-compiler/downloads","issues_url":"https://api.github.com/repos/google/closure-compiler/issues{/number}","pulls_url":"https://api.github.com/repos/google/closure-compiler/pulls{/number}","milestones_url":"https://api.github.com/repos/google/closure-compiler/milestones{/number}","notifications_url":"https://api.github.com/repos/google/closure-compiler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/closure-compiler/labels{/name}","releases_url":"https://api.github.com/repos/google/closure-compiler/releases{/id}","deployments_url":"https://api.github.com/repos/google/closure-compiler/deployments","created_at":"2014-04-16T15:30:36Z","updated_at":"2016-06-02T17:09:46Z","pushed_at":"2016-06-02T22:43:18Z","git_url":"git://github.com/google/closure-compiler.git","ssh_url":"git@github.com:google/closure-compiler.git","clone_url":"https://github.com/google/closure-compiler.git","svn_url":"https://github.com/google/closure-compiler","homepage":"https://developers.google.com/closure/compiler/","size":117190,"stargazers_count":2295,"watchers_count":2295,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":512,"mirror_url":null,"open_issues_count":474,"forks":512,"open_issues":474,"watchers":2295,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/closure-compiler/pulls/1823"},"html":{"href":"https://github.com/google/closure-compiler/pull/1823"},"issue":{"href":"https://api.github.com/repos/google/closure-compiler/issues/1823"},"comments":{"href":"https://api.github.com/repos/google/closure-compiler/issues/1823/comments"},"review_comments":{"href":"https://api.github.com/repos/google/closure-compiler/pulls/1823/comments"},"review_comment":{"href":"https://api.github.com/repos/google/closure-compiler/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/closure-compiler/pulls/1823/commits"},"statuses":{"href":"https://api.github.com/repos/google/closure-compiler/statuses/bc55c7da9d514273e59cd559de6cb9621b68827f"}}}}
{"actor":{"display_login":"ChadKillingsworth"}}