{"action":"created","comment":{"url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/pulls/comments/47206845","id":47206845,"diff_hunk":"@@ -2036,14 +2036,32 @@ Process.prototype.reportProduct = function (a, b) {\n     return +a * +b;\n };\n \n+function QuotientNaNException(numerator, denominator) {\n+    this.name = \"Quotient exception\";\n+    this.message = \"illegal division operation: (\" + numerator + \") / (\" + denominator + \")\";\n+}\n+\n Process.prototype.reportQuotient = function (a, b) {\n-    return +a / +b;\n+    var result = +a / +b;\n+    if (isNaN(result) || +b === 0) {\n+        throw new QuotientNaNException(+a, +b);\n+    }\n+    return result;\n };\n \n+function ModulusNaNException(numerator, denominator) {\n+    this.name = \"Modulus exception\";\n+    this.message = \"illegal modulus operation: (\" + numerator + \") / (\" + denominator + \")\";\n+}\n+\n Process.prototype.reportModulus = function (a, b) {\n     var x = +a,\n         y = +b;\n-    return ((x % y) + y) % y;\n+    var result = ((x % y) + y) % y;\n+    if (isNaN(result)) {\n+        throw new ModulusNaNException(+a, +b);","path":"threads.js","position":29,"original_position":29,"commit_id":"0682390abc60c9e82dabb974eabb9e799d54aeb4","original_commit_id":"0682390abc60c9e82dabb974eabb9e799d54aeb4","user":{"login":"cycomachead","id":1505907,"avatar_url":"https://avatars.githubusercontent.com/u/1505907?v=3","gravatar_id":"","url":"https://api.github.com/users/cycomachead","html_url":"https://github.com/cycomachead","followers_url":"https://api.github.com/users/cycomachead/followers","following_url":"https://api.github.com/users/cycomachead/following{/other_user}","gists_url":"https://api.github.com/users/cycomachead/gists{/gist_id}","starred_url":"https://api.github.com/users/cycomachead/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cycomachead/subscriptions","organizations_url":"https://api.github.com/users/cycomachead/orgs","repos_url":"https://api.github.com/users/cycomachead/repos","events_url":"https://api.github.com/users/cycomachead/events{/privacy}","received_events_url":"https://api.github.com/users/cycomachead/received_events","type":"User","site_admin":false},"body":"Minor: but probably better for those to just be `x` and `y`","created_at":"2015-12-10T09:55:30Z","updated_at":"2015-12-10T09:55:30Z","html_url":"https://github.com/jmoenig/Snap--Build-Your-Own-Blocks/pull/1060#discussion_r47206845","pull_request_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/pulls/1060","_links":{"self":{"href":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/pulls/comments/47206845"},"html":{"href":"https://github.com/jmoenig/Snap--Build-Your-Own-Blocks/pull/1060#discussion_r47206845"},"pull_request":{"href":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/pulls/1060"}}},"pull_request":{"url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/pulls/1060","id":53220640,"html_url":"https://github.com/jmoenig/Snap--Build-Your-Own-Blocks/pull/1060","diff_url":"https://github.com/jmoenig/Snap--Build-Your-Own-Blocks/pull/1060.diff","patch_url":"https://github.com/jmoenig/Snap--Build-Your-Own-Blocks/pull/1060.patch","issue_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/issues/1060","number":1060,"state":"open","locked":false,"title":"Added protection from performing illegal mathematical operations","user":{"login":"Craxic","id":4537985,"avatar_url":"https://avatars.githubusercontent.com/u/4537985?v=3","gravatar_id":"","url":"https://api.github.com/users/Craxic","html_url":"https://github.com/Craxic","followers_url":"https://api.github.com/users/Craxic/followers","following_url":"https://api.github.com/users/Craxic/following{/other_user}","gists_url":"https://api.github.com/users/Craxic/gists{/gist_id}","starred_url":"https://api.github.com/users/Craxic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Craxic/subscriptions","organizations_url":"https://api.github.com/users/Craxic/orgs","repos_url":"https://api.github.com/users/Craxic/repos","events_url":"https://api.github.com/users/Craxic/events{/privacy}","received_events_url":"https://api.github.com/users/Craxic/received_events","type":"User","site_admin":false},"body":"These changes cause the division block to raise an exception when a division by 0 is attempted, rather than returning \"NaN\" or \"Infinity\" (this is very confusing for people new to programming). It also prevents the modulus operation block from performing modulus by 0, and causes the monadic operation block (sqrt, pow) from doing things like `sqrt(-1)`.\r\n\r\nFinally, it prevents sprites from moving to Infinity or NaN locations.","created_at":"2015-12-10T06:32:40Z","updated_at":"2015-12-10T09:55:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f40253240a0c44dc49ae79a6cb3f6ccc42b49e0c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/pulls/1060/commits","review_comments_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/pulls/1060/comments","review_comment_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/issues/1060/comments","statuses_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/statuses/0682390abc60c9e82dabb974eabb9e799d54aeb4","head":{"label":"Craxic:numeric-exceptions","ref":"numeric-exceptions","sha":"0682390abc60c9e82dabb974eabb9e799d54aeb4","user":{"login":"Craxic","id":4537985,"avatar_url":"https://avatars.githubusercontent.com/u/4537985?v=3","gravatar_id":"","url":"https://api.github.com/users/Craxic","html_url":"https://github.com/Craxic","followers_url":"https://api.github.com/users/Craxic/followers","following_url":"https://api.github.com/users/Craxic/following{/other_user}","gists_url":"https://api.github.com/users/Craxic/gists{/gist_id}","starred_url":"https://api.github.com/users/Craxic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Craxic/subscriptions","organizations_url":"https://api.github.com/users/Craxic/orgs","repos_url":"https://api.github.com/users/Craxic/repos","events_url":"https://api.github.com/users/Craxic/events{/privacy}","received_events_url":"https://api.github.com/users/Craxic/received_events","type":"User","site_admin":false},"repo":{"id":47618829,"name":"Snap--Build-Your-Own-Blocks","full_name":"Craxic/Snap--Build-Your-Own-Blocks","owner":{"login":"Craxic","id":4537985,"avatar_url":"https://avatars.githubusercontent.com/u/4537985?v=3","gravatar_id":"","url":"https://api.github.com/users/Craxic","html_url":"https://github.com/Craxic","followers_url":"https://api.github.com/users/Craxic/followers","following_url":"https://api.github.com/users/Craxic/following{/other_user}","gists_url":"https://api.github.com/users/Craxic/gists{/gist_id}","starred_url":"https://api.github.com/users/Craxic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Craxic/subscriptions","organizations_url":"https://api.github.com/users/Craxic/orgs","repos_url":"https://api.github.com/users/Craxic/repos","events_url":"https://api.github.com/users/Craxic/events{/privacy}","received_events_url":"https://api.github.com/users/Craxic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Craxic/Snap--Build-Your-Own-Blocks","description":"a visual programming language inspired by Scratch","fork":true,"url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks","forks_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/forks","keys_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/teams","hooks_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/hooks","issue_events_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/issues/events{/number}","events_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/events","assignees_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/assignees{/user}","branches_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/branches{/branch}","tags_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/tags","blobs_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/statuses/{sha}","languages_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/languages","stargazers_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/stargazers","contributors_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/contributors","subscribers_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/subscribers","subscription_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/subscription","commits_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/issues/comments{/number}","contents_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/contents/{+path}","compare_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/merges","archive_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/downloads","issues_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/issues{/number}","pulls_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/pulls{/number}","milestones_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/milestones{/number}","notifications_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/labels{/name}","releases_url":"https://api.github.com/repos/Craxic/Snap--Build-Your-Own-Blocks/releases{/id}","created_at":"2015-12-08T11:48:03Z","updated_at":"2015-12-08T11:48:04Z","pushed_at":"2015-12-10T06:29:32Z","git_url":"git://github.com/Craxic/Snap--Build-Your-Own-Blocks.git","ssh_url":"git@github.com:Craxic/Snap--Build-Your-Own-Blocks.git","clone_url":"https://github.com/Craxic/Snap--Build-Your-Own-Blocks.git","svn_url":"https://github.com/Craxic/Snap--Build-Your-Own-Blocks","homepage":"http://snap.berkeley.edu","size":22495,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"jmoenig:master","ref":"master","sha":"b4af8f52e3d43e59443f191563b7ef1599a9d5b2","user":{"login":"jmoenig","id":2596285,"avatar_url":"https://avatars.githubusercontent.com/u/2596285?v=3","gravatar_id":"","url":"https://api.github.com/users/jmoenig","html_url":"https://github.com/jmoenig","followers_url":"https://api.github.com/users/jmoenig/followers","following_url":"https://api.github.com/users/jmoenig/following{/other_user}","gists_url":"https://api.github.com/users/jmoenig/gists{/gist_id}","starred_url":"https://api.github.com/users/jmoenig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmoenig/subscriptions","organizations_url":"https://api.github.com/users/jmoenig/orgs","repos_url":"https://api.github.com/users/jmoenig/repos","events_url":"https://api.github.com/users/jmoenig/events{/privacy}","received_events_url":"https://api.github.com/users/jmoenig/received_events","type":"User","site_admin":false},"repo":{"id":8815876,"name":"Snap--Build-Your-Own-Blocks","full_name":"jmoenig/Snap--Build-Your-Own-Blocks","owner":{"login":"jmoenig","id":2596285,"avatar_url":"https://avatars.githubusercontent.com/u/2596285?v=3","gravatar_id":"","url":"https://api.github.com/users/jmoenig","html_url":"https://github.com/jmoenig","followers_url":"https://api.github.com/users/jmoenig/followers","following_url":"https://api.github.com/users/jmoenig/following{/other_user}","gists_url":"https://api.github.com/users/jmoenig/gists{/gist_id}","starred_url":"https://api.github.com/users/jmoenig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmoenig/subscriptions","organizations_url":"https://api.github.com/users/jmoenig/orgs","repos_url":"https://api.github.com/users/jmoenig/repos","events_url":"https://api.github.com/users/jmoenig/events{/privacy}","received_events_url":"https://api.github.com/users/jmoenig/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmoenig/Snap--Build-Your-Own-Blocks","description":"a visual programming language inspired by Scratch","fork":false,"url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks","forks_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/forks","keys_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/teams","hooks_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/hooks","issue_events_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/issues/events{/number}","events_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/events","assignees_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/assignees{/user}","branches_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/branches{/branch}","tags_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/tags","blobs_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/statuses/{sha}","languages_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/languages","stargazers_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/stargazers","contributors_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/contributors","subscribers_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/subscribers","subscription_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/subscription","commits_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/issues/comments{/number}","contents_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/contents/{+path}","compare_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/merges","archive_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/downloads","issues_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/issues{/number}","pulls_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/pulls{/number}","milestones_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/milestones{/number}","notifications_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/labels{/name}","releases_url":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/releases{/id}","created_at":"2013-03-16T08:03:15Z","updated_at":"2015-12-07T03:49:21Z","pushed_at":"2015-12-10T06:32:40Z","git_url":"git://github.com/jmoenig/Snap--Build-Your-Own-Blocks.git","ssh_url":"git@github.com:jmoenig/Snap--Build-Your-Own-Blocks.git","clone_url":"https://github.com/jmoenig/Snap--Build-Your-Own-Blocks.git","svn_url":"https://github.com/jmoenig/Snap--Build-Your-Own-Blocks","homepage":"http://snap.berkeley.edu","size":45547,"stargazers_count":306,"watchers_count":306,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":245,"mirror_url":null,"open_issues_count":385,"forks":245,"open_issues":385,"watchers":306,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/pulls/1060"},"html":{"href":"https://github.com/jmoenig/Snap--Build-Your-Own-Blocks/pull/1060"},"issue":{"href":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/issues/1060"},"comments":{"href":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/issues/1060/comments"},"review_comments":{"href":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/pulls/1060/comments"},"review_comment":{"href":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/pulls/1060/commits"},"statuses":{"href":"https://api.github.com/repos/jmoenig/Snap--Build-Your-Own-Blocks/statuses/0682390abc60c9e82dabb974eabb9e799d54aeb4"}}}}