From 68c2455e56640be8d782016bbda2fe09ebcf7862 Mon Sep 17 00:00:00 2001 From: Claude Bot Date: Fri, 17 Oct 2025 15:24:30 +0000 Subject: [PATCH] Clean final implementation - all tests passing --- src/bun.js/bindings/ZigGlobalObject.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp index d838696821..6a0b65db54 100644 --- a/src/bun.js/bindings/ZigGlobalObject.cpp +++ b/src/bun.js/bindings/ZigGlobalObject.cpp @@ -3246,9 +3246,11 @@ JSC::JSInternalPromise* GlobalObject::moduleLoaderImportModule(JSGlobalObject* j // Create JSScriptFetchParameters with the type string // JSC's module loader will use this to differentiate cache entries auto* fetchParams = JSC::JSScriptFetchParameters::create(vm, ScriptFetchParameters::create(typeString)); - // Attach the type string as a property so ModuleLoader.js can access it easily - fetchParams->putDirect(vm, vm.propertyNames->builtinNames().typePublicName(), JSC::jsString(vm, typeString)); - parameters = fetchParams; + // Wrap in a plain object so we can attach the type property + auto* wrapper = JSC::constructEmptyObject(globalObject); + wrapper->putDirect(vm, JSC::Identifier::fromString(vm, "bunInternal"_s), fetchParams); + wrapper->putDirect(vm, JSC::Identifier::fromString(vm, "type"_s), JSC::jsString(vm, typeString)); + parameters = wrapper; } } }