Skip to content

Commit

Permalink
add assert to addNumericSeparator
Browse files Browse the repository at this point in the history
  • Loading branch information
gurgunday committed Oct 18, 2024
1 parent 5732d4d commit 0bd51d5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/internal/util/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,7 @@ function handleMaxCallStackSize(ctx, err, constructorName, indentationLvl) {
function addNumericSeparator(integerString) {
let result = '';
let i = integerString.length;
assert(i !== 0);
const start = integerString[0] === '-' ? 1 : 0;
for (; i >= start + 4; i -= 3) {
result = `_${StringPrototypeSlice(integerString, i - 3, i)}${result}`;
Expand Down

0 comments on commit 0bd51d5

Please sign in to comment.