From ebe2b6d21e1524eb347dd3d9350d94af05834294 Mon Sep 17 00:00:00 2001 From: akhil marsonya <16393876+marsonya@users.noreply.github.com> Date: Tue, 15 Mar 2022 05:47:12 +0530 Subject: [PATCH] lib: refactor to use primordials in `lib/assert.js` PR-URL: https://github.com/nodejs/node/pull/41702 Reviewed-By: Darshan Sen Reviewed-By: Antoine du Hamel Reviewed-By: James M Snell Reviewed-By: Mestery --- lib/assert.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/assert.js b/lib/assert.js index 9a684cbe5fd6bf..bbd3c283c5f0e9 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.