Make corpus 6839's package an island with a spread require

Main resolves computed createRequire specifiers at run time, so the
package's computed require no longer makes an island; a spread argument
list still does.
This commit is contained in:
Malte Ubl
2026-10-26 16:01:24 -07:00
parent c9f6e46f45
commit 803d654f99
@@ -1,8 +1,8 @@
// The loader picks its part with a computed require() specifier, which
// scriptc does not compile natively: the package runs in a Node island.
// The loader requires its part with spread arguments, which scriptc does
// not compile natively: the package runs in a Node island.
import { createRequire } from "node:module";
const load = createRequire(import.meta.url);
const { Route } = ["./route.cjs"].map((p) => load(p))[0];
const { Route } = load(...["./route.cjs"]);
export function route(path, weight) {
return new Route(path, weight);
}