{"action":"created","comment":{"url":"https://api.github.com/repos/hammerjs/hammer.js/pulls/comments/36598688","id":36598688,"diff_hunk":"@@ -203,10 +203,12 @@ Manager.prototype = {\n     off: function(events, handler) {\n         var handlers = this.handlers;\n         each(splitStr(events), function(event) {\n-            if (!handler) {\n-                delete handlers[event];\n-            } else {\n-                handlers[event].splice(inArray(handlers[event], handler), 1);\n+            if (typeof handlers[event] !== 'undefined') {","path":"src/manager.js","position":8,"original_position":8,"commit_id":"9253b6ddbcd7f719474a52ed1b467ff881f52609","original_commit_id":"9253b6ddbcd7f719474a52ed1b467ff881f52609","user":{"login":"arschmitz","id":462993,"avatar_url":"https://avatars.githubusercontent.com/u/462993?v=3","gravatar_id":"","url":"https://api.github.com/users/arschmitz","html_url":"https://github.com/arschmitz","followers_url":"https://api.github.com/users/arschmitz/followers","following_url":"https://api.github.com/users/arschmitz/following{/other_user}","gists_url":"https://api.github.com/users/arschmitz/gists{/gist_id}","starred_url":"https://api.github.com/users/arschmitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arschmitz/subscriptions","organizations_url":"https://api.github.com/users/arschmitz/orgs","repos_url":"https://api.github.com/users/arschmitz/repos","events_url":"https://api.github.com/users/arschmitz/events{/privacy}","received_events_url":"https://api.github.com/users/arschmitz/received_events","type":"User","site_admin":false},"body":"do we really need to check `typeof handlers[event] !== 'undefined'` here isn't it enough to just check `handlers[event]` ?","created_at":"2015-08-10T02:41:10Z","updated_at":"2015-08-10T02:41:10Z","html_url":"https://github.com/hammerjs/hammer.js/pull/839#discussion_r36598688","pull_request_url":"https://api.github.com/repos/hammerjs/hammer.js/pulls/839","_links":{"self":{"href":"https://api.github.com/repos/hammerjs/hammer.js/pulls/comments/36598688"},"html":{"href":"https://github.com/hammerjs/hammer.js/pull/839#discussion_r36598688"},"pull_request":{"href":"https://api.github.com/repos/hammerjs/hammer.js/pulls/839"}}},"pull_request":{"url":"https://api.github.com/repos/hammerjs/hammer.js/pulls/839","id":41983311,"html_url":"https://github.com/hammerjs/hammer.js/pull/839","diff_url":"https://github.com/hammerjs/hammer.js/pull/839.diff","patch_url":"https://github.com/hammerjs/hammer.js/pull/839.patch","issue_url":"https://api.github.com/repos/hammerjs/hammer.js/issues/839","number":839,"state":"open","locked":false,"title":"fix #768 issue (Manager.off method)","user":{"login":"sculove","id":1383952,"avatar_url":"https://avatars.githubusercontent.com/u/1383952?v=3","gravatar_id":"","url":"https://api.github.com/users/sculove","html_url":"https://github.com/sculove","followers_url":"https://api.github.com/users/sculove/followers","following_url":"https://api.github.com/users/sculove/following{/other_user}","gists_url":"https://api.github.com/users/sculove/gists{/gist_id}","starred_url":"https://api.github.com/users/sculove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sculove/subscriptions","organizations_url":"https://api.github.com/users/sculove/orgs","repos_url":"https://api.github.com/users/sculove/repos","events_url":"https://api.github.com/users/sculove/events{/privacy}","received_events_url":"https://api.github.com/users/sculove/received_events","type":"User","site_admin":false},"body":"I resend pr that seperate unrelated changes.\r\n\r\nWhen you didn't attach an event and you use a Hammerjs.Manager.off method , you will see script error.\r\nI think that hammerjs have to handle exception.\r\n\r\nI modified Hammerjs.Manager.off method.\r\nalso I added test case in test_events.js\r\n\r\n- Related issue #768 \r\n- Related pr #770 ","created_at":"2015-08-10T02:37:52Z","updated_at":"2015-08-10T02:41:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"090ec56f7c1b052b69bda0fedb269fd02caa1fc6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hammerjs/hammer.js/pulls/839/commits","review_comments_url":"https://api.github.com/repos/hammerjs/hammer.js/pulls/839/comments","review_comment_url":"https://api.github.com/repos/hammerjs/hammer.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hammerjs/hammer.js/issues/839/comments","statuses_url":"https://api.github.com/repos/hammerjs/hammer.js/statuses/9253b6ddbcd7f719474a52ed1b467ff881f52609","head":{"label":"naver:badlyInitializedObject","ref":"badlyInitializedObject","sha":"9253b6ddbcd7f719474a52ed1b467ff881f52609","user":{"login":"naver","id":6589568,"avatar_url":"https://avatars.githubusercontent.com/u/6589568?v=3","gravatar_id":"","url":"https://api.github.com/users/naver","html_url":"https://github.com/naver","followers_url":"https://api.github.com/users/naver/followers","following_url":"https://api.github.com/users/naver/following{/other_user}","gists_url":"https://api.github.com/users/naver/gists{/gist_id}","starred_url":"https://api.github.com/users/naver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naver/subscriptions","organizations_url":"https://api.github.com/users/naver/orgs","repos_url":"https://api.github.com/users/naver/repos","events_url":"https://api.github.com/users/naver/events{/privacy}","received_events_url":"https://api.github.com/users/naver/received_events","type":"Organization","site_admin":false},"repo":{"id":37453756,"name":"hammer.js","full_name":"naver/hammer.js","owner":{"login":"naver","id":6589568,"avatar_url":"https://avatars.githubusercontent.com/u/6589568?v=3","gravatar_id":"","url":"https://api.github.com/users/naver","html_url":"https://github.com/naver","followers_url":"https://api.github.com/users/naver/followers","following_url":"https://api.github.com/users/naver/following{/other_user}","gists_url":"https://api.github.com/users/naver/gists{/gist_id}","starred_url":"https://api.github.com/users/naver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naver/subscriptions","organizations_url":"https://api.github.com/users/naver/orgs","repos_url":"https://api.github.com/users/naver/repos","events_url":"https://api.github.com/users/naver/events{/privacy}","received_events_url":"https://api.github.com/users/naver/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/naver/hammer.js","description":"A javascript library for multi-touch gestures :// You can touch this","fork":true,"url":"https://api.github.com/repos/naver/hammer.js","forks_url":"https://api.github.com/repos/naver/hammer.js/forks","keys_url":"https://api.github.com/repos/naver/hammer.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/naver/hammer.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/naver/hammer.js/teams","hooks_url":"https://api.github.com/repos/naver/hammer.js/hooks","issue_events_url":"https://api.github.com/repos/naver/hammer.js/issues/events{/number}","events_url":"https://api.github.com/repos/naver/hammer.js/events","assignees_url":"https://api.github.com/repos/naver/hammer.js/assignees{/user}","branches_url":"https://api.github.com/repos/naver/hammer.js/branches{/branch}","tags_url":"https://api.github.com/repos/naver/hammer.js/tags","blobs_url":"https://api.github.com/repos/naver/hammer.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/naver/hammer.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/naver/hammer.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/naver/hammer.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/naver/hammer.js/statuses/{sha}","languages_url":"https://api.github.com/repos/naver/hammer.js/languages","stargazers_url":"https://api.github.com/repos/naver/hammer.js/stargazers","contributors_url":"https://api.github.com/repos/naver/hammer.js/contributors","subscribers_url":"https://api.github.com/repos/naver/hammer.js/subscribers","subscription_url":"https://api.github.com/repos/naver/hammer.js/subscription","commits_url":"https://api.github.com/repos/naver/hammer.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/naver/hammer.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/naver/hammer.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/naver/hammer.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/naver/hammer.js/contents/{+path}","compare_url":"https://api.github.com/repos/naver/hammer.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/naver/hammer.js/merges","archive_url":"https://api.github.com/repos/naver/hammer.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/naver/hammer.js/downloads","issues_url":"https://api.github.com/repos/naver/hammer.js/issues{/number}","pulls_url":"https://api.github.com/repos/naver/hammer.js/pulls{/number}","milestones_url":"https://api.github.com/repos/naver/hammer.js/milestones{/number}","notifications_url":"https://api.github.com/repos/naver/hammer.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/naver/hammer.js/labels{/name}","releases_url":"https://api.github.com/repos/naver/hammer.js/releases{/id}","created_at":"2015-06-15T08:47:26Z","updated_at":"2015-06-15T08:47:27Z","pushed_at":"2015-08-10T02:26:06Z","git_url":"git://github.com/naver/hammer.js.git","ssh_url":"git@github.com:naver/hammer.js.git","clone_url":"https://github.com/naver/hammer.js.git","svn_url":"https://github.com/naver/hammer.js","homepage":"http://hammerjs.github.io","size":9812,"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":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"hammerjs:master","ref":"master","sha":"f20533d2566868034f7f2446f96128c17cb3e506","user":{"login":"hammerjs","id":7997161,"avatar_url":"https://avatars.githubusercontent.com/u/7997161?v=3","gravatar_id":"","url":"https://api.github.com/users/hammerjs","html_url":"https://github.com/hammerjs","followers_url":"https://api.github.com/users/hammerjs/followers","following_url":"https://api.github.com/users/hammerjs/following{/other_user}","gists_url":"https://api.github.com/users/hammerjs/gists{/gist_id}","starred_url":"https://api.github.com/users/hammerjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hammerjs/subscriptions","organizations_url":"https://api.github.com/users/hammerjs/orgs","repos_url":"https://api.github.com/users/hammerjs/repos","events_url":"https://api.github.com/users/hammerjs/events{/privacy}","received_events_url":"https://api.github.com/users/hammerjs/received_events","type":"Organization","site_admin":false},"repo":{"id":3602123,"name":"hammer.js","full_name":"hammerjs/hammer.js","owner":{"login":"hammerjs","id":7997161,"avatar_url":"https://avatars.githubusercontent.com/u/7997161?v=3","gravatar_id":"","url":"https://api.github.com/users/hammerjs","html_url":"https://github.com/hammerjs","followers_url":"https://api.github.com/users/hammerjs/followers","following_url":"https://api.github.com/users/hammerjs/following{/other_user}","gists_url":"https://api.github.com/users/hammerjs/gists{/gist_id}","starred_url":"https://api.github.com/users/hammerjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hammerjs/subscriptions","organizations_url":"https://api.github.com/users/hammerjs/orgs","repos_url":"https://api.github.com/users/hammerjs/repos","events_url":"https://api.github.com/users/hammerjs/events{/privacy}","received_events_url":"https://api.github.com/users/hammerjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hammerjs/hammer.js","description":"A javascript library for multi-touch gestures :// You can touch this","fork":false,"url":"https://api.github.com/repos/hammerjs/hammer.js","forks_url":"https://api.github.com/repos/hammerjs/hammer.js/forks","keys_url":"https://api.github.com/repos/hammerjs/hammer.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hammerjs/hammer.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hammerjs/hammer.js/teams","hooks_url":"https://api.github.com/repos/hammerjs/hammer.js/hooks","issue_events_url":"https://api.github.com/repos/hammerjs/hammer.js/issues/events{/number}","events_url":"https://api.github.com/repos/hammerjs/hammer.js/events","assignees_url":"https://api.github.com/repos/hammerjs/hammer.js/assignees{/user}","branches_url":"https://api.github.com/repos/hammerjs/hammer.js/branches{/branch}","tags_url":"https://api.github.com/repos/hammerjs/hammer.js/tags","blobs_url":"https://api.github.com/repos/hammerjs/hammer.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hammerjs/hammer.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hammerjs/hammer.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/hammerjs/hammer.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hammerjs/hammer.js/statuses/{sha}","languages_url":"https://api.github.com/repos/hammerjs/hammer.js/languages","stargazers_url":"https://api.github.com/repos/hammerjs/hammer.js/stargazers","contributors_url":"https://api.github.com/repos/hammerjs/hammer.js/contributors","subscribers_url":"https://api.github.com/repos/hammerjs/hammer.js/subscribers","subscription_url":"https://api.github.com/repos/hammerjs/hammer.js/subscription","commits_url":"https://api.github.com/repos/hammerjs/hammer.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/hammerjs/hammer.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/hammerjs/hammer.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/hammerjs/hammer.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/hammerjs/hammer.js/contents/{+path}","compare_url":"https://api.github.com/repos/hammerjs/hammer.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hammerjs/hammer.js/merges","archive_url":"https://api.github.com/repos/hammerjs/hammer.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hammerjs/hammer.js/downloads","issues_url":"https://api.github.com/repos/hammerjs/hammer.js/issues{/number}","pulls_url":"https://api.github.com/repos/hammerjs/hammer.js/pulls{/number}","milestones_url":"https://api.github.com/repos/hammerjs/hammer.js/milestones{/number}","notifications_url":"https://api.github.com/repos/hammerjs/hammer.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hammerjs/hammer.js/labels{/name}","releases_url":"https://api.github.com/repos/hammerjs/hammer.js/releases{/id}","created_at":"2012-03-02T12:58:28Z","updated_at":"2015-08-09T23:12:01Z","pushed_at":"2015-08-10T02:37:52Z","git_url":"git://github.com/hammerjs/hammer.js.git","ssh_url":"git@github.com:hammerjs/hammer.js.git","clone_url":"https://github.com/hammerjs/hammer.js.git","svn_url":"https://github.com/hammerjs/hammer.js","homepage":"http://hammerjs.github.io","size":24709,"stargazers_count":11819,"watchers_count":11819,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1810,"mirror_url":null,"open_issues_count":76,"forks":1810,"open_issues":76,"watchers":11819,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hammerjs/hammer.js/pulls/839"},"html":{"href":"https://github.com/hammerjs/hammer.js/pull/839"},"issue":{"href":"https://api.github.com/repos/hammerjs/hammer.js/issues/839"},"comments":{"href":"https://api.github.com/repos/hammerjs/hammer.js/issues/839/comments"},"review_comments":{"href":"https://api.github.com/repos/hammerjs/hammer.js/pulls/839/comments"},"review_comment":{"href":"https://api.github.com/repos/hammerjs/hammer.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hammerjs/hammer.js/pulls/839/commits"},"statuses":{"href":"https://api.github.com/repos/hammerjs/hammer.js/statuses/9253b6ddbcd7f719474a52ed1b467ff881f52609"}}}}