Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: fix test-tls-connect-memleak
A loop that generates a long array is resulting in a RangeError. Moving
to Array.prototype.fill() along with the ** operator instead of using a
loop fixes the issue.
  • Loading branch information
Trott committed Jul 6, 2018
commit b825992dd9120dd57dd82536607b32544d939e8e
4 changes: 1 addition & 3 deletions test/pummel/test-tls-connect-memleak.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ tls.createServer({

{
// 2**26 == 64M entries
let junk = [0];

for (let i = 0; i < 26; ++i) junk = junk.concat(junk);
const junk = new Array(2 ** 26).fill(0);

const options = { rejectUnauthorized: false };
tls.connect(common.PORT, '127.0.0.1', options, function() {
Expand Down