mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
lib: refactor to use primordials in lib/assert.js
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
4d072fecd2
commit
6f8c983f90
1 changed files with 2 additions and 2 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue