{"action":"created","comment":{"url":"https://api.github.com/repos/magnars/js2-refactor.el/pulls/comments/182402039","pull_request_review_id":113188509,"id":182402039,"diff_hunk":"@@ -298,12 +298,16 @@\n (defun js2r-extract-method (name)\n   \"Extract a method from the closest statement expression from the point.\"\n   (interactive \"sName of new method: \")\n-  (js2r--extract-fn\n-   name\n-   (lambda ()\n-       (goto-char (js2-node-abs-pos (js2r--closest #'js2-object-prop-node-p))))\n-   \"this.%s(%s);\"\n-   \"%s: function (%s) {\\n%s\\n},\\n\\n\"))\n+  (let ((cls (js2r--closest #'js2-class-node-p)))\n+    (js2r--extract-fn\n+     name\n+     (if cls (lambda ())","path":"js2r-functions.el","position":13,"original_position":13,"commit_id":"0d5e59ac44ee60345bfe0699e1cef54c78ec88ad","original_commit_id":"0d5e59ac44ee60345bfe0699e1cef54c78ec88ad","user":{"login":"NicolasPetton","id":123539,"avatar_url":"https://avatars0.githubusercontent.com/u/123539?v=4","gravatar_id":"","url":"https://api.github.com/users/NicolasPetton","html_url":"https://github.com/NicolasPetton","followers_url":"https://api.github.com/users/NicolasPetton/followers","following_url":"https://api.github.com/users/NicolasPetton/following{/other_user}","gists_url":"https://api.github.com/users/NicolasPetton/gists{/gist_id}","starred_url":"https://api.github.com/users/NicolasPetton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NicolasPetton/subscriptions","organizations_url":"https://api.github.com/users/NicolasPetton/orgs","repos_url":"https://api.github.com/users/NicolasPetton/repos","events_url":"https://api.github.com/users/NicolasPetton/events{/privacy}","received_events_url":"https://api.github.com/users/NicolasPetton/received_events","type":"User","site_admin":false},"body":"`js2r--extract-fn` could be improved to take `nil` as `goto-position` function, instead of using an empty lambda.\r\n\r\nThen your code could be simplified like this:\r\n\r\n```lisp\r\n(js2r--extract-fn\r\n  name\r\n  (when cls (goto-char ...))\r\n```","created_at":"2018-04-18T12:06:49Z","updated_at":"2018-04-18T12:07:12Z","html_url":"https://github.com/magnars/js2-refactor.el/pull/113#discussion_r182402039","pull_request_url":"https://api.github.com/repos/magnars/js2-refactor.el/pulls/113","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/magnars/js2-refactor.el/pulls/comments/182402039"},"html":{"href":"https://github.com/magnars/js2-refactor.el/pull/113#discussion_r182402039"},"pull_request":{"href":"https://api.github.com/repos/magnars/js2-refactor.el/pulls/113"}}},"pull_request":{"url":"https://api.github.com/repos/magnars/js2-refactor.el/pulls/113","id":182226831,"html_url":"https://github.com/magnars/js2-refactor.el/pull/113","diff_url":"https://github.com/magnars/js2-refactor.el/pull/113.diff","patch_url":"https://github.com/magnars/js2-refactor.el/pull/113.patch","issue_url":"https://api.github.com/repos/magnars/js2-refactor.el/issues/113","number":113,"state":"open","locked":false,"title":"Fix handling of extract-method when in an ES6 class","user":{"login":"felipeochoa","id":2739312,"avatar_url":"https://avatars1.githubusercontent.com/u/2739312?v=4","gravatar_id":"","url":"https://api.github.com/users/felipeochoa","html_url":"https://github.com/felipeochoa","followers_url":"https://api.github.com/users/felipeochoa/followers","following_url":"https://api.github.com/users/felipeochoa/following{/other_user}","gists_url":"https://api.github.com/users/felipeochoa/gists{/gist_id}","starred_url":"https://api.github.com/users/felipeochoa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felipeochoa/subscriptions","organizations_url":"https://api.github.com/users/felipeochoa/orgs","repos_url":"https://api.github.com/users/felipeochoa/repos","events_url":"https://api.github.com/users/felipeochoa/events{/privacy}","received_events_url":"https://api.github.com/users/felipeochoa/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-04-17T16:36:03Z","updated_at":"2018-04-18T12:07:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b29988d575e974aca24e6c82ec20d7dc0bb7f391","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/magnars/js2-refactor.el/pulls/113/commits","review_comments_url":"https://api.github.com/repos/magnars/js2-refactor.el/pulls/113/comments","review_comment_url":"https://api.github.com/repos/magnars/js2-refactor.el/pulls/comments{/number}","comments_url":"https://api.github.com/repos/magnars/js2-refactor.el/issues/113/comments","statuses_url":"https://api.github.com/repos/magnars/js2-refactor.el/statuses/0d5e59ac44ee60345bfe0699e1cef54c78ec88ad","head":{"label":"felipeochoa:extract-method-in-class","ref":"extract-method-in-class","sha":"0d5e59ac44ee60345bfe0699e1cef54c78ec88ad","user":{"login":"felipeochoa","id":2739312,"avatar_url":"https://avatars1.githubusercontent.com/u/2739312?v=4","gravatar_id":"","url":"https://api.github.com/users/felipeochoa","html_url":"https://github.com/felipeochoa","followers_url":"https://api.github.com/users/felipeochoa/followers","following_url":"https://api.github.com/users/felipeochoa/following{/other_user}","gists_url":"https://api.github.com/users/felipeochoa/gists{/gist_id}","starred_url":"https://api.github.com/users/felipeochoa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felipeochoa/subscriptions","organizations_url":"https://api.github.com/users/felipeochoa/orgs","repos_url":"https://api.github.com/users/felipeochoa/repos","events_url":"https://api.github.com/users/felipeochoa/events{/privacy}","received_events_url":"https://api.github.com/users/felipeochoa/received_events","type":"User","site_admin":false},"repo":{"id":100110464,"name":"js2-refactor.el","full_name":"felipeochoa/js2-refactor.el","owner":{"login":"felipeochoa","id":2739312,"avatar_url":"https://avatars1.githubusercontent.com/u/2739312?v=4","gravatar_id":"","url":"https://api.github.com/users/felipeochoa","html_url":"https://github.com/felipeochoa","followers_url":"https://api.github.com/users/felipeochoa/followers","following_url":"https://api.github.com/users/felipeochoa/following{/other_user}","gists_url":"https://api.github.com/users/felipeochoa/gists{/gist_id}","starred_url":"https://api.github.com/users/felipeochoa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felipeochoa/subscriptions","organizations_url":"https://api.github.com/users/felipeochoa/orgs","repos_url":"https://api.github.com/users/felipeochoa/repos","events_url":"https://api.github.com/users/felipeochoa/events{/privacy}","received_events_url":"https://api.github.com/users/felipeochoa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/felipeochoa/js2-refactor.el","description":"A JavaScript refactoring library for emacs","fork":true,"url":"https://api.github.com/repos/felipeochoa/js2-refactor.el","forks_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/forks","keys_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/keys{/key_id}","collaborators_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/teams","hooks_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/hooks","issue_events_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/issues/events{/number}","events_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/events","assignees_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/assignees{/user}","branches_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/branches{/branch}","tags_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/tags","blobs_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/git/refs{/sha}","trees_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/git/trees{/sha}","statuses_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/statuses/{sha}","languages_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/languages","stargazers_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/stargazers","contributors_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/contributors","subscribers_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/subscribers","subscription_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/subscription","commits_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/commits{/sha}","git_commits_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/git/commits{/sha}","comments_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/comments{/number}","issue_comment_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/issues/comments{/number}","contents_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/contents/{+path}","compare_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/compare/{base}...{head}","merges_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/merges","archive_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/downloads","issues_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/issues{/number}","pulls_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/pulls{/number}","milestones_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/milestones{/number}","notifications_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/labels{/name}","releases_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/releases{/id}","deployments_url":"https://api.github.com/repos/felipeochoa/js2-refactor.el/deployments","created_at":"2017-08-12T12:18:19Z","updated_at":"2018-04-17T16:27:57Z","pushed_at":"2018-04-17T16:35:18Z","git_url":"git://github.com/felipeochoa/js2-refactor.el.git","ssh_url":"git@github.com:felipeochoa/js2-refactor.el.git","clone_url":"https://github.com/felipeochoa/js2-refactor.el.git","svn_url":"https://github.com/felipeochoa/js2-refactor.el","homepage":"","size":636,"stargazers_count":0,"watchers_count":0,"language":"Emacs Lisp","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"magnars:master","ref":"master","sha":"391e06c80e9197581c9d0b04edb5a65ffc149dcf","user":{"login":"magnars","id":265785,"avatar_url":"https://avatars3.githubusercontent.com/u/265785?v=4","gravatar_id":"","url":"https://api.github.com/users/magnars","html_url":"https://github.com/magnars","followers_url":"https://api.github.com/users/magnars/followers","following_url":"https://api.github.com/users/magnars/following{/other_user}","gists_url":"https://api.github.com/users/magnars/gists{/gist_id}","starred_url":"https://api.github.com/users/magnars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magnars/subscriptions","organizations_url":"https://api.github.com/users/magnars/orgs","repos_url":"https://api.github.com/users/magnars/repos","events_url":"https://api.github.com/users/magnars/events{/privacy}","received_events_url":"https://api.github.com/users/magnars/received_events","type":"User","site_admin":false},"repo":{"id":3275686,"name":"js2-refactor.el","full_name":"magnars/js2-refactor.el","owner":{"login":"magnars","id":265785,"avatar_url":"https://avatars3.githubusercontent.com/u/265785?v=4","gravatar_id":"","url":"https://api.github.com/users/magnars","html_url":"https://github.com/magnars","followers_url":"https://api.github.com/users/magnars/followers","following_url":"https://api.github.com/users/magnars/following{/other_user}","gists_url":"https://api.github.com/users/magnars/gists{/gist_id}","starred_url":"https://api.github.com/users/magnars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/magnars/subscriptions","organizations_url":"https://api.github.com/users/magnars/orgs","repos_url":"https://api.github.com/users/magnars/repos","events_url":"https://api.github.com/users/magnars/events{/privacy}","received_events_url":"https://api.github.com/users/magnars/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/magnars/js2-refactor.el","description":"A JavaScript refactoring library for emacs","fork":false,"url":"https://api.github.com/repos/magnars/js2-refactor.el","forks_url":"https://api.github.com/repos/magnars/js2-refactor.el/forks","keys_url":"https://api.github.com/repos/magnars/js2-refactor.el/keys{/key_id}","collaborators_url":"https://api.github.com/repos/magnars/js2-refactor.el/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/magnars/js2-refactor.el/teams","hooks_url":"https://api.github.com/repos/magnars/js2-refactor.el/hooks","issue_events_url":"https://api.github.com/repos/magnars/js2-refactor.el/issues/events{/number}","events_url":"https://api.github.com/repos/magnars/js2-refactor.el/events","assignees_url":"https://api.github.com/repos/magnars/js2-refactor.el/assignees{/user}","branches_url":"https://api.github.com/repos/magnars/js2-refactor.el/branches{/branch}","tags_url":"https://api.github.com/repos/magnars/js2-refactor.el/tags","blobs_url":"https://api.github.com/repos/magnars/js2-refactor.el/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/magnars/js2-refactor.el/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/magnars/js2-refactor.el/git/refs{/sha}","trees_url":"https://api.github.com/repos/magnars/js2-refactor.el/git/trees{/sha}","statuses_url":"https://api.github.com/repos/magnars/js2-refactor.el/statuses/{sha}","languages_url":"https://api.github.com/repos/magnars/js2-refactor.el/languages","stargazers_url":"https://api.github.com/repos/magnars/js2-refactor.el/stargazers","contributors_url":"https://api.github.com/repos/magnars/js2-refactor.el/contributors","subscribers_url":"https://api.github.com/repos/magnars/js2-refactor.el/subscribers","subscription_url":"https://api.github.com/repos/magnars/js2-refactor.el/subscription","commits_url":"https://api.github.com/repos/magnars/js2-refactor.el/commits{/sha}","git_commits_url":"https://api.github.com/repos/magnars/js2-refactor.el/git/commits{/sha}","comments_url":"https://api.github.com/repos/magnars/js2-refactor.el/comments{/number}","issue_comment_url":"https://api.github.com/repos/magnars/js2-refactor.el/issues/comments{/number}","contents_url":"https://api.github.com/repos/magnars/js2-refactor.el/contents/{+path}","compare_url":"https://api.github.com/repos/magnars/js2-refactor.el/compare/{base}...{head}","merges_url":"https://api.github.com/repos/magnars/js2-refactor.el/merges","archive_url":"https://api.github.com/repos/magnars/js2-refactor.el/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/magnars/js2-refactor.el/downloads","issues_url":"https://api.github.com/repos/magnars/js2-refactor.el/issues{/number}","pulls_url":"https://api.github.com/repos/magnars/js2-refactor.el/pulls{/number}","milestones_url":"https://api.github.com/repos/magnars/js2-refactor.el/milestones{/number}","notifications_url":"https://api.github.com/repos/magnars/js2-refactor.el/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/magnars/js2-refactor.el/labels{/name}","releases_url":"https://api.github.com/repos/magnars/js2-refactor.el/releases{/id}","deployments_url":"https://api.github.com/repos/magnars/js2-refactor.el/deployments","created_at":"2012-01-26T17:26:05Z","updated_at":"2018-04-10T09:01:14Z","pushed_at":"2018-04-17T16:36:04Z","git_url":"git://github.com/magnars/js2-refactor.el.git","ssh_url":"git@github.com:magnars/js2-refactor.el.git","clone_url":"https://github.com/magnars/js2-refactor.el.git","svn_url":"https://github.com/magnars/js2-refactor.el","homepage":"","size":679,"stargazers_count":299,"watchers_count":299,"language":"Emacs Lisp","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":38,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":38,"open_issues":15,"watchers":299,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/magnars/js2-refactor.el/pulls/113"},"html":{"href":"https://github.com/magnars/js2-refactor.el/pull/113"},"issue":{"href":"https://api.github.com/repos/magnars/js2-refactor.el/issues/113"},"comments":{"href":"https://api.github.com/repos/magnars/js2-refactor.el/issues/113/comments"},"review_comments":{"href":"https://api.github.com/repos/magnars/js2-refactor.el/pulls/113/comments"},"review_comment":{"href":"https://api.github.com/repos/magnars/js2-refactor.el/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/magnars/js2-refactor.el/pulls/113/commits"},"statuses":{"href":"https://api.github.com/repos/magnars/js2-refactor.el/statuses/0d5e59ac44ee60345bfe0699e1cef54c78ec88ad"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"NicolasPetton"}}