From 3f506d318075023d0700776e041e65269e2a471a Mon Sep 17 00:00:00 2001 From: Aaron Dewes Date: Sat, 30 Sep 2023 13:13:02 +0200 Subject: [PATCH] Revert "Add support for Bun (#20)" This reverts commit 5bb4f50b76afc25d182e892e364f0febb9eb4b3e. --- index.js | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/index.js b/index.js index 7778f35..513c6fd 100644 --- a/index.js +++ b/index.js @@ -1,16 +1,7 @@ export default function callsites() { const _prepareStackTrace = Error.prepareStackTrace; - try { - let result = []; - Error.prepareStackTrace = (_, callSites) => { - const callSitesWithoutCurrent = callSites.slice(1); - result = callSitesWithoutCurrent; - return callSitesWithoutCurrent; - }; - - new Error().stack; // eslint-disable-line unicorn/error-message, no-unused-expressions - return result; - } finally { - Error.prepareStackTrace = _prepareStackTrace; - } + Error.prepareStackTrace = (_, stack) => stack; + const stack = new Error().stack.slice(1); // eslint-disable-line unicorn/error-message + Error.prepareStackTrace = _prepareStackTrace; + return stack; }