diff options
author | 2023-07-02 20:18:21 -0700 | |
---|---|---|
committer | 2023-07-02 20:18:21 -0700 | |
commit | 0db31c2b435ab7cd4d09810c2a2b22969c7366c5 (patch) | |
tree | 623aeb93b278014bc058e9f0fbb76d67ba7c16aa | |
parent | 3a0a423bcec850ea1a138f161012b0c622ccee28 (diff) | |
download | bun-0db31c2b435ab7cd4d09810c2a2b22969c7366c5.tar.gz bun-0db31c2b435ab7cd4d09810c2a2b22969c7366c5.tar.zst bun-0db31c2b435ab7cd4d09810c2a2b22969c7366c5.zip |
Fixes #3499
-rw-r--r-- | src/bun.js/bindings/ZigGlobalObject.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp index b69a4ebb3..c00670289 100644 --- a/src/bun.js/bindings/ZigGlobalObject.cpp +++ b/src/bun.js/bindings/ZigGlobalObject.cpp @@ -2861,15 +2861,13 @@ JSC_DEFINE_HOST_FUNCTION(errorConstructorFuncCaptureStackTrace, (JSC::JSGlobalOb errorObject->putDirect(vm, vm.propertyNames->stack, formattedStackTrace, 0); - if (!(caller && caller.isObject())) { - if (auto* instance = jsDynamicCast<JSC::ErrorInstance*>(errorObject)) { - // we make a separate copy of the StackTrace unfortunately so that we - // can later console.log it without losing the info - // - // This is not good. We should remove this in the future as it strictly makes this function - // already slower than necessary. - instance->captureStackTrace(vm, globalObject, 1, false); - } + if (auto* instance = jsDynamicCast<JSC::ErrorInstance*>(errorObject)) { + // we make a separate copy of the StackTrace unfortunately so that we + // can later console.log it without losing the info + // + // This is not good. We should remove this in the future as it strictly makes this function + // already slower than necessary. + instance->captureStackTrace(vm, globalObject, 1, false); } RETURN_IF_EXCEPTION(scope, JSC::JSValue::encode(JSValue {})); |