diff options
author | 2023-10-16 21:22:43 -0700 | |
---|---|---|
committer | 2023-10-16 21:22:43 -0700 | |
commit | 98d19fa6244384f7e17998b5420d724481ed3835 (patch) | |
tree | 3061ccab41196daf4194ecc385961b121f2ec06d /src/bun.js/bindings/ImportMetaObject.cpp | |
parent | a3958190e8f106adca7fbf4ba2605056cb22aced (diff) | |
download | bun-98d19fa6244384f7e17998b5420d724481ed3835.tar.gz bun-98d19fa6244384f7e17998b5420d724481ed3835.tar.zst bun-98d19fa6244384f7e17998b5420d724481ed3835.zip |
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 <jarred@jarredsumner.com>
* fix message for colin's changes
* okay
* fix cjs prototype
* implement mainModule
* i think this fixes it all
---------
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Diffstat (limited to 'src/bun.js/bindings/ImportMetaObject.cpp')
-rw-r--r-- | src/bun.js/bindings/ImportMetaObject.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
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<typename CellType, JSC::SubspaceAccess> 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) |