Goal
Port Bun's plugin namespace behavior for Windows drive paths and make the failure path safe on non-Windows hosts.
Root cause
PluginRunner.extractNamespace()only recognized drive paths on Windows, so a literalC:\\...module key could be mistaken for plugin namespaceCon macOS/Linux.- Once the namespace ambiguity was removed, the POSIX resolver treated normalized
C:/...as a package path and reached an internal absolute-directory assertion instead of reporting an ordinary unresolved import. - The existing copied Bun regression had previously passed for the wrong reason before native resolver activation; the activated path exposed both defects.
Acceptance criteria
- Drive-rooted module keys are never interpreted as one-letter plugin namespaces, regardless of host OS.
- All ASCII drive letters, including A/a/Z/z, are handled.
- Foreign Windows drive paths reject as unresolved on POSIX instead of panicking or printing an internal stack.
js/bun/plugin/plugin-namespace-drive-letter.test.tspasses natively.- Full
home_testgate passes. - Land the fix on
mainand link the commit.
Evidence
Focused copied Bun corpus after the fix:
tests passed: 1
tests failed: 0
tests unsupported: 0
tests todo: 0Related stdin tranche: #187 Umbrella: #66
Landed
5bd10420ffix(runtime): reject foreign drive module paths