From 733aad3bf2c8e1dcb6a7796207bc50e780253c2f Mon Sep 17 00:00:00 2001 From: Jon <134811123+jonsmy@users.noreply.github.com> Date: Mon, 26 Feb 2024 20:54:29 +0000 Subject: [PATCH] js/lcn/utils.js: use captureStackTrace if available --- js/lcn/utils.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/js/lcn/utils.js b/js/lcn/utils.js index 465a490e..a8b2771b 100644 --- a/js/lcn/utils.js +++ b/js/lcn/utils.js @@ -8,8 +8,7 @@ const assert = { if (actual !== expected) { const err = new Error(`Assertion Failed. ${message}`) err.data = { actual, expected} - // Seems like there's no such thing as captureStackTrace in firefox? - //Error.captureStackTrace(err, assert.equal) + Error.captureStackTrace?.(err, assert.equal) debugger throw err } @@ -18,7 +17,7 @@ const assert = { if (!actual) { const err = new Error(`Assertion Failed. ${message}`) err.data = { actual } - // Error.captureStackTrace(err, assert.ok) + Error.captureStackTrace?.(err, assert.ok) debugger throw err }