{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/25835685","id":25835685,"diff_hunk":"@@ -0,0 +1,121 @@\n+/**\n+ * EventEmitter implements basic event emitting logics. It also provides\n+ * function that augments the ability to other objects. For example:\n+ *  \n+ *   function Module() {\n+ *     this.EventEmitter.call(this, [eventName1, eventName2]);","path":"apps/settings/js/modules/base/event_emitter.js","position":6,"original_position":6,"commit_id":"f009c43da54c7d56f12205785ce49f2d7fe21c32","original_commit_id":"f009c43da54c7d56f12205785ce49f2d7fe21c32","user":{"login":"EragonJ","id":68322,"avatar_url":"https://avatars.githubusercontent.com/u/68322?v=3","gravatar_id":"","url":"https://api.github.com/users/EragonJ","html_url":"https://github.com/EragonJ","followers_url":"https://api.github.com/users/EragonJ/followers","following_url":"https://api.github.com/users/EragonJ/following{/other_user}","gists_url":"https://api.github.com/users/EragonJ/gists{/gist_id}","starred_url":"https://api.github.com/users/EragonJ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EragonJ/subscriptions","organizations_url":"https://api.github.com/users/EragonJ/orgs","repos_url":"https://api.github.com/users/EragonJ/repos","events_url":"https://api.github.com/users/EragonJ/events{/privacy}","received_events_url":"https://api.github.com/users/EragonJ/received_events","type":"User","site_admin":false},"body":"This line makes me confused. Why we have to predefined `eventName1` & `eventName2` before using ? Without this line, `this._eventListeners` will never be `{}` and would break other functionalities, so I can understand that you need this line to initialize it, but I think we should directly make `this._eventListeners = {}` when this `Object` is augmented.","created_at":"2015-03-05T02:40:21Z","updated_at":"2015-03-05T02:40:21Z","html_url":"https://github.com/mozilla-b2g/gaia/pull/28626#discussion_r25835685","pull_request_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/28626","_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments/25835685"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/28626#discussion_r25835685"},"pull_request":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/28626"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/28626","id":30454748,"html_url":"https://github.com/mozilla-b2g/gaia/pull/28626","diff_url":"https://github.com/mozilla-b2g/gaia/pull/28626.diff","patch_url":"https://github.com/mozilla-b2g/gaia/pull/28626.patch","issue_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/28626","number":28626,"state":"open","locked":false,"title":"Bug 1139336 - Implement EventEmitter","user":{"login":"crh0716","id":2899280,"avatar_url":"https://avatars.githubusercontent.com/u/2899280?v=3","gravatar_id":"","url":"https://api.github.com/users/crh0716","html_url":"https://github.com/crh0716","followers_url":"https://api.github.com/users/crh0716/followers","following_url":"https://api.github.com/users/crh0716/following{/other_user}","gists_url":"https://api.github.com/users/crh0716/gists{/gist_id}","starred_url":"https://api.github.com/users/crh0716/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crh0716/subscriptions","organizations_url":"https://api.github.com/users/crh0716/orgs","repos_url":"https://api.github.com/users/crh0716/repos","events_url":"https://api.github.com/users/crh0716/events{/privacy}","received_events_url":"https://api.github.com/users/crh0716/received_events","type":"User","site_admin":false},"body":"https://bugzilla.mozilla.org/show_bug.cgi?id=1139336","created_at":"2015-03-04T10:47:59Z","updated_at":"2015-03-05T02:40:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c62d255de1b4323bd6ec80e773a72ff2e2512ad5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/28626/commits","review_comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/28626/comments","review_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/28626/comments","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/f009c43da54c7d56f12205785ce49f2d7fe21c32","head":{"label":"crh0716:1139336","ref":"1139336","sha":"f009c43da54c7d56f12205785ce49f2d7fe21c32","user":{"login":"crh0716","id":2899280,"avatar_url":"https://avatars.githubusercontent.com/u/2899280?v=3","gravatar_id":"","url":"https://api.github.com/users/crh0716","html_url":"https://github.com/crh0716","followers_url":"https://api.github.com/users/crh0716/followers","following_url":"https://api.github.com/users/crh0716/following{/other_user}","gists_url":"https://api.github.com/users/crh0716/gists{/gist_id}","starred_url":"https://api.github.com/users/crh0716/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crh0716/subscriptions","organizations_url":"https://api.github.com/users/crh0716/orgs","repos_url":"https://api.github.com/users/crh0716/repos","events_url":"https://api.github.com/users/crh0716/events{/privacy}","received_events_url":"https://api.github.com/users/crh0716/received_events","type":"User","site_admin":false},"repo":{"id":7014877,"name":"gaia","full_name":"crh0716/gaia","owner":{"login":"crh0716","id":2899280,"avatar_url":"https://avatars.githubusercontent.com/u/2899280?v=3","gravatar_id":"","url":"https://api.github.com/users/crh0716","html_url":"https://github.com/crh0716","followers_url":"https://api.github.com/users/crh0716/followers","following_url":"https://api.github.com/users/crh0716/following{/other_user}","gists_url":"https://api.github.com/users/crh0716/gists{/gist_id}","starred_url":"https://api.github.com/users/crh0716/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crh0716/subscriptions","organizations_url":"https://api.github.com/users/crh0716/orgs","repos_url":"https://api.github.com/users/crh0716/repos","events_url":"https://api.github.com/users/crh0716/events{/privacy}","received_events_url":"https://api.github.com/users/crh0716/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/crh0716/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project","fork":true,"url":"https://api.github.com/repos/crh0716/gaia","forks_url":"https://api.github.com/repos/crh0716/gaia/forks","keys_url":"https://api.github.com/repos/crh0716/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crh0716/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crh0716/gaia/teams","hooks_url":"https://api.github.com/repos/crh0716/gaia/hooks","issue_events_url":"https://api.github.com/repos/crh0716/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/crh0716/gaia/events","assignees_url":"https://api.github.com/repos/crh0716/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/crh0716/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/crh0716/gaia/tags","blobs_url":"https://api.github.com/repos/crh0716/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crh0716/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crh0716/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/crh0716/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crh0716/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/crh0716/gaia/languages","stargazers_url":"https://api.github.com/repos/crh0716/gaia/stargazers","contributors_url":"https://api.github.com/repos/crh0716/gaia/contributors","subscribers_url":"https://api.github.com/repos/crh0716/gaia/subscribers","subscription_url":"https://api.github.com/repos/crh0716/gaia/subscription","commits_url":"https://api.github.com/repos/crh0716/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/crh0716/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/crh0716/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/crh0716/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/crh0716/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/crh0716/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crh0716/gaia/merges","archive_url":"https://api.github.com/repos/crh0716/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crh0716/gaia/downloads","issues_url":"https://api.github.com/repos/crh0716/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/crh0716/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/crh0716/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/crh0716/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crh0716/gaia/labels{/name}","releases_url":"https://api.github.com/repos/crh0716/gaia/releases{/id}","created_at":"2012-12-05T09:36:53Z","updated_at":"2014-06-25T09:34:00Z","pushed_at":"2015-03-04T10:57:14Z","git_url":"git://github.com/crh0716/gaia.git","ssh_url":"git@github.com:crh0716/gaia.git","clone_url":"https://github.com/crh0716/gaia.git","svn_url":"https://github.com/crh0716/gaia","homepage":"https://wiki.mozilla.org/B2G","size":902001,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":6,"forks":0,"open_issues":6,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla-b2g:master","ref":"master","sha":"0e5c608dc8dd1f8f9230825750e92c728ba28a98","user":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"repo":{"id":2317369,"name":"gaia","full_name":"mozilla-b2g/gaia","owner":{"login":"mozilla-b2g","id":1261292,"avatar_url":"https://avatars.githubusercontent.com/u/1261292?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla-b2g","html_url":"https://github.com/mozilla-b2g","followers_url":"https://api.github.com/users/mozilla-b2g/followers","following_url":"https://api.github.com/users/mozilla-b2g/following{/other_user}","gists_url":"https://api.github.com/users/mozilla-b2g/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla-b2g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla-b2g/subscriptions","organizations_url":"https://api.github.com/users/mozilla-b2g/orgs","repos_url":"https://api.github.com/users/mozilla-b2g/repos","events_url":"https://api.github.com/users/mozilla-b2g/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla-b2g/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla-b2g/gaia","description":"Gaia is a HTML5-based Phone UI for the Boot 2 Gecko Project. NOTE: For details of what branches are used for what releases, see","fork":false,"url":"https://api.github.com/repos/mozilla-b2g/gaia","forks_url":"https://api.github.com/repos/mozilla-b2g/gaia/forks","keys_url":"https://api.github.com/repos/mozilla-b2g/gaia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla-b2g/gaia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla-b2g/gaia/teams","hooks_url":"https://api.github.com/repos/mozilla-b2g/gaia/hooks","issue_events_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla-b2g/gaia/events","assignees_url":"https://api.github.com/repos/mozilla-b2g/gaia/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla-b2g/gaia/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/tags","blobs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla-b2g/gaia/languages","stargazers_url":"https://api.github.com/repos/mozilla-b2g/gaia/stargazers","contributors_url":"https://api.github.com/repos/mozilla-b2g/gaia/contributors","subscribers_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscribers","subscription_url":"https://api.github.com/repos/mozilla-b2g/gaia/subscription","commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla-b2g/gaia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla-b2g/gaia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla-b2g/gaia/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla-b2g/gaia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla-b2g/gaia/merges","archive_url":"https://api.github.com/repos/mozilla-b2g/gaia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla-b2g/gaia/downloads","issues_url":"https://api.github.com/repos/mozilla-b2g/gaia/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla-b2g/gaia/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla-b2g/gaia/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla-b2g/gaia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla-b2g/gaia/labels{/name}","releases_url":"https://api.github.com/repos/mozilla-b2g/gaia/releases{/id}","created_at":"2011-09-03T01:38:46Z","updated_at":"2015-03-05T00:47:21Z","pushed_at":"2015-03-05T00:47:20Z","git_url":"git://github.com/mozilla-b2g/gaia.git","ssh_url":"git@github.com:mozilla-b2g/gaia.git","clone_url":"https://github.com/mozilla-b2g/gaia.git","svn_url":"https://github.com/mozilla-b2g/gaia","homepage":"https://wiki.mozilla.org/B2G","size":1446201,"stargazers_count":1880,"watchers_count":1880,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2238,"mirror_url":null,"open_issues_count":899,"forks":2238,"open_issues":899,"watchers":1880,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/28626"},"html":{"href":"https://github.com/mozilla-b2g/gaia/pull/28626"},"issue":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/28626"},"comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/issues/28626/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/28626/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/pulls/28626/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla-b2g/gaia/statuses/f009c43da54c7d56f12205785ce49f2d7fe21c32"}}}}