{"action":"created","comment":{"url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/pulls/comments/137532491","pull_request_review_id":61212354,"id":137532491,"diff_hunk":"@@ -9,14 +9,33 @@ function findIdentifier (node) {\n   var parent = node.parent\n   while (parent) {\n     if (parent.type === 'VariableDeclarator') {\n-      return parent.id\n+      return {\n+        node: parent.id,\n+        name: parent.id.name\n+      }\n     } else if (parent.type === 'Property') {\n-      return parent.key\n+      if (parent.key.type === 'Identifier') {\n+        return {\n+          node: parent.key,\n+          name: parent.key.name\n+        }\n+      } else if (parent.key.type === 'Literal') {\n+        return {\n+          node: parent.key,\n+          name: parent.key.value\n+        }","path":"lib/rules/named-spy.js","position":20,"original_position":20,"commit_id":"9245b83ec2dccbe90d052a972e047ddefbd904ce","original_commit_id":"9245b83ec2dccbe90d052a972e047ddefbd904ce","user":{"login":"burabure","id":3132298,"avatar_url":"https://avatars0.githubusercontent.com/u/3132298?v=4","gravatar_id":"","url":"https://api.github.com/users/burabure","html_url":"https://github.com/burabure","followers_url":"https://api.github.com/users/burabure/followers","following_url":"https://api.github.com/users/burabure/following{/other_user}","gists_url":"https://api.github.com/users/burabure/gists{/gist_id}","starred_url":"https://api.github.com/users/burabure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/burabure/subscriptions","organizations_url":"https://api.github.com/users/burabure/orgs","repos_url":"https://api.github.com/users/burabure/repos","events_url":"https://api.github.com/users/burabure/events{/privacy}","received_events_url":"https://api.github.com/users/burabure/received_events","type":"User","site_admin":false},"body":"we'll need to add defaults to conditionals","created_at":"2017-09-07T13:06:30Z","updated_at":"2017-09-07T13:07:34Z","html_url":"https://github.com/tlvince/eslint-plugin-jasmine/pull/143#discussion_r137532491","pull_request_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/pulls/143","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/pulls/comments/137532491"},"html":{"href":"https://github.com/tlvince/eslint-plugin-jasmine/pull/143#discussion_r137532491"},"pull_request":{"href":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/pulls/143"}}},"pull_request":{"url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/pulls/143","id":139778529,"html_url":"https://github.com/tlvince/eslint-plugin-jasmine/pull/143","diff_url":"https://github.com/tlvince/eslint-plugin-jasmine/pull/143.diff","patch_url":"https://github.com/tlvince/eslint-plugin-jasmine/pull/143.patch","issue_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/issues/143","number":143,"state":"open","locked":false,"title":"fix(named-spy): support spies named after object's key with escaped c…","user":{"login":"iksemot","id":218702,"avatar_url":"https://avatars2.githubusercontent.com/u/218702?v=4","gravatar_id":"","url":"https://api.github.com/users/iksemot","html_url":"https://github.com/iksemot","followers_url":"https://api.github.com/users/iksemot/followers","following_url":"https://api.github.com/users/iksemot/following{/other_user}","gists_url":"https://api.github.com/users/iksemot/gists{/gist_id}","starred_url":"https://api.github.com/users/iksemot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iksemot/subscriptions","organizations_url":"https://api.github.com/users/iksemot/orgs","repos_url":"https://api.github.com/users/iksemot/repos","events_url":"https://api.github.com/users/iksemot/events{/privacy}","received_events_url":"https://api.github.com/users/iksemot/received_events","type":"User","site_admin":false},"body":"Following code is reported as with incorrect name by \"named-spy\" rule.\r\n\r\n```\r\nvar foo = {\r\n    \"bar:baz\": jasmine.createSpy(\"bar:baz\")\r\n}\r\n```\r\n\r\nIt happens because, within named-spy.js, property `name` is used to make the comparison, however when they key of the object is enclosed within quote then the node doesn't have property `name` but `value`.\r\n\r\nThis pull request fixes the issue by modifying function `findIdentifier` to return the correct name depending on the node type.","created_at":"2017-09-07T11:14:48Z","updated_at":"2017-09-07T13:07:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b9bf5fc8032b0be927b079bef4d1f3c8bed4b3c5","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/pulls/143/commits","review_comments_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/pulls/143/comments","review_comment_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/issues/143/comments","statuses_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/statuses/9245b83ec2dccbe90d052a972e047ddefbd904ce","head":{"label":"iksemot:named-spy-fix","ref":"named-spy-fix","sha":"9245b83ec2dccbe90d052a972e047ddefbd904ce","user":{"login":"iksemot","id":218702,"avatar_url":"https://avatars2.githubusercontent.com/u/218702?v=4","gravatar_id":"","url":"https://api.github.com/users/iksemot","html_url":"https://github.com/iksemot","followers_url":"https://api.github.com/users/iksemot/followers","following_url":"https://api.github.com/users/iksemot/following{/other_user}","gists_url":"https://api.github.com/users/iksemot/gists{/gist_id}","starred_url":"https://api.github.com/users/iksemot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iksemot/subscriptions","organizations_url":"https://api.github.com/users/iksemot/orgs","repos_url":"https://api.github.com/users/iksemot/repos","events_url":"https://api.github.com/users/iksemot/events{/privacy}","received_events_url":"https://api.github.com/users/iksemot/received_events","type":"User","site_admin":false},"repo":{"id":102718370,"name":"eslint-plugin-jasmine","full_name":"iksemot/eslint-plugin-jasmine","owner":{"login":"iksemot","id":218702,"avatar_url":"https://avatars2.githubusercontent.com/u/218702?v=4","gravatar_id":"","url":"https://api.github.com/users/iksemot","html_url":"https://github.com/iksemot","followers_url":"https://api.github.com/users/iksemot/followers","following_url":"https://api.github.com/users/iksemot/following{/other_user}","gists_url":"https://api.github.com/users/iksemot/gists{/gist_id}","starred_url":"https://api.github.com/users/iksemot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iksemot/subscriptions","organizations_url":"https://api.github.com/users/iksemot/orgs","repos_url":"https://api.github.com/users/iksemot/repos","events_url":"https://api.github.com/users/iksemot/events{/privacy}","received_events_url":"https://api.github.com/users/iksemot/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/iksemot/eslint-plugin-jasmine","description":"ESLint rules for Jasmine","fork":true,"url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine","forks_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/forks","keys_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/teams","hooks_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/hooks","issue_events_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/issues/events{/number}","events_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/events","assignees_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/assignees{/user}","branches_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/branches{/branch}","tags_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/tags","blobs_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/git/refs{/sha}","trees_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/statuses/{sha}","languages_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/languages","stargazers_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/stargazers","contributors_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/contributors","subscribers_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/subscribers","subscription_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/subscription","commits_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/commits{/sha}","git_commits_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/git/commits{/sha}","comments_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/comments{/number}","issue_comment_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/issues/comments{/number}","contents_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/contents/{+path}","compare_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/merges","archive_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/downloads","issues_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/issues{/number}","pulls_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/pulls{/number}","milestones_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/milestones{/number}","notifications_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/labels{/name}","releases_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/releases{/id}","deployments_url":"https://api.github.com/repos/iksemot/eslint-plugin-jasmine/deployments","created_at":"2017-09-07T09:27:43Z","updated_at":"2017-09-07T09:27:44Z","pushed_at":"2017-09-07T10:58:57Z","git_url":"git://github.com/iksemot/eslint-plugin-jasmine.git","ssh_url":"git@github.com:iksemot/eslint-plugin-jasmine.git","clone_url":"https://github.com/iksemot/eslint-plugin-jasmine.git","svn_url":"https://github.com/iksemot/eslint-plugin-jasmine","homepage":"https://www.npmjs.com/package/eslint-plugin-jasmine","size":156,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"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":"tlvince:master","ref":"master","sha":"ea41ce95d9e47fe81937e9ea7452a419d8d7875b","user":{"login":"tlvince","id":323761,"avatar_url":"https://avatars2.githubusercontent.com/u/323761?v=4","gravatar_id":"","url":"https://api.github.com/users/tlvince","html_url":"https://github.com/tlvince","followers_url":"https://api.github.com/users/tlvince/followers","following_url":"https://api.github.com/users/tlvince/following{/other_user}","gists_url":"https://api.github.com/users/tlvince/gists{/gist_id}","starred_url":"https://api.github.com/users/tlvince/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlvince/subscriptions","organizations_url":"https://api.github.com/users/tlvince/orgs","repos_url":"https://api.github.com/users/tlvince/repos","events_url":"https://api.github.com/users/tlvince/events{/privacy}","received_events_url":"https://api.github.com/users/tlvince/received_events","type":"User","site_admin":false},"repo":{"id":20961216,"name":"eslint-plugin-jasmine","full_name":"tlvince/eslint-plugin-jasmine","owner":{"login":"tlvince","id":323761,"avatar_url":"https://avatars2.githubusercontent.com/u/323761?v=4","gravatar_id":"","url":"https://api.github.com/users/tlvince","html_url":"https://github.com/tlvince","followers_url":"https://api.github.com/users/tlvince/followers","following_url":"https://api.github.com/users/tlvince/following{/other_user}","gists_url":"https://api.github.com/users/tlvince/gists{/gist_id}","starred_url":"https://api.github.com/users/tlvince/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tlvince/subscriptions","organizations_url":"https://api.github.com/users/tlvince/orgs","repos_url":"https://api.github.com/users/tlvince/repos","events_url":"https://api.github.com/users/tlvince/events{/privacy}","received_events_url":"https://api.github.com/users/tlvince/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tlvince/eslint-plugin-jasmine","description":"ESLint rules for Jasmine","fork":false,"url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine","forks_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/forks","keys_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/teams","hooks_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/hooks","issue_events_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/issues/events{/number}","events_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/events","assignees_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/assignees{/user}","branches_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/branches{/branch}","tags_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/tags","blobs_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/git/refs{/sha}","trees_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/statuses/{sha}","languages_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/languages","stargazers_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/stargazers","contributors_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/contributors","subscribers_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/subscribers","subscription_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/subscription","commits_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/commits{/sha}","git_commits_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/git/commits{/sha}","comments_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/comments{/number}","issue_comment_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/issues/comments{/number}","contents_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/contents/{+path}","compare_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/merges","archive_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/downloads","issues_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/issues{/number}","pulls_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/pulls{/number}","milestones_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/milestones{/number}","notifications_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/labels{/name}","releases_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/releases{/id}","deployments_url":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/deployments","created_at":"2014-06-18T12:29:00Z","updated_at":"2017-08-24T10:04:18Z","pushed_at":"2017-09-07T11:14:49Z","git_url":"git://github.com/tlvince/eslint-plugin-jasmine.git","ssh_url":"git@github.com:tlvince/eslint-plugin-jasmine.git","clone_url":"https://github.com/tlvince/eslint-plugin-jasmine.git","svn_url":"https://github.com/tlvince/eslint-plugin-jasmine","homepage":"https://www.npmjs.com/package/eslint-plugin-jasmine","size":155,"stargazers_count":41,"watchers_count":41,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":11,"forks":25,"open_issues":11,"watchers":41,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/pulls/143"},"html":{"href":"https://github.com/tlvince/eslint-plugin-jasmine/pull/143"},"issue":{"href":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/issues/143"},"comments":{"href":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/issues/143/comments"},"review_comments":{"href":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/pulls/143/comments"},"review_comment":{"href":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/pulls/143/commits"},"statuses":{"href":"https://api.github.com/repos/tlvince/eslint-plugin-jasmine/statuses/9245b83ec2dccbe90d052a972e047ddefbd904ce"}},"author_association":"NONE"}}
{"actor":{"display_login":"burabure"}}