js/lcn/utils.js: use captureStackTrace if available

This commit is contained in:
Jon 2024-02-26 20:54:29 +00:00 committed by towards-a-new-leftypol
parent e9228892fa
commit 733aad3bf2
1 changed files with 2 additions and 3 deletions

View File

@ -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
}