Skip to content

Commit 0e105bd

Browse files
PerfectPantargos
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 c01a7fb commit 0e105bd

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
@@ -185,7 +185,7 @@ function getCode(fd, line, column) {
185185
buffer = lines < line ? buffer : Buffer.allocUnsafe(bytesPerRead);
186186
bytesRead = readSync(fd, buffer, 0, bytesPerRead);
187187
// Read the buffer until the required code line is found.
188-
for (var i = 0; i < bytesRead; i++) {
188+
for (let i = 0; i < bytesRead; i++) {
189189
if (buffer[i] === 10 && ++lines === line) {
190190
// If the end of file is reached, directly parse the code and return.
191191
if (bytesRead < bytesPerRead) {
@@ -822,7 +822,7 @@ assert.ifError = function ifError(err) {
822822
tmp2.shift();
823823
// Filter all frames existing in err.stack.
824824
let tmp1 = newErr.stack.split('\n');
825-
for (var i = 0; i < tmp2.length; i++) {
825+
for (let i = 0; i < tmp2.length; i++) {
826826
// Find the first occurrence of the frame.
827827
const pos = tmp1.indexOf(tmp2[i]);
828828
if (pos !== -1) {

0 commit comments

Comments
 (0)