{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/99381140","pull_request_review_id":20059526,"id":99381140,"diff_hunk":"@@ -852,6 +852,12 @@ function checkOffset(offset, ext, length) {\n     throw new RangeError('Index out of range');\n }\n \n+function checkByteLength(byteLength) {\n+  if (typeof byteLength !== 'number' || byteLength <= 0)\n+    throw new TypeError('\"byteLength\" must be a positive number ' +","path":"lib/buffer.js","position":6,"original_position":6,"commit_id":"a8d1fa86a86de38b7e4e089d37a46dbd7621d533","original_commit_id":"a8d1fa86a86de38b7e4e089d37a46dbd7621d533","user":{"login":"seppevs","id":1028226,"avatar_url":"https://avatars.githubusercontent.com/u/1028226?v=3","gravatar_id":"","url":"https://api.github.com/users/seppevs","html_url":"https://github.com/seppevs","followers_url":"https://api.github.com/users/seppevs/followers","following_url":"https://api.github.com/users/seppevs/following{/other_user}","gists_url":"https://api.github.com/users/seppevs/gists{/gist_id}","starred_url":"https://api.github.com/users/seppevs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seppevs/subscriptions","organizations_url":"https://api.github.com/users/seppevs/orgs","repos_url":"https://api.github.com/users/seppevs/repos","events_url":"https://api.github.com/users/seppevs/events{/privacy}","received_events_url":"https://api.github.com/users/seppevs/received_events","type":"User","site_admin":false},"body":"So should we throw 2 separate errors (`TypeError` when it's not a Number and `RangeError` when `byteLength is <= 0`) or just one `RangeError`?","created_at":"2017-02-03T17:16:33Z","updated_at":"2017-02-03T17:16:33Z","html_url":"https://github.com/nodejs/node/pull/11146#discussion_r99381140","pull_request_url":"https://api.github.com/repos/nodejs/node/pulls/11146","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments/99381140"},"html":{"href":"https://github.com/nodejs/node/pull/11146#discussion_r99381140"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/11146"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/11146","id":104550548,"html_url":"https://github.com/nodejs/node/pull/11146","diff_url":"https://github.com/nodejs/node/pull/11146.diff","patch_url":"https://github.com/nodejs/node/pull/11146.patch","issue_url":"https://api.github.com/repos/nodejs/node/issues/11146","number":11146,"state":"open","locked":false,"title":"buffer: add a check for byteLength in readIntBE() and readIntLE()","user":{"login":"seppevs","id":1028226,"avatar_url":"https://avatars.githubusercontent.com/u/1028226?v=3","gravatar_id":"","url":"https://api.github.com/users/seppevs","html_url":"https://github.com/seppevs","followers_url":"https://api.github.com/users/seppevs/followers","following_url":"https://api.github.com/users/seppevs/following{/other_user}","gists_url":"https://api.github.com/users/seppevs/gists{/gist_id}","starred_url":"https://api.github.com/users/seppevs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seppevs/subscriptions","organizations_url":"https://api.github.com/users/seppevs/orgs","repos_url":"https://api.github.com/users/seppevs/repos","events_url":"https://api.github.com/users/seppevs/events{/privacy}","received_events_url":"https://api.github.com/users/seppevs/received_events","type":"User","site_admin":false},"body":"The 'byteLength' argument should be required and of type 'number'. It should never equal to, or be less than zero.\r\nThis is a fix for issue: https://github.com/nodejs/node/issues/10515\r\n\r\n##### Checklist\r\n- [x] `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes\r\n- [x] tests and/or benchmarks are included\r\n- [x] commit message follows commit guidelines\r\n\r\n##### Affected core subsystem(s)\r\nbuffer\r\n","created_at":"2017-02-03T15:08:55Z","updated_at":"2017-02-03T17:16:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0108f36e528c53fbf463689c4aae6a2a61f9b9e1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node/pulls/11146/commits","review_comments_url":"https://api.github.com/repos/nodejs/node/pulls/11146/comments","review_comment_url":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node/issues/11146/comments","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/a8d1fa86a86de38b7e4e089d37a46dbd7621d533","head":{"label":"seppevs:buffer_add_a_check_for_byteLength_in_readIntBE_and_readIntLE","ref":"buffer_add_a_check_for_byteLength_in_readIntBE_and_readIntLE","sha":"a8d1fa86a86de38b7e4e089d37a46dbd7621d533","user":{"login":"seppevs","id":1028226,"avatar_url":"https://avatars.githubusercontent.com/u/1028226?v=3","gravatar_id":"","url":"https://api.github.com/users/seppevs","html_url":"https://github.com/seppevs","followers_url":"https://api.github.com/users/seppevs/followers","following_url":"https://api.github.com/users/seppevs/following{/other_user}","gists_url":"https://api.github.com/users/seppevs/gists{/gist_id}","starred_url":"https://api.github.com/users/seppevs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seppevs/subscriptions","organizations_url":"https://api.github.com/users/seppevs/orgs","repos_url":"https://api.github.com/users/seppevs/repos","events_url":"https://api.github.com/users/seppevs/events{/privacy}","received_events_url":"https://api.github.com/users/seppevs/received_events","type":"User","site_admin":false},"repo":{"id":80760711,"name":"node","full_name":"seppevs/node","owner":{"login":"seppevs","id":1028226,"avatar_url":"https://avatars.githubusercontent.com/u/1028226?v=3","gravatar_id":"","url":"https://api.github.com/users/seppevs","html_url":"https://github.com/seppevs","followers_url":"https://api.github.com/users/seppevs/followers","following_url":"https://api.github.com/users/seppevs/following{/other_user}","gists_url":"https://api.github.com/users/seppevs/gists{/gist_id}","starred_url":"https://api.github.com/users/seppevs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seppevs/subscriptions","organizations_url":"https://api.github.com/users/seppevs/orgs","repos_url":"https://api.github.com/users/seppevs/repos","events_url":"https://api.github.com/users/seppevs/events{/privacy}","received_events_url":"https://api.github.com/users/seppevs/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/seppevs/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":true,"url":"https://api.github.com/repos/seppevs/node","forks_url":"https://api.github.com/repos/seppevs/node/forks","keys_url":"https://api.github.com/repos/seppevs/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/seppevs/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/seppevs/node/teams","hooks_url":"https://api.github.com/repos/seppevs/node/hooks","issue_events_url":"https://api.github.com/repos/seppevs/node/issues/events{/number}","events_url":"https://api.github.com/repos/seppevs/node/events","assignees_url":"https://api.github.com/repos/seppevs/node/assignees{/user}","branches_url":"https://api.github.com/repos/seppevs/node/branches{/branch}","tags_url":"https://api.github.com/repos/seppevs/node/tags","blobs_url":"https://api.github.com/repos/seppevs/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/seppevs/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/seppevs/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/seppevs/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/seppevs/node/statuses/{sha}","languages_url":"https://api.github.com/repos/seppevs/node/languages","stargazers_url":"https://api.github.com/repos/seppevs/node/stargazers","contributors_url":"https://api.github.com/repos/seppevs/node/contributors","subscribers_url":"https://api.github.com/repos/seppevs/node/subscribers","subscription_url":"https://api.github.com/repos/seppevs/node/subscription","commits_url":"https://api.github.com/repos/seppevs/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/seppevs/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/seppevs/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/seppevs/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/seppevs/node/contents/{+path}","compare_url":"https://api.github.com/repos/seppevs/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/seppevs/node/merges","archive_url":"https://api.github.com/repos/seppevs/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/seppevs/node/downloads","issues_url":"https://api.github.com/repos/seppevs/node/issues{/number}","pulls_url":"https://api.github.com/repos/seppevs/node/pulls{/number}","milestones_url":"https://api.github.com/repos/seppevs/node/milestones{/number}","notifications_url":"https://api.github.com/repos/seppevs/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/seppevs/node/labels{/name}","releases_url":"https://api.github.com/repos/seppevs/node/releases{/id}","deployments_url":"https://api.github.com/repos/seppevs/node/deployments","created_at":"2017-02-02T19:28:56Z","updated_at":"2017-02-02T19:29:21Z","pushed_at":"2017-02-03T17:05:04Z","git_url":"git://github.com/seppevs/node.git","ssh_url":"git@github.com:seppevs/node.git","clone_url":"https://github.com/seppevs/node.git","svn_url":"https://github.com/seppevs/node","homepage":"https://nodejs.org","size":260018,"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":"nodejs:master","ref":"master","sha":"3b488eccc14dc966949b103b1469221eed40719e","user":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"repo":{"id":27193779,"name":"node","full_name":"nodejs/node","owner":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars.githubusercontent.com/u/9950313?v=3","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nodejs/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":false,"url":"https://api.github.com/repos/nodejs/node","forks_url":"https://api.github.com/repos/nodejs/node/forks","keys_url":"https://api.github.com/repos/nodejs/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodejs/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodejs/node/teams","hooks_url":"https://api.github.com/repos/nodejs/node/hooks","issue_events_url":"https://api.github.com/repos/nodejs/node/issues/events{/number}","events_url":"https://api.github.com/repos/nodejs/node/events","assignees_url":"https://api.github.com/repos/nodejs/node/assignees{/user}","branches_url":"https://api.github.com/repos/nodejs/node/branches{/branch}","tags_url":"https://api.github.com/repos/nodejs/node/tags","blobs_url":"https://api.github.com/repos/nodejs/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodejs/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodejs/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodejs/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/{sha}","languages_url":"https://api.github.com/repos/nodejs/node/languages","stargazers_url":"https://api.github.com/repos/nodejs/node/stargazers","contributors_url":"https://api.github.com/repos/nodejs/node/contributors","subscribers_url":"https://api.github.com/repos/nodejs/node/subscribers","subscription_url":"https://api.github.com/repos/nodejs/node/subscription","commits_url":"https://api.github.com/repos/nodejs/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodejs/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodejs/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodejs/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodejs/node/contents/{+path}","compare_url":"https://api.github.com/repos/nodejs/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodejs/node/merges","archive_url":"https://api.github.com/repos/nodejs/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodejs/node/downloads","issues_url":"https://api.github.com/repos/nodejs/node/issues{/number}","pulls_url":"https://api.github.com/repos/nodejs/node/pulls{/number}","milestones_url":"https://api.github.com/repos/nodejs/node/milestones{/number}","notifications_url":"https://api.github.com/repos/nodejs/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodejs/node/labels{/name}","releases_url":"https://api.github.com/repos/nodejs/node/releases{/id}","deployments_url":"https://api.github.com/repos/nodejs/node/deployments","created_at":"2014-11-26T19:57:11Z","updated_at":"2017-02-03T17:01:03Z","pushed_at":"2017-02-03T17:06:25Z","git_url":"git://github.com/nodejs/node.git","ssh_url":"git@github.com:nodejs/node.git","clone_url":"https://github.com/nodejs/node.git","svn_url":"https://github.com/nodejs/node","homepage":"https://nodejs.org","size":260047,"stargazers_count":31269,"watchers_count":31269,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5783,"mirror_url":null,"open_issues_count":1020,"forks":5783,"open_issues":1020,"watchers":31269,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/11146"},"html":{"href":"https://github.com/nodejs/node/pull/11146"},"issue":{"href":"https://api.github.com/repos/nodejs/node/issues/11146"},"comments":{"href":"https://api.github.com/repos/nodejs/node/issues/11146/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node/pulls/11146/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node/pulls/11146/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node/statuses/a8d1fa86a86de38b7e4e089d37a46dbd7621d533"}}}}
{"actor":{"display_login":"seppevs"}}