{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/38475463","id":38475463,"diff_hunk":"@@ -0,0 +1,40 @@\n+'use strict';\n+\n+const common = require('../common');\n+const assert = require('assert');\n+const buffer = require('buffer');\n+const Buffer = buffer.Buffer;\n+const SlowBuffer = buffer.SlowBuffer;\n+\n+const ones = [1, 1, 1, 1];\n+\n+let sb = new SlowBuffer(4);\n+assert(sb instanceof Buffer);\n+assert.strictEqual(sb.length, 4);\n+sb.fill(1);\n+assert.deepEqual(sb, ones);\n+\n+// should work without new\n+sb = SlowBuffer(4);\n+assert.strictEqual(sb.length, 4);\n+sb.fill(1);\n+assert.deepEqual(sb, ones);\n+\n+// should create zero-length buffer if parameter is not a number\n+sb = SlowBuffer();\n+assert.strictEqual(sb.length, 0);\n+sb = SlowBuffer(NaN);\n+assert.strictEqual(sb.length, 0);\n+sb = SlowBuffer({});\n+assert.strictEqual(sb.length, 0);\n+sb = SlowBuffer('string');\n+assert.strictEqual(sb.length, 0);\n+\n+// should throw with invalid length\n+assert.throws(function() {\n+  new SlowBuffer(Infinity);\n+}, RangeError);\n+assert.throws(function() {\n+  new SlowBuffer(-1);\n+}, RangeError);\n+","path":"test/parallel/test-buffer-slow.js","position":40,"original_position":40,"commit_id":"b93479cb6c98d3573385c7db3d24034c77c68c05","original_commit_id":"b93479cb6c98d3573385c7db3d24034c77c68c05","user":{"login":"targos","id":2352663,"avatar_url":"https://avatars.githubusercontent.com/u/2352663?v=3","gravatar_id":"","url":"https://api.github.com/users/targos","html_url":"https://github.com/targos","followers_url":"https://api.github.com/users/targos/followers","following_url":"https://api.github.com/users/targos/following{/other_user}","gists_url":"https://api.github.com/users/targos/gists{/gist_id}","starred_url":"https://api.github.com/users/targos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/targos/subscriptions","organizations_url":"https://api.github.com/users/targos/orgs","repos_url":"https://api.github.com/users/targos/repos","events_url":"https://api.github.com/users/targos/events{/privacy}","received_events_url":"https://api.github.com/users/targos/received_events","type":"User","site_admin":false},"body":"All right, I will add those tests tomorrow.","created_at":"2015-09-01T21:36:58Z","updated_at":"2015-09-01T21:36:58Z","html_url":"https://github.com/nodejs/node/pull/2635#discussion_r38475463","pull_request_url":"https://api.github.com/repos/nodejs/node/pulls/2635","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments/38475463"},"html":{"href":"https://github.com/nodejs/node/pull/2635#discussion_r38475463"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/2635"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/2635","id":43851463,"html_url":"https://github.com/nodejs/node/pull/2635","diff_url":"https://github.com/nodejs/node/pull/2635.diff","patch_url":"https://github.com/nodejs/node/pull/2635.patch","issue_url":"https://api.github.com/repos/nodejs/node/issues/2635","number":2635,"state":"open","locked":false,"title":"buffer: make SlowBuffer constructor check that argument is a number","user":{"login":"targos","id":2352663,"avatar_url":"https://avatars.githubusercontent.com/u/2352663?v=3","gravatar_id":"","url":"https://api.github.com/users/targos","html_url":"https://github.com/targos","followers_url":"https://api.github.com/users/targos/followers","following_url":"https://api.github.com/users/targos/following{/other_user}","gists_url":"https://api.github.com/users/targos/gists{/gist_id}","starred_url":"https://api.github.com/users/targos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/targos/subscriptions","organizations_url":"https://api.github.com/users/targos/orgs","repos_url":"https://api.github.com/users/targos/repos","events_url":"https://api.github.com/users/targos/events{/privacy}","received_events_url":"https://api.github.com/users/targos/received_events","type":"User","site_admin":false},"body":"Fixes: https://github.com/nodejs/node/issues/2634","created_at":"2015-09-01T08:52:36Z","updated_at":"2015-09-01T21:36:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"25f41cf4c2c7a58d3f53829218b9feb98e3b49fd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node/pulls/2635/commits","review_comments_url":"https://api.github.com/repos/nodejs/node/pulls/2635/comments","review_comment_url":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node/issues/2635/comments","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/b93479cb6c98d3573385c7db3d24034c77c68c05","head":{"label":"targos:fix-slow-buffer","ref":"fix-slow-buffer","sha":"b93479cb6c98d3573385c7db3d24034c77c68c05","user":{"login":"targos","id":2352663,"avatar_url":"https://avatars.githubusercontent.com/u/2352663?v=3","gravatar_id":"","url":"https://api.github.com/users/targos","html_url":"https://github.com/targos","followers_url":"https://api.github.com/users/targos/followers","following_url":"https://api.github.com/users/targos/following{/other_user}","gists_url":"https://api.github.com/users/targos/gists{/gist_id}","starred_url":"https://api.github.com/users/targos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/targos/subscriptions","organizations_url":"https://api.github.com/users/targos/orgs","repos_url":"https://api.github.com/users/targos/repos","events_url":"https://api.github.com/users/targos/events{/privacy}","received_events_url":"https://api.github.com/users/targos/received_events","type":"User","site_admin":false},"repo":{"id":29471300,"name":"node","full_name":"targos/node","owner":{"login":"targos","id":2352663,"avatar_url":"https://avatars.githubusercontent.com/u/2352663?v=3","gravatar_id":"","url":"https://api.github.com/users/targos","html_url":"https://github.com/targos","followers_url":"https://api.github.com/users/targos/followers","following_url":"https://api.github.com/users/targos/following{/other_user}","gists_url":"https://api.github.com/users/targos/gists{/gist_id}","starred_url":"https://api.github.com/users/targos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/targos/subscriptions","organizations_url":"https://api.github.com/users/targos/orgs","repos_url":"https://api.github.com/users/targos/repos","events_url":"https://api.github.com/users/targos/events{/privacy}","received_events_url":"https://api.github.com/users/targos/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/targos/node","description":"Node.js","fork":true,"url":"https://api.github.com/repos/targos/node","forks_url":"https://api.github.com/repos/targos/node/forks","keys_url":"https://api.github.com/repos/targos/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/targos/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/targos/node/teams","hooks_url":"https://api.github.com/repos/targos/node/hooks","issue_events_url":"https://api.github.com/repos/targos/node/issues/events{/number}","events_url":"https://api.github.com/repos/targos/node/events","assignees_url":"https://api.github.com/repos/targos/node/assignees{/user}","branches_url":"https://api.github.com/repos/targos/node/branches{/branch}","tags_url":"https://api.github.com/repos/targos/node/tags","blobs_url":"https://api.github.com/repos/targos/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/targos/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/targos/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/targos/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/targos/node/statuses/{sha}","languages_url":"https://api.github.com/repos/targos/node/languages","stargazers_url":"https://api.github.com/repos/targos/node/stargazers","contributors_url":"https://api.github.com/repos/targos/node/contributors","subscribers_url":"https://api.github.com/repos/targos/node/subscribers","subscription_url":"https://api.github.com/repos/targos/node/subscription","commits_url":"https://api.github.com/repos/targos/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/targos/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/targos/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/targos/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/targos/node/contents/{+path}","compare_url":"https://api.github.com/repos/targos/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/targos/node/merges","archive_url":"https://api.github.com/repos/targos/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/targos/node/downloads","issues_url":"https://api.github.com/repos/targos/node/issues{/number}","pulls_url":"https://api.github.com/repos/targos/node/pulls{/number}","milestones_url":"https://api.github.com/repos/targos/node/milestones{/number}","notifications_url":"https://api.github.com/repos/targos/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/targos/node/labels{/name}","releases_url":"https://api.github.com/repos/targos/node/releases{/id}","created_at":"2015-01-19T13:07:04Z","updated_at":"2015-08-24T14:13:07Z","pushed_at":"2015-09-01T20:01:23Z","git_url":"git://github.com/targos/node.git","ssh_url":"git@github.com:targos/node.git","clone_url":"https://github.com/targos/node.git","svn_url":"https://github.com/targos/node","homepage":"https://iojs.org","size":143442,"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":"nodejs:master","ref":"master","sha":"5169b516509df7a829ffb8457ac648c056f85922","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":"✨Future Node.js releases will be from this repo. ✨","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}","created_at":"2014-11-26T19:57:11Z","updated_at":"2015-09-01T21:07:38Z","pushed_at":"2015-09-01T20:07:07Z","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://iojs.org","size":201950,"stargazers_count":13682,"watchers_count":13682,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1142,"mirror_url":null,"open_issues_count":368,"forks":1142,"open_issues":368,"watchers":13682,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/2635"},"html":{"href":"https://github.com/nodejs/node/pull/2635"},"issue":{"href":"https://api.github.com/repos/nodejs/node/issues/2635"},"comments":{"href":"https://api.github.com/repos/nodejs/node/issues/2635/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node/pulls/2635/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node/pulls/2635/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node/statuses/b93479cb6c98d3573385c7db3d24034c77c68c05"}}}}