Skip to content

Commit

Permalink
lib: refactor to use primordials in lib/assert.js
Browse files Browse the repository at this point in the history
PR-URL: #41702
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
  • Loading branch information
marsonya authored and bengl committed Mar 21, 2022
1 parent fd7e4ab commit 1fe0b69
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 @@ -965,10 +965,10 @@ assert.ifError = function ifError(err) {
// This will remove any duplicated frames from the error frames taken
// from within `ifError` and add the original error frames to the newly
// created ones.
const origStackStart = origStack.indexOf('\n at');
const origStackStart = StringPrototypeIndexOf(origStack, '\n at');
if (origStackStart !== -1) {
const originalFrames = StringPrototypeSplit(
origStack.slice(origStackStart + 1),
StringPrototypeSlice(origStack, origStackStart + 1),
'\n'
);
// Filter all frames existing in err.stack.
Expand Down

0 comments on commit 1fe0b69

Please sign in to comment.