-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
buffer: zero fill Buffer(num) by default
PR-URL: #12141 Ref: nodejs/CTC#89 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Prince John Wesley <[email protected]> Reviewed-By: Evan Lucas <[email protected]>
- Loading branch information
Showing
3 changed files
with
34 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
'use strict'; | ||
|
||
require('../common'); | ||
const assert = require('assert'); | ||
const Buffer = require('buffer').Buffer; | ||
|
||
const buf1 = Buffer(100); | ||
const buf2 = new Buffer(100); | ||
|
||
for (let n = 0; n < buf1.length; n++) | ||
assert.strictEqual(buf1[n], 0); | ||
|
||
for (let n = 0; n < buf2.length; n++) | ||
assert.strictEqual(buf2[n], 0); |