From 1df804864650d358c0ebd284d9b0582f798771a2 Mon Sep 17 00:00:00 2001 From: ExE Boss <3889017+ExE-Boss@users.noreply.github.com> Date: Sun, 23 Aug 2020 17:40:00 +0200 Subject: [PATCH] =?UTF-8?q?errors:=20use=C2=A0`ErrorPrototypeToString`=20f?= =?UTF-8?q?rom=C2=A0`primordials`=C2=A0object?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/internal/errors.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/errors.js b/lib/internal/errors.js index 1c852f3776f62d..81bc4b8d81ffe9 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -13,6 +13,7 @@ const { ArrayIsArray, Error, + ErrorPrototypeToString, JSONStringify, Map, MathAbs, @@ -47,7 +48,6 @@ const kTypes = [ ]; const MainContextError = Error; -const ErrorToString = Error.prototype.toString; const overrideStackTrace = new WeakMap(); const kNoOverride = Symbol('kNoOverride'); const prepareStackTrace = (globalThis, error, trace) => { @@ -68,7 +68,7 @@ const prepareStackTrace = (globalThis, error, trace) => { // Error: Message // at function (file) // at file - const errorString = ErrorToString.call(error); + const errorString = ErrorPrototypeToString(error); if (trace.length === 0) { return errorString; }