Skip to content

Commit b76c13e

Browse files
PerfectPanMylesBorins
authored andcommitted
assert: replace var with let in lib/assert.js
Refs: nodejs/code-and-learn#97 PR-URL: #30261 Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 45fd44c commit b76c13e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/assert.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ function getCode(fd, line, column) {
186186
buffer = lines < line ? buffer : Buffer.allocUnsafe(bytesPerRead);
187187
bytesRead = readSync(fd, buffer, 0, bytesPerRead);
188188
// Read the buffer until the required code line is found.
189-
for (var i = 0; i < bytesRead; i++) {
189+
for (let i = 0; i < bytesRead; i++) {
190190
if (buffer[i] === 10 && ++lines === line) {
191191
// If the end of file is reached, directly parse the code and return.
192192
if (bytesRead < bytesPerRead) {
@@ -863,7 +863,7 @@ assert.ifError = function ifError(err) {
863863
tmp2.shift();
864864
// Filter all frames existing in err.stack.
865865
let tmp1 = newErr.stack.split('\n');
866-
for (var i = 0; i < tmp2.length; i++) {
866+
for (let i = 0; i < tmp2.length; i++) {
867867
// Find the first occurrence of the frame.
868868
const pos = tmp1.indexOf(tmp2[i]);
869869
if (pos !== -1) {

0 commit comments

Comments
 (0)