★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/78c8491a7eNouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files
test: remove apply calls over 65534 arg limit
PR-URL: #25852
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
  • Loading branch information
psmarshall authored and targos committed Mar 14, 2019
1 parent e0b3de1 commit 78c8491a7efddcb56f9ffe0fb2d4df727b68ae39
Showing with 6 additions and 4 deletions.
  1. +3 −2 test/parallel/test-buffer-includes.js
  2. +3 −2 test/parallel/test-buffer-indexof.js
@@ -214,8 +214,9 @@ assert(asciiString.includes('leb', 0));

// Search in string containing many non-ASCII chars.
const allCodePoints = [];
for (let i = 0; i < 65536; i++) allCodePoints[i] = i;
const allCharsString = String.fromCharCode.apply(String, allCodePoints);
for (let i = 0; i < 65534; i++) allCodePoints[i] = i;
const allCharsString = String.fromCharCode.apply(String, allCodePoints) +
String.fromCharCode(65534, 65535);
const allCharsBufferUtf8 = Buffer.from(allCharsString);
const allCharsBufferUcs2 = Buffer.from(allCharsString, 'ucs2');

@@ -276,8 +276,9 @@ assert.strictEqual(asciiString.indexOf('leb', 0), 3);

// Search in string containing many non-ASCII chars.
const allCodePoints = [];
for (let i = 0; i < 65536; i++) allCodePoints[i] = i;
const allCharsString = String.fromCharCode.apply(String, allCodePoints);
for (let i = 0; i < 65534; i++) allCodePoints[i] = i;
const allCharsString = String.fromCharCode.apply(String, allCodePoints) +
String.fromCharCode(65534, 65535);
const allCharsBufferUtf8 = Buffer.from(allCharsString);
const allCharsBufferUcs2 = Buffer.from(allCharsString, 'ucs2');

0 comments on commit 78c8491

Please sign in to comment.