mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Fix crash in require.extensions (#18788)
Co-authored-by: 190n <7763597+190n@users.noreply.github.com>
This commit is contained in:
@@ -287,4 +287,18 @@ JSC::EncodedJSValue builtinLoader(JSC::JSGlobalObject* globalObject, JSC::CallFr
|
||||
return JSC::JSValue::encode(jsUndefined());
|
||||
}
|
||||
|
||||
template<typename Visitor>
|
||||
void JSCommonJSExtensions::visitChildrenImpl(JSCell* cell, Visitor& visitor)
|
||||
{
|
||||
JSCommonJSExtensions* thisObject = jsCast<JSCommonJSExtensions*>(cell);
|
||||
ASSERT_GC_OBJECT_INHERITS(thisObject, info());
|
||||
Base::visitChildren(thisObject, visitor);
|
||||
|
||||
for (auto& func : thisObject->m_registeredFunctions) {
|
||||
visitor.append(func);
|
||||
}
|
||||
}
|
||||
|
||||
DEFINE_VISIT_CHILDREN(JSCommonJSExtensions);
|
||||
|
||||
} // namespace Bun
|
||||
|
||||
@@ -41,6 +41,8 @@ public:
|
||||
return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
|
||||
}
|
||||
|
||||
DECLARE_VISIT_CHILDREN;
|
||||
|
||||
protected:
|
||||
static bool defineOwnProperty(JSC::JSObject*, JSC::JSGlobalObject*, JSC::PropertyName, const JSC::PropertyDescriptor&, bool shouldThrow);
|
||||
static bool put(JSC::JSCell*, JSC::JSGlobalObject*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&);
|
||||
|
||||
@@ -80,6 +80,7 @@
|
||||
#include "JSBufferList.h"
|
||||
#include "JSByteLengthQueuingStrategy.h"
|
||||
#include "JSCloseEvent.h"
|
||||
#include "JSCommonJSExtensions.h"
|
||||
#include "JSCountQueuingStrategy.h"
|
||||
#include "JSCustomEvent.h"
|
||||
#include "JSDOMConvertBase.h"
|
||||
@@ -4060,6 +4061,7 @@ void GlobalObject::visitChildrenImpl(JSCell* cell, Visitor& visitor)
|
||||
thisObject->m_lazyPreloadTestModuleObject.visit(visitor);
|
||||
thisObject->m_lazyReadableStreamPrototypeMap.visit(visitor);
|
||||
thisObject->m_lazyRequireCacheObject.visit(visitor);
|
||||
thisObject->m_lazyRequireExtensionsObject.visit(visitor);
|
||||
thisObject->m_lazyTestModuleObject.visit(visitor);
|
||||
thisObject->m_memoryFootprintStructure.visit(visitor);
|
||||
thisObject->m_JSStatsClassStructure.visit(visitor);
|
||||
|
||||
@@ -554,6 +554,9 @@ export function ospath(path: string) {
|
||||
*/
|
||||
export async function toMatchNodeModulesAt(lockfile: any, root: string) {
|
||||
function shouldSkip(pkg: any, dep: any): boolean {
|
||||
// Band-aid as toMatchNodeModulesAt will sometimes ask this function
|
||||
// if a package depends on itself
|
||||
if (pkg?.name === dep?.name) return true;
|
||||
return (
|
||||
!pkg ||
|
||||
!pkg.resolution ||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -15,13 +15,13 @@
|
||||
"@types/react-dom": "18.2.7",
|
||||
"autoprefixer": "10.4.16",
|
||||
"bun-types": "^1.0.3",
|
||||
"eslint": "8.50.0",
|
||||
"eslint-config-next": "14.1.3",
|
||||
"next": "14.1.3",
|
||||
"eslint": "^9.24.0",
|
||||
"eslint-config-next": "^15.2.4",
|
||||
"next": "^15.2.4",
|
||||
"postcss": "8.4.30",
|
||||
"puppeteer": "22.12.0",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0",
|
||||
"react": "^19.1.0",
|
||||
"react-dom": "^19.1.0",
|
||||
"tailwindcss": "3.3.3",
|
||||
"typescript": "5.2.2"
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -181,7 +181,6 @@ test(
|
||||
"required-server-files.json",
|
||||
// these have "signing keys", not sure what they are tbh
|
||||
"prerender-manifest.json",
|
||||
"prerender-manifest.js",
|
||||
// these are similar but i feel like there might be something we can fix to make them the same
|
||||
"next-minimal-server.js.nft.json",
|
||||
"next-server.js.nft.json",
|
||||
|
||||
Reference in New Issue
Block a user