Skip to content

Commit

Permalink
test: simplify array initialization
Browse files Browse the repository at this point in the history
PR-URL: #10860
Reviewed-By: Italo A. Casas <me@italoacasas.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Trott authored and italoacasas committed Jan 27, 2017
1 parent c77078f commit 999f685
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions test/parallel/test-buffer-alloc.js
Original file line number Diff line number Diff line change
@@ -988,9 +988,7 @@ assert.throws(() => Buffer.from('', 'buffer'), TypeError);
// Regression test for #6111. Constructing a buffer from another buffer
// should a) work, and b) not corrupt the source buffer.
{
let a = [0];
for (let i = 0; i < 7; ++i) a = a.concat(a);
a = a.map((_, i) => { return i; });
const a = [...Array(128).keys()]; // [0, 1, 2, 3, ... 126, 127]
const b = Buffer.from(a);
const c = Buffer.from(b);
assert.strictEqual(b.length, a.length);

0 comments on commit 999f685

Please sign in to comment.