diff options
author | akhil marsonya <16393876+marsonya@users.noreply.github.com> | 2022-03-15 03:17:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-15 03:17:12 +0300 |
commit | 6f8c983f904ad6508f03e074524f40b2975c8cf6 (patch) | |
tree | b211eb69bbc682db138c374b06f8d0a5459d7daa /lib | |
parent | 4d072fecd2433f781d73d1b00d568a740eb5ec48 (diff) |
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/assert.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/assert.js b/lib/assert.js index 9a684cbe5fd..bbd3c283c5f 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -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. |