fix(javascript): prove native URL constructor paths

This commit is contained in:
morluto committed 2026-10-24 04:25:13 +08:00
1 parent f97747c2fb
commit 55437c1431
4 files changed
+28 -6

No files matched your search

@@ -71,7 +71,8 @@ export const createStaticPathIntrinsicQuery = (
kind === "source-url"
? t.isNewExpression(callee) &&
callee.arguments.length === 2 &&
isUnmodifiedGlobalReference(callee.callee, index.bindings, "URL") &&
(isUnmodifiedGlobalReference(callee.callee, index.bindings, "URL") ||
nativeMethod(callee.callee, "URL", ["url"])) &&
isUnmodifiedImportMetaUrl(callee.arguments[1], index.bindings)
: kind === "file-url-to-path"
? nativeMethod(callee, "fileURLToPath", ["url"])