mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
test: use eslint to fix var->const/let
Manually fix issues that eslint --fix couldn't do automatically. Backport-PR-URL: https://github.com/nodejs/node/pull/11775 PR-URL: https://github.com/nodejs/node/pull/10685 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
This commit is contained in:
1 parent
de63698066
commit
db61c952de
806 files changed
+5031
-4995
No files matched your search
@@ -140,7 +140,7 @@ assert.strictEqual(
|
||||
|
||||
|
||||
// test usc2 encoding
|
||||
var twoByteString = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2');
|
||||
let twoByteString = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2');
|
||||
|
||||
assert(twoByteString.includes('\u0395', 4, 'ucs2'));
|
||||
assert(twoByteString.includes('\u03a3', -4, 'ucs2'));
|
||||
@@ -190,7 +190,7 @@ assert(!mixedByteStringUtf8.includes('\u0396'));
|
||||
|
||||
// Test complex string includes algorithms. Only trigger for long strings.
|
||||
// Long string that isn't a simple repeat of a shorter string.
|
||||
var longString = 'A';
|
||||
let longString = 'A';
|
||||
for (let i = 66; i < 76; i++) { // from 'B' to 'K'
|
||||
longString = longString + String.fromCharCode(i) + longString;
|
||||
}
|
||||
@@ -198,7 +198,7 @@ for (let i = 66; i < 76; i++) { // from 'B' to 'K'
|
||||
const longBufferString = Buffer.from(longString);
|
||||
|
||||
// pattern of 15 chars, repeated every 16 chars in long
|
||||
var pattern = 'ABACABADABACABA';
|
||||
let pattern = 'ABACABADABACABA';
|
||||
for (let i = 0; i < longBufferString.length - pattern.length; i += 7) {
|
||||
const includes = longBufferString.includes(pattern, i);
|
||||
assert(includes, 'Long ABACABA...-string at index ' + i);
|
||||
@@ -229,8 +229,8 @@ assert(!allCharsBufferUtf8.includes('notfound'));
|
||||
assert(!allCharsBufferUcs2.includes('notfound'));
|
||||
|
||||
// Find substrings in Utf8.
|
||||
var lengths = [1, 3, 15]; // Single char, simple and complex.
|
||||
var indices = [0x5, 0x60, 0x400, 0x680, 0x7ee, 0xFF02, 0x16610, 0x2f77b];
|
||||
let lengths = [1, 3, 15]; // Single char, simple and complex.
|
||||
let indices = [0x5, 0x60, 0x400, 0x680, 0x7ee, 0xFF02, 0x16610, 0x2f77b];
|
||||
for (let lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) {
|
||||
for (let i = 0; i < indices.length; i++) {
|
||||
const index = indices[i];
|
||||
|
||||
Reference in new issue
Block a user