diff options
author | PerfectPan <perfectpan325@gmail.com> | 2019-11-05 15:08:42 +0800 |
---|---|---|
committer | ZYSzys <zyszys98@gmail.com> | 2019-11-09 14:11:31 +0800 |
commit | cb34358dd9ceb0b2a7ddcf14120000cb060d8181 (patch) | |
tree | 060036d314f7e509bb8aa82b84db61bb2cc3659e /lib/assert.js | |
parent | dde8fd3fab1ea849984d328f129691e32a055f21 (diff) | |
download | android-node-v8-cb34358dd9ceb0b2a7ddcf14120000cb060d8181.tar.gz android-node-v8-cb34358dd9ceb0b2a7ddcf14120000cb060d8181.tar.bz2 android-node-v8-cb34358dd9ceb0b2a7ddcf14120000cb060d8181.zip |
assert: replace var with let in lib/assert.js
Refs: https://github.com/nodejs/code-and-learn/issues/97
PR-URL: https://github.com/nodejs/node/pull/30261
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'lib/assert.js')
-rw-r--r-- | lib/assert.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/assert.js b/lib/assert.js index d307582d1f..4ce3c3bfde 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -186,7 +186,7 @@ function getCode(fd, line, column) { buffer = lines < line ? buffer : Buffer.allocUnsafe(bytesPerRead); bytesRead = readSync(fd, buffer, 0, bytesPerRead); // Read the buffer until the required code line is found. - for (var i = 0; i < bytesRead; i++) { + for (let i = 0; i < bytesRead; i++) { if (buffer[i] === 10 && ++lines === line) { // If the end of file is reached, directly parse the code and return. if (bytesRead < bytesPerRead) { @@ -863,7 +863,7 @@ assert.ifError = function ifError(err) { tmp2.shift(); // Filter all frames existing in err.stack. let tmp1 = newErr.stack.split('\n'); - for (var i = 0; i < tmp2.length; i++) { + for (let i = 0; i < tmp2.length; i++) { // Find the first occurrence of the frame. const pos = tmp1.indexOf(tmp2[i]); if (pos !== -1) { |