mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 03:18:53 +00:00
fix(node:module): allow file url strings in createRequire (#7533)
* fix(node:module): allow file url strings in createRequire * add a non-happy path test :)
This commit is contained in:
@@ -1050,6 +1050,8 @@ std::optional<JSC::SourceCode> createCommonJSModule(
|
||||
|
||||
JSObject* JSCommonJSModule::createBoundRequireFunction(VM& vm, JSGlobalObject* lexicalGlobalObject, const WTF::String& pathString)
|
||||
{
|
||||
ASSERT(!pathString.startsWith("file://"_s));
|
||||
|
||||
auto* globalObject = jsCast<Zig::GlobalObject*>(lexicalGlobalObject);
|
||||
|
||||
JSString* filename = JSC::jsStringWithCache(vm, pathString);
|
||||
|
||||
Reference in New Issue
Block a user