From 98d19fa6244384f7e17998b5420d724481ed3835 Mon Sep 17 00:00:00 2001 From: dave caruso Date: Mon, 16 Oct 2023 21:22:43 -0700 Subject: fix(runtime): make some things more stable (partial jsc debug build) (#5881) * make our debug assertions work * install bun-webkit-debug * more progress * ok * progress... * more debug build stuff * ok * a * asdfghjkl * fix(runtime): fix bad assertion failure in JSBufferList * ok * stuff * upgrade webkit * Update src/bun.js/bindings/JSDOMWrapperCache.h Co-authored-by: Jarred Sumner * fix message for colin's changes * okay * fix cjs prototype * implement mainModule * i think this fixes it all --------- Co-authored-by: Jarred Sumner --- src/bun.js/bindings/ImportMetaObject.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/bun.js/bindings/ImportMetaObject.cpp') diff --git a/src/bun.js/bindings/ImportMetaObject.cpp b/src/bun.js/bindings/ImportMetaObject.cpp index 340c3319b..199a13392 100644 --- a/src/bun.js/bindings/ImportMetaObject.cpp +++ b/src/bun.js/bindings/ImportMetaObject.cpp @@ -266,7 +266,7 @@ extern "C" EncodedJSValue functionImportMeta__resolveSyncPrivate(JSC::JSGlobalOb if (LIKELY(global)) { auto overrideHandler = global->m_nodeModuleOverriddenResolveFilename.get(); if (UNLIKELY(overrideHandler)) { - ASSERT(overrideHandler.isCallable(globalObject)); + ASSERT(overrideHandler->isCallable()); MarkedArgumentBuffer args; args.append(moduleName); args.append(from); @@ -434,6 +434,7 @@ public: template static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm) { + STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(ImportMetaObjectPrototype, Base); return &vm.plainObjectSpace(); } @@ -447,11 +448,13 @@ public: reifyStaticProperties(vm, ImportMetaObject::info(), ImportMetaObjectPrototypeValues, *this); JSC_TO_STRING_TAG_WITHOUT_TRANSITION(); - this->putDirect( - vm, + auto mainGetter = JSFunction::create(vm, importMetaObjectMainCodeGenerator(vm), globalObject); + + this->putDirectAccessor( + this->globalObject(), builtinNames.mainPublicName(), - GetterSetter::create(vm, globalObject, JSFunction::create(vm, importMetaObjectMainCodeGenerator(vm), globalObject), nullptr), - JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Accessor | JSC::PropertyAttribute::Builtin | 0); + GetterSetter::create(vm, globalObject, mainGetter, mainGetter), + JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Accessor | 0); } ImportMetaObjectPrototype(JSC::VM& vm, JSC::Structure* structure) @@ -463,7 +466,7 @@ public: const ClassInfo ImportMetaObjectPrototype::s_info = { "ImportMeta"_s, - Base::info(), nullptr, nullptr, CREATE_METHOD_TABLE(ImportMetaObjectPrototype) + &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(ImportMetaObjectPrototype) }; JSC::Structure* ImportMetaObject::createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject) -- cgit v1.2.3