{"action":"created","comment":{"url":"https://api.github.com/repos/mohebifar/lebab/pulls/comments/78284866","id":78284866,"diff_hunk":"@@ -0,0 +1,147 @@\n+import {matchesAst, extract} from '../../../utils/matchesAst';\n+import {isVarWithRequireCalls} from '../../commonjs/importCommonjs';\n+\n+/**\n+ * Processes nodes to detect super classes and return information for later\n+ * transformation.\n+ *\n+ * Detects:\n+ *   var util = require('util');\n+ *   function Class1() {}\n+ *   function Class2() {}\n+ *   util.inherits(Class1, Class2);\n+ */\n+export default class UtilInherits {\n+  /**\n+   * @param {Object} cfg\n+   *   @param {PotentialClass[]} cfg.potentialClasses\n+   */\n+  constructor({potentialClasses}) {\n+    this.potentialClasses = potentialClasses;\n+    this.utilNode = null;\n+    this.inheritsNode = null;","path":"src/transform/class/inheritance/UtilInherits.js","position":null,"original_position":22,"commit_id":"9a20b9ed6570614541e5936588999576ed927531","original_commit_id":"13f1111615d79f9162769b6a83e0241f04a4f9f9","user":{"login":"apexearth","id":564815,"avatar_url":"https://avatars.githubusercontent.com/u/564815?v=3","gravatar_id":"","url":"https://api.github.com/users/apexearth","html_url":"https://github.com/apexearth","followers_url":"https://api.github.com/users/apexearth/followers","following_url":"https://api.github.com/users/apexearth/following{/other_user}","gists_url":"https://api.github.com/users/apexearth/gists{/gist_id}","starred_url":"https://api.github.com/users/apexearth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apexearth/subscriptions","organizations_url":"https://api.github.com/users/apexearth/orgs","repos_url":"https://api.github.com/users/apexearth/repos","events_url":"https://api.github.com/users/apexearth/events{/privacy}","received_events_url":"https://api.github.com/users/apexearth/received_events","type":"User","site_admin":false},"body":"9a20b9ed6570614541e5936588999576ed927531","created_at":"2016-09-10T22:27:58Z","updated_at":"2016-09-10T22:27:58Z","html_url":"https://github.com/mohebifar/lebab/pull/183#discussion_r78284866","pull_request_url":"https://api.github.com/repos/mohebifar/lebab/pulls/183","_links":{"self":{"href":"https://api.github.com/repos/mohebifar/lebab/pulls/comments/78284866"},"html":{"href":"https://github.com/mohebifar/lebab/pull/183#discussion_r78284866"},"pull_request":{"href":"https://api.github.com/repos/mohebifar/lebab/pulls/183"}}},"pull_request":{"url":"https://api.github.com/repos/mohebifar/lebab/pulls/183","id":84748385,"html_url":"https://github.com/mohebifar/lebab/pull/183","diff_url":"https://github.com/mohebifar/lebab/pull/183.diff","patch_url":"https://github.com/mohebifar/lebab/pull/183.patch","issue_url":"https://api.github.com/repos/mohebifar/lebab/issues/183","number":183,"state":"open","locked":false,"title":"Class Inheritance","user":{"login":"apexearth","id":564815,"avatar_url":"https://avatars.githubusercontent.com/u/564815?v=3","gravatar_id":"","url":"https://api.github.com/users/apexearth","html_url":"https://github.com/apexearth","followers_url":"https://api.github.com/users/apexearth/followers","following_url":"https://api.github.com/users/apexearth/following{/other_user}","gists_url":"https://api.github.com/users/apexearth/gists{/gist_id}","starred_url":"https://api.github.com/users/apexearth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apexearth/subscriptions","organizations_url":"https://api.github.com/users/apexearth/orgs","repos_url":"https://api.github.com/users/apexearth/repos","events_url":"https://api.github.com/users/apexearth/events{/privacy}","received_events_url":"https://api.github.com/users/apexearth/received_events","type":"User","site_admin":false},"body":"#### Related to issue #33 \r\n#### Detect super classes for some simple inheritance methods.\r\n\r\nI added this into the class transform. It seems better to have as an option that can be enabled but I am not sure how best to add it as an option.\r\n\r\n#### Reacts to the following inheritance methods:\r\n```\r\nfunction Class1() {}\r\nfunction Class2() {}\r\nClass1.prototype = Object.create(Class2.prototype);\r\nClass1.prototype.constructor = Class1;\r\n```\r\nand...\r\n```\r\nfunction Class1() {}\r\nfunction Class2() {}\r\nClass1.prototype = new Class2();\r\nClass1.prototype.constructor = Class1;\r\n```\r\nand...\r\n```\r\nvar util = require('util');\r\nfunction Class1() {}\r\nfunction Class2() {}\r\nutil.inherits(Class1, Class2);\r\n```\r\n\r\nSee **test/transform/classInheritance.js** for coverage.","created_at":"2016-09-10T07:56:46Z","updated_at":"2016-09-10T22:27:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a3a74e221ae73583d1286182761bb4522cbbd58","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mohebifar/lebab/pulls/183/commits","review_comments_url":"https://api.github.com/repos/mohebifar/lebab/pulls/183/comments","review_comment_url":"https://api.github.com/repos/mohebifar/lebab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mohebifar/lebab/issues/183/comments","statuses_url":"https://api.github.com/repos/mohebifar/lebab/statuses/9a20b9ed6570614541e5936588999576ed927531","head":{"label":"apexearth:class-inheritance","ref":"class-inheritance","sha":"9a20b9ed6570614541e5936588999576ed927531","user":{"login":"apexearth","id":564815,"avatar_url":"https://avatars.githubusercontent.com/u/564815?v=3","gravatar_id":"","url":"https://api.github.com/users/apexearth","html_url":"https://github.com/apexearth","followers_url":"https://api.github.com/users/apexearth/followers","following_url":"https://api.github.com/users/apexearth/following{/other_user}","gists_url":"https://api.github.com/users/apexearth/gists{/gist_id}","starred_url":"https://api.github.com/users/apexearth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apexearth/subscriptions","organizations_url":"https://api.github.com/users/apexearth/orgs","repos_url":"https://api.github.com/users/apexearth/repos","events_url":"https://api.github.com/users/apexearth/events{/privacy}","received_events_url":"https://api.github.com/users/apexearth/received_events","type":"User","site_admin":false},"repo":{"id":64907128,"name":"lebab","full_name":"apexearth/lebab","owner":{"login":"apexearth","id":564815,"avatar_url":"https://avatars.githubusercontent.com/u/564815?v=3","gravatar_id":"","url":"https://api.github.com/users/apexearth","html_url":"https://github.com/apexearth","followers_url":"https://api.github.com/users/apexearth/followers","following_url":"https://api.github.com/users/apexearth/following{/other_user}","gists_url":"https://api.github.com/users/apexearth/gists{/gist_id}","starred_url":"https://api.github.com/users/apexearth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apexearth/subscriptions","organizations_url":"https://api.github.com/users/apexearth/orgs","repos_url":"https://api.github.com/users/apexearth/repos","events_url":"https://api.github.com/users/apexearth/events{/privacy}","received_events_url":"https://api.github.com/users/apexearth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/apexearth/lebab","description":"Turn your ES5 code into readable ES6 (sugar-syntax). It does the opposite of what Babel does.","fork":true,"url":"https://api.github.com/repos/apexearth/lebab","forks_url":"https://api.github.com/repos/apexearth/lebab/forks","keys_url":"https://api.github.com/repos/apexearth/lebab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apexearth/lebab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apexearth/lebab/teams","hooks_url":"https://api.github.com/repos/apexearth/lebab/hooks","issue_events_url":"https://api.github.com/repos/apexearth/lebab/issues/events{/number}","events_url":"https://api.github.com/repos/apexearth/lebab/events","assignees_url":"https://api.github.com/repos/apexearth/lebab/assignees{/user}","branches_url":"https://api.github.com/repos/apexearth/lebab/branches{/branch}","tags_url":"https://api.github.com/repos/apexearth/lebab/tags","blobs_url":"https://api.github.com/repos/apexearth/lebab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apexearth/lebab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apexearth/lebab/git/refs{/sha}","trees_url":"https://api.github.com/repos/apexearth/lebab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apexearth/lebab/statuses/{sha}","languages_url":"https://api.github.com/repos/apexearth/lebab/languages","stargazers_url":"https://api.github.com/repos/apexearth/lebab/stargazers","contributors_url":"https://api.github.com/repos/apexearth/lebab/contributors","subscribers_url":"https://api.github.com/repos/apexearth/lebab/subscribers","subscription_url":"https://api.github.com/repos/apexearth/lebab/subscription","commits_url":"https://api.github.com/repos/apexearth/lebab/commits{/sha}","git_commits_url":"https://api.github.com/repos/apexearth/lebab/git/commits{/sha}","comments_url":"https://api.github.com/repos/apexearth/lebab/comments{/number}","issue_comment_url":"https://api.github.com/repos/apexearth/lebab/issues/comments{/number}","contents_url":"https://api.github.com/repos/apexearth/lebab/contents/{+path}","compare_url":"https://api.github.com/repos/apexearth/lebab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apexearth/lebab/merges","archive_url":"https://api.github.com/repos/apexearth/lebab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apexearth/lebab/downloads","issues_url":"https://api.github.com/repos/apexearth/lebab/issues{/number}","pulls_url":"https://api.github.com/repos/apexearth/lebab/pulls{/number}","milestones_url":"https://api.github.com/repos/apexearth/lebab/milestones{/number}","notifications_url":"https://api.github.com/repos/apexearth/lebab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apexearth/lebab/labels{/name}","releases_url":"https://api.github.com/repos/apexearth/lebab/releases{/id}","deployments_url":"https://api.github.com/repos/apexearth/lebab/deployments","created_at":"2016-08-04T06:05:46Z","updated_at":"2016-08-04T06:05:47Z","pushed_at":"2016-09-10T22:27:40Z","git_url":"git://github.com/apexearth/lebab.git","ssh_url":"git@github.com:apexearth/lebab.git","clone_url":"https://github.com/apexearth/lebab.git","svn_url":"https://github.com/apexearth/lebab","homepage":"https://lebab.io/","size":1831,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"mohebifar:master","ref":"master","sha":"512cb10527e13dab10fb7129bad66c1d7893a789","user":{"login":"mohebifar","id":6104558,"avatar_url":"https://avatars.githubusercontent.com/u/6104558?v=3","gravatar_id":"","url":"https://api.github.com/users/mohebifar","html_url":"https://github.com/mohebifar","followers_url":"https://api.github.com/users/mohebifar/followers","following_url":"https://api.github.com/users/mohebifar/following{/other_user}","gists_url":"https://api.github.com/users/mohebifar/gists{/gist_id}","starred_url":"https://api.github.com/users/mohebifar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mohebifar/subscriptions","organizations_url":"https://api.github.com/users/mohebifar/orgs","repos_url":"https://api.github.com/users/mohebifar/repos","events_url":"https://api.github.com/users/mohebifar/events{/privacy}","received_events_url":"https://api.github.com/users/mohebifar/received_events","type":"User","site_admin":false},"repo":{"id":30953633,"name":"lebab","full_name":"mohebifar/lebab","owner":{"login":"mohebifar","id":6104558,"avatar_url":"https://avatars.githubusercontent.com/u/6104558?v=3","gravatar_id":"","url":"https://api.github.com/users/mohebifar","html_url":"https://github.com/mohebifar","followers_url":"https://api.github.com/users/mohebifar/followers","following_url":"https://api.github.com/users/mohebifar/following{/other_user}","gists_url":"https://api.github.com/users/mohebifar/gists{/gist_id}","starred_url":"https://api.github.com/users/mohebifar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mohebifar/subscriptions","organizations_url":"https://api.github.com/users/mohebifar/orgs","repos_url":"https://api.github.com/users/mohebifar/repos","events_url":"https://api.github.com/users/mohebifar/events{/privacy}","received_events_url":"https://api.github.com/users/mohebifar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mohebifar/lebab","description":"Turn your ES5 code into readable ES6 (sugar-syntax). It does the opposite of what Babel does.","fork":false,"url":"https://api.github.com/repos/mohebifar/lebab","forks_url":"https://api.github.com/repos/mohebifar/lebab/forks","keys_url":"https://api.github.com/repos/mohebifar/lebab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mohebifar/lebab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mohebifar/lebab/teams","hooks_url":"https://api.github.com/repos/mohebifar/lebab/hooks","issue_events_url":"https://api.github.com/repos/mohebifar/lebab/issues/events{/number}","events_url":"https://api.github.com/repos/mohebifar/lebab/events","assignees_url":"https://api.github.com/repos/mohebifar/lebab/assignees{/user}","branches_url":"https://api.github.com/repos/mohebifar/lebab/branches{/branch}","tags_url":"https://api.github.com/repos/mohebifar/lebab/tags","blobs_url":"https://api.github.com/repos/mohebifar/lebab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mohebifar/lebab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mohebifar/lebab/git/refs{/sha}","trees_url":"https://api.github.com/repos/mohebifar/lebab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mohebifar/lebab/statuses/{sha}","languages_url":"https://api.github.com/repos/mohebifar/lebab/languages","stargazers_url":"https://api.github.com/repos/mohebifar/lebab/stargazers","contributors_url":"https://api.github.com/repos/mohebifar/lebab/contributors","subscribers_url":"https://api.github.com/repos/mohebifar/lebab/subscribers","subscription_url":"https://api.github.com/repos/mohebifar/lebab/subscription","commits_url":"https://api.github.com/repos/mohebifar/lebab/commits{/sha}","git_commits_url":"https://api.github.com/repos/mohebifar/lebab/git/commits{/sha}","comments_url":"https://api.github.com/repos/mohebifar/lebab/comments{/number}","issue_comment_url":"https://api.github.com/repos/mohebifar/lebab/issues/comments{/number}","contents_url":"https://api.github.com/repos/mohebifar/lebab/contents/{+path}","compare_url":"https://api.github.com/repos/mohebifar/lebab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mohebifar/lebab/merges","archive_url":"https://api.github.com/repos/mohebifar/lebab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mohebifar/lebab/downloads","issues_url":"https://api.github.com/repos/mohebifar/lebab/issues{/number}","pulls_url":"https://api.github.com/repos/mohebifar/lebab/pulls{/number}","milestones_url":"https://api.github.com/repos/mohebifar/lebab/milestones{/number}","notifications_url":"https://api.github.com/repos/mohebifar/lebab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mohebifar/lebab/labels{/name}","releases_url":"https://api.github.com/repos/mohebifar/lebab/releases{/id}","deployments_url":"https://api.github.com/repos/mohebifar/lebab/deployments","created_at":"2015-02-18T05:36:49Z","updated_at":"2016-09-10T19:15:32Z","pushed_at":"2016-09-10T22:27:41Z","git_url":"git://github.com/mohebifar/lebab.git","ssh_url":"git@github.com:mohebifar/lebab.git","clone_url":"https://github.com/mohebifar/lebab.git","svn_url":"https://github.com/mohebifar/lebab","homepage":"https://lebab.io/","size":1851,"stargazers_count":2355,"watchers_count":2355,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":75,"mirror_url":null,"open_issues_count":20,"forks":75,"open_issues":20,"watchers":2355,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mohebifar/lebab/pulls/183"},"html":{"href":"https://github.com/mohebifar/lebab/pull/183"},"issue":{"href":"https://api.github.com/repos/mohebifar/lebab/issues/183"},"comments":{"href":"https://api.github.com/repos/mohebifar/lebab/issues/183/comments"},"review_comments":{"href":"https://api.github.com/repos/mohebifar/lebab/pulls/183/comments"},"review_comment":{"href":"https://api.github.com/repos/mohebifar/lebab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mohebifar/lebab/pulls/183/commits"},"statuses":{"href":"https://api.github.com/repos/mohebifar/lebab/statuses/9a20b9ed6570614541e5936588999576ed927531"}}}}
{"actor":{"display_login":"apexearth"}}