{"action":"created","comment":{"url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/pulls/comments/64844474","id":64844474,"diff_hunk":"@@ -0,0 +1,82 @@\n+/**\n+ * This utility class defines custom onerror and onunhandledrejection functions\n+ * The custom error handlers are respecting the previous defined error handlers\n+ * GlobalOnErrorHandler class provides utilities to add many custom error\n+ * handlers and to execute the error handlers directly.\n+ */\n+\n+\n+/**\n+ * List with global error handlers that will be executed.\n+ */\n+var handlers = [];\n+\n+// if an old handler exists also fire its events\n+var oldOnErrorHandler = window.onerror;\n+\n+/**\n+ * Custom error handler that calls the old global error handler and executes\n+ * all handlers that were previously added.\n+ */\n+function JitsiGlobalErrorHandler(message, source, lineno, colno, error) {\n+    handlers.forEach(function (handler) {\n+        handler(message, source, lineno, colno, error);\n+    });\n+    if (oldOnErrorHandler)\n+        oldOnErrorHandler(message, source, lineno, colno, error);\n+}\n+\n+// if an old handler exists also fire its events\n+var oldOnUnhandledRejection = window.onunhandledrejection;\n+\n+/**\n+ * Custom handler that calls the old global handler and executes\n+ * all handlers that were previously added. This handler handles rejected\n+ * Promises.\n+ */\n+function JitsiGlobalUnhandlerRejection(event) {\n+    handlers.forEach(function (handler) {\n+        handler(null, null, null, null, event.reason);\n+    });\n+    if(oldOnUnhandledRejection)\n+        oldOnUnhandledRejection(event);\n+}\n+\n+//Setting the custom error handlers.\n+window.onerror = JitsiGlobalErrorHandler;\n+window.onunhandledrejection = JitsiGlobalUnhandlerRejection;\n+\n+\n+var GlobalOnErrorHandler = {\n+    /**\n+     * Adds new error handlers.\n+     * @param handler the new handler.\n+     */\n+    addHandler: function (handler) {\n+        handlers.push(handler);\n+    },\n+    /**\n+     * Calls the global error handler if there is one.\n+     * @param error the error that is going to be passed to the error handler\n+     */\n+    callErrorHandler: function (error) {\n+        var errHandler = window.onerror;\n+        if(!errHandler)\n+            return;\n+        errHandler.call(null, null, null, null, null, error);","path":"modules/util/GlobalOnErrorHandler.js","position":66,"original_position":66,"commit_id":"2c2f3e6c9a876a9dc27978da30206933944e3033","original_commit_id":"98b60b5d718c8ad397acd7ad86bf0f8cf858c650","user":{"login":"lyubomir","id":3251887,"avatar_url":"https://avatars.githubusercontent.com/u/3251887?v=3","gravatar_id":"","url":"https://api.github.com/users/lyubomir","html_url":"https://github.com/lyubomir","followers_url":"https://api.github.com/users/lyubomir/followers","following_url":"https://api.github.com/users/lyubomir/following{/other_user}","gists_url":"https://api.github.com/users/lyubomir/gists{/gist_id}","starred_url":"https://api.github.com/users/lyubomir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lyubomir/subscriptions","organizations_url":"https://api.github.com/users/lyubomir/orgs","repos_url":"https://api.github.com/users/lyubomir/repos","events_url":"https://api.github.com/users/lyubomir/events{/privacy}","received_events_url":"https://api.github.com/users/lyubomir/received_events","type":"User","site_admin":false},"body":"OK, that's:\r\nerrorHandler = window.onerror; errHandler.onerror.call(null, ...)\r\nand above there ways\r\noldOnErrorHandler = window.onerror; oldOnErrorHandler(...).\r\n\r\nGiven that you're providing null as the first argument of Function.prototype.call(), is there are reason for the inconsistency in style?","created_at":"2016-05-27T00:56:04Z","updated_at":"2016-05-27T00:56:04Z","html_url":"https://github.com/jitsi/lib-jitsi-meet/pull/106#discussion_r64844474","pull_request_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/pulls/106","_links":{"self":{"href":"https://api.github.com/repos/jitsi/lib-jitsi-meet/pulls/comments/64844474"},"html":{"href":"https://github.com/jitsi/lib-jitsi-meet/pull/106#discussion_r64844474"},"pull_request":{"href":"https://api.github.com/repos/jitsi/lib-jitsi-meet/pulls/106"}}},"pull_request":{"url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/pulls/106","id":70778951,"html_url":"https://github.com/jitsi/lib-jitsi-meet/pull/106","diff_url":"https://github.com/jitsi/lib-jitsi-meet/pull/106.diff","patch_url":"https://github.com/jitsi/lib-jitsi-meet/pull/106.patch","issue_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/issues/106","number":106,"state":"open","locked":false,"title":"Solves the issue with not reported JS errors","user":{"login":"hristoterezov","id":1729265,"avatar_url":"https://avatars.githubusercontent.com/u/1729265?v=3","gravatar_id":"","url":"https://api.github.com/users/hristoterezov","html_url":"https://github.com/hristoterezov","followers_url":"https://api.github.com/users/hristoterezov/followers","following_url":"https://api.github.com/users/hristoterezov/following{/other_user}","gists_url":"https://api.github.com/users/hristoterezov/gists{/gist_id}","starred_url":"https://api.github.com/users/hristoterezov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hristoterezov/subscriptions","organizations_url":"https://api.github.com/users/hristoterezov/orgs","repos_url":"https://api.github.com/users/hristoterezov/repos","events_url":"https://api.github.com/users/hristoterezov/events{/privacy}","received_events_url":"https://api.github.com/users/hristoterezov/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-19T22:58:35Z","updated_at":"2016-05-27T00:56:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e326e90f3462985c8e385adeae5eeb7f60e9c6e5","assignee":{"login":"lyubomir","id":3251887,"avatar_url":"https://avatars.githubusercontent.com/u/3251887?v=3","gravatar_id":"","url":"https://api.github.com/users/lyubomir","html_url":"https://github.com/lyubomir","followers_url":"https://api.github.com/users/lyubomir/followers","following_url":"https://api.github.com/users/lyubomir/following{/other_user}","gists_url":"https://api.github.com/users/lyubomir/gists{/gist_id}","starred_url":"https://api.github.com/users/lyubomir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lyubomir/subscriptions","organizations_url":"https://api.github.com/users/lyubomir/orgs","repos_url":"https://api.github.com/users/lyubomir/repos","events_url":"https://api.github.com/users/lyubomir/events{/privacy}","received_events_url":"https://api.github.com/users/lyubomir/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/pulls/106/commits","review_comments_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/pulls/106/comments","review_comment_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/issues/106/comments","statuses_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/statuses/2c2f3e6c9a876a9dc27978da30206933944e3033","head":{"label":"jitsi:js_errors","ref":"js_errors","sha":"2c2f3e6c9a876a9dc27978da30206933944e3033","user":{"login":"jitsi","id":3671647,"avatar_url":"https://avatars.githubusercontent.com/u/3671647?v=3","gravatar_id":"","url":"https://api.github.com/users/jitsi","html_url":"https://github.com/jitsi","followers_url":"https://api.github.com/users/jitsi/followers","following_url":"https://api.github.com/users/jitsi/following{/other_user}","gists_url":"https://api.github.com/users/jitsi/gists{/gist_id}","starred_url":"https://api.github.com/users/jitsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jitsi/subscriptions","organizations_url":"https://api.github.com/users/jitsi/orgs","repos_url":"https://api.github.com/users/jitsi/repos","events_url":"https://api.github.com/users/jitsi/events{/privacy}","received_events_url":"https://api.github.com/users/jitsi/received_events","type":"Organization","site_admin":false},"repo":{"id":50543360,"name":"lib-jitsi-meet","full_name":"jitsi/lib-jitsi-meet","owner":{"login":"jitsi","id":3671647,"avatar_url":"https://avatars.githubusercontent.com/u/3671647?v=3","gravatar_id":"","url":"https://api.github.com/users/jitsi","html_url":"https://github.com/jitsi","followers_url":"https://api.github.com/users/jitsi/followers","following_url":"https://api.github.com/users/jitsi/following{/other_user}","gists_url":"https://api.github.com/users/jitsi/gists{/gist_id}","starred_url":"https://api.github.com/users/jitsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jitsi/subscriptions","organizations_url":"https://api.github.com/users/jitsi/orgs","repos_url":"https://api.github.com/users/jitsi/repos","events_url":"https://api.github.com/users/jitsi/events{/privacy}","received_events_url":"https://api.github.com/users/jitsi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jitsi/lib-jitsi-meet","description":"","fork":false,"url":"https://api.github.com/repos/jitsi/lib-jitsi-meet","forks_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/forks","keys_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/teams","hooks_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/hooks","issue_events_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/issues/events{/number}","events_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/events","assignees_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/assignees{/user}","branches_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/branches{/branch}","tags_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/tags","blobs_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/git/refs{/sha}","trees_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/statuses/{sha}","languages_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/languages","stargazers_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/stargazers","contributors_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/contributors","subscribers_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/subscribers","subscription_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/subscription","commits_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/commits{/sha}","git_commits_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/git/commits{/sha}","comments_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/comments{/number}","issue_comment_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/issues/comments{/number}","contents_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/contents/{+path}","compare_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/merges","archive_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/downloads","issues_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/issues{/number}","pulls_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/pulls{/number}","milestones_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/milestones{/number}","notifications_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/labels{/name}","releases_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/releases{/id}","deployments_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/deployments","created_at":"2016-01-27T22:44:09Z","updated_at":"2016-05-10T12:16:29Z","pushed_at":"2016-05-26T23:56:58Z","git_url":"git://github.com/jitsi/lib-jitsi-meet.git","ssh_url":"git@github.com:jitsi/lib-jitsi-meet.git","clone_url":"https://github.com/jitsi/lib-jitsi-meet.git","svn_url":"https://github.com/jitsi/lib-jitsi-meet","homepage":null,"size":3446,"stargazers_count":11,"watchers_count":11,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":15,"forks":21,"open_issues":15,"watchers":11,"default_branch":"master"}},"base":{"label":"jitsi:master","ref":"master","sha":"b710c6df769d3a299909c20af057bb76cca590b3","user":{"login":"jitsi","id":3671647,"avatar_url":"https://avatars.githubusercontent.com/u/3671647?v=3","gravatar_id":"","url":"https://api.github.com/users/jitsi","html_url":"https://github.com/jitsi","followers_url":"https://api.github.com/users/jitsi/followers","following_url":"https://api.github.com/users/jitsi/following{/other_user}","gists_url":"https://api.github.com/users/jitsi/gists{/gist_id}","starred_url":"https://api.github.com/users/jitsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jitsi/subscriptions","organizations_url":"https://api.github.com/users/jitsi/orgs","repos_url":"https://api.github.com/users/jitsi/repos","events_url":"https://api.github.com/users/jitsi/events{/privacy}","received_events_url":"https://api.github.com/users/jitsi/received_events","type":"Organization","site_admin":false},"repo":{"id":50543360,"name":"lib-jitsi-meet","full_name":"jitsi/lib-jitsi-meet","owner":{"login":"jitsi","id":3671647,"avatar_url":"https://avatars.githubusercontent.com/u/3671647?v=3","gravatar_id":"","url":"https://api.github.com/users/jitsi","html_url":"https://github.com/jitsi","followers_url":"https://api.github.com/users/jitsi/followers","following_url":"https://api.github.com/users/jitsi/following{/other_user}","gists_url":"https://api.github.com/users/jitsi/gists{/gist_id}","starred_url":"https://api.github.com/users/jitsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jitsi/subscriptions","organizations_url":"https://api.github.com/users/jitsi/orgs","repos_url":"https://api.github.com/users/jitsi/repos","events_url":"https://api.github.com/users/jitsi/events{/privacy}","received_events_url":"https://api.github.com/users/jitsi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jitsi/lib-jitsi-meet","description":"","fork":false,"url":"https://api.github.com/repos/jitsi/lib-jitsi-meet","forks_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/forks","keys_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/teams","hooks_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/hooks","issue_events_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/issues/events{/number}","events_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/events","assignees_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/assignees{/user}","branches_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/branches{/branch}","tags_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/tags","blobs_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/git/refs{/sha}","trees_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/statuses/{sha}","languages_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/languages","stargazers_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/stargazers","contributors_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/contributors","subscribers_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/subscribers","subscription_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/subscription","commits_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/commits{/sha}","git_commits_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/git/commits{/sha}","comments_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/comments{/number}","issue_comment_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/issues/comments{/number}","contents_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/contents/{+path}","compare_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/merges","archive_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/downloads","issues_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/issues{/number}","pulls_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/pulls{/number}","milestones_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/milestones{/number}","notifications_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/labels{/name}","releases_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/releases{/id}","deployments_url":"https://api.github.com/repos/jitsi/lib-jitsi-meet/deployments","created_at":"2016-01-27T22:44:09Z","updated_at":"2016-05-10T12:16:29Z","pushed_at":"2016-05-26T23:56:58Z","git_url":"git://github.com/jitsi/lib-jitsi-meet.git","ssh_url":"git@github.com:jitsi/lib-jitsi-meet.git","clone_url":"https://github.com/jitsi/lib-jitsi-meet.git","svn_url":"https://github.com/jitsi/lib-jitsi-meet","homepage":null,"size":3446,"stargazers_count":11,"watchers_count":11,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":15,"forks":21,"open_issues":15,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jitsi/lib-jitsi-meet/pulls/106"},"html":{"href":"https://github.com/jitsi/lib-jitsi-meet/pull/106"},"issue":{"href":"https://api.github.com/repos/jitsi/lib-jitsi-meet/issues/106"},"comments":{"href":"https://api.github.com/repos/jitsi/lib-jitsi-meet/issues/106/comments"},"review_comments":{"href":"https://api.github.com/repos/jitsi/lib-jitsi-meet/pulls/106/comments"},"review_comment":{"href":"https://api.github.com/repos/jitsi/lib-jitsi-meet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jitsi/lib-jitsi-meet/pulls/106/commits"},"statuses":{"href":"https://api.github.com/repos/jitsi/lib-jitsi-meet/statuses/2c2f3e6c9a876a9dc27978da30206933944e3033"}}}}
{"actor":{"display_login":"lyubomir"}}