From 788f2831ec41b53259c201cb69ca99e3a278fe6c Mon Sep 17 00:00:00 2001 From: Akhil Marsonya Date: Wed, 26 Jan 2022 07:28:08 +0530 Subject: [PATCH] lib: refactor to use primordials in `lib/assert.js` --- 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.