mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:45:32 -05:00
test: use eslint to fix var->const/let
Manually fix issues that eslint --fix couldn't do automatically. 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
e6b6ce429c
commit
a6bd287724
732 files changed
+3390
-3371
No files matched your search
@@ -14,8 +14,9 @@ if (!common.enoughTestMem) {
|
||||
return;
|
||||
}
|
||||
|
||||
let buf;
|
||||
try {
|
||||
var buf = Buffer.allocUnsafe(kStringMaxLength);
|
||||
buf = Buffer.allocUnsafe(kStringMaxLength);
|
||||
} catch (e) {
|
||||
// If the exception is not due to memory confinement then rethrow it.
|
||||
if (e.message !== 'Array buffer allocation failed') throw (e);
|
||||
|
||||
+2
-1
@@ -14,8 +14,9 @@ if (!common.enoughTestMem) {
|
||||
// v8::String::kMaxLength defined in v8.h
|
||||
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
||||
|
||||
let buf;
|
||||
try {
|
||||
var buf = Buffer.allocUnsafe(kStringMaxLength + 1);
|
||||
buf = Buffer.allocUnsafe(kStringMaxLength + 1);
|
||||
} catch (e) {
|
||||
// If the exception is not due to memory confinement then rethrow it.
|
||||
if (e.message !== 'Array buffer allocation failed') throw (e);
|
||||
|
||||
+2
-1
@@ -14,8 +14,9 @@ if (!common.enoughTestMem) {
|
||||
// v8::String::kMaxLength defined in v8.h
|
||||
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
||||
|
||||
let buf;
|
||||
try {
|
||||
var buf = Buffer.allocUnsafe(kStringMaxLength + 1);
|
||||
buf = Buffer.allocUnsafe(kStringMaxLength + 1);
|
||||
} catch (e) {
|
||||
// If the exception is not due to memory confinement then rethrow it.
|
||||
if (e.message !== 'Array buffer allocation failed') throw (e);
|
||||
|
||||
+3
-2
@@ -14,8 +14,9 @@ if (!common.enoughTestMem) {
|
||||
// v8::String::kMaxLength defined in v8.h
|
||||
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
||||
|
||||
let buf;
|
||||
try {
|
||||
var buf = Buffer.allocUnsafe(kStringMaxLength + 1);
|
||||
buf = Buffer.allocUnsafe(kStringMaxLength + 1);
|
||||
} catch (e) {
|
||||
// If the exception is not due to memory confinement then rethrow it.
|
||||
if (e.message !== 'Array buffer allocation failed') throw (e);
|
||||
@@ -33,7 +34,7 @@ assert.throws(function() {
|
||||
buf.toString('latin1');
|
||||
}, /"toString\(\)" failed/);
|
||||
|
||||
var maxString = buf.toString('latin1', 1);
|
||||
let maxString = buf.toString('latin1', 1);
|
||||
assert.strictEqual(maxString.length, kStringMaxLength);
|
||||
// Free the memory early instead of at the end of the next assignment
|
||||
maxString = undefined;
|
||||
|
||||
+2
-1
@@ -14,8 +14,9 @@ if (!common.enoughTestMem) {
|
||||
// v8::String::kMaxLength defined in v8.h
|
||||
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
||||
|
||||
let buf;
|
||||
try {
|
||||
var buf = Buffer.allocUnsafe(kStringMaxLength + 1);
|
||||
buf = Buffer.allocUnsafe(kStringMaxLength + 1);
|
||||
} catch (e) {
|
||||
// If the exception is not due to memory confinement then rethrow it.
|
||||
if (e.message !== 'Array buffer allocation failed') throw (e);
|
||||
|
||||
+2
-1
@@ -14,8 +14,9 @@ if (!common.enoughTestMem) {
|
||||
// v8::String::kMaxLength defined in v8.h
|
||||
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
||||
|
||||
let buf;
|
||||
try {
|
||||
var buf = Buffer.allocUnsafe(kStringMaxLength + 1);
|
||||
buf = Buffer.allocUnsafe(kStringMaxLength + 1);
|
||||
} catch (e) {
|
||||
// If the exception is not due to memory confinement then rethrow it.
|
||||
if (e.message !== 'Array buffer allocation failed') throw (e);
|
||||
|
||||
+2
-1
@@ -14,8 +14,9 @@ if (!common.enoughTestMem) {
|
||||
// v8::String::kMaxLength defined in v8.h
|
||||
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
||||
|
||||
let buf;
|
||||
try {
|
||||
var buf = Buffer.allocUnsafe(kStringMaxLength + 2);
|
||||
buf = Buffer.allocUnsafe(kStringMaxLength + 2);
|
||||
} catch (e) {
|
||||
// If the exception is not due to memory confinement then rethrow it.
|
||||
if (e.message !== 'Array buffer allocation failed') throw (e);
|
||||
|
||||
@@ -14,8 +14,9 @@ if (!common.enoughTestMem) {
|
||||
// v8::String::kMaxLength defined in v8.h
|
||||
const kStringMaxLength = process.binding('buffer').kStringMaxLength;
|
||||
|
||||
let buf;
|
||||
try {
|
||||
var buf = Buffer.allocUnsafe(kStringMaxLength * 2 + 2);
|
||||
buf = Buffer.allocUnsafe(kStringMaxLength * 2 + 2);
|
||||
} catch (e) {
|
||||
// If the exception is not due to memory confinement then rethrow it.
|
||||
if (e.message !== 'Array buffer allocation failed') throw (e);
|
||||
|
||||
Reference in new issue
Block a user