Skip to content

Commit

Permalink
assert: replace var with let in lib/assert.js
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
PerfectPan authored and MylesBorins committed Nov 17, 2019
1 parent 45fd44c commit b76c13e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit b76c13e

Please sign in to comment.