diff options
author | 2022-11-09 18:55:51 -0800 | |
---|---|---|
committer | 2022-11-09 18:56:17 -0800 | |
commit | cf378d51fd18166bb34e1dcb60c1a2a1251bdaa6 (patch) | |
tree | e800d7edffb6d33b1b9da9041f59f8835a452e67 /src/bun.js/bindings/ZigGlobalObject.cpp | |
parent | 7f5022db0ca839262a862f8e2c8012145c4f90f5 (diff) | |
download | bun-cf378d51fd18166bb34e1dcb60c1a2a1251bdaa6.tar.gz bun-cf378d51fd18166bb34e1dcb60c1a2a1251bdaa6.tar.zst bun-cf378d51fd18166bb34e1dcb60c1a2a1251bdaa6.zip |
Fix broken stacktraces
Diffstat (limited to 'src/bun.js/bindings/ZigGlobalObject.cpp')
-rw-r--r-- | src/bun.js/bindings/ZigGlobalObject.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp index 34663c228..c01615685 100644 --- a/src/bun.js/bindings/ZigGlobalObject.cpp +++ b/src/bun.js/bindings/ZigGlobalObject.cpp @@ -2319,13 +2319,6 @@ void GlobalObject::finishCreation(VM& vm) Base::finishCreation(vm); ASSERT(inherits(info())); - JSC::JSObject* errorConstructor = this->errorConstructor(); - errorConstructor->putDirectNativeFunctionWithoutTransition(vm, this, JSC::Identifier::fromString(vm, "captureStackTrace"_s), 2, errorConstructorFuncCaptureStackTrace, ImplementationVisibility::Public, JSC::NoIntrinsic, PropertyAttribute::DontEnum | 0); - - // JSC default is 100 - errorConstructor->deleteProperty(this, vm.propertyNames->stackTraceLimit); - errorConstructor->putDirect(vm, vm.propertyNames->stackTraceLimit, jsNumber(DEFAULT_ERROR_STACK_TRACE_LIMIT), JSC::PropertyAttribute::DontEnum | 0); - // Change prototype from null to object for synthetic modules. m_moduleNamespaceObjectStructure.initLater( [](const Initializer<Structure>& init) { @@ -2579,6 +2572,12 @@ void GlobalObject::finishCreation(VM& vm) #endif RELEASE_ASSERT(classInfo()); + + JSC::JSObject* errorConstructor = this->errorConstructor(); + errorConstructor->putDirectNativeFunctionWithoutTransition(vm, this, JSC::Identifier::fromString(vm, "captureStackTrace"_s), 2, errorConstructorFuncCaptureStackTrace, ImplementationVisibility::Public, JSC::NoIntrinsic, PropertyAttribute::DontEnum | 0); + + // JSC default is 100 + errorConstructor->putDirect(vm, vm.propertyNames->stackTraceLimit, jsNumber(DEFAULT_ERROR_STACK_TRACE_LIMIT), JSC::PropertyAttribute::DontEnum | 0); } JSC_DEFINE_HOST_FUNCTION(functionBunPeek, |