From f6780acbb08a59f3a33c07179d2dae8811c81699 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker Date: Fri, 10 Oct 2025 12:26:48 -0700 Subject: [PATCH 1/2] add dom.extras lib --- internal/tsoptions/enummaps.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/tsoptions/enummaps.go b/internal/tsoptions/enummaps.go index 6ea4ec4b33..b47e9739e3 100644 --- a/internal/tsoptions/enummaps.go +++ b/internal/tsoptions/enummaps.go @@ -130,6 +130,7 @@ var LibMap = collections.NewOrderedMapFromList([]collections.MapEntry[string, an {Key: "deno.webgpu", Value: "lib.deno.webgpu.d.ts"}, {Key: "deno.shared_globals", Value: "lib.deno.shared_globals.d.ts"}, {Key: "deno.unstable", Value: "lib.deno.unstable.d.ts"}, + {Key: "dom.extras", Value: "lib.dom.extras.d.ts"}, }) var ( From 82c28f6c50794d999a321633ffcda30ce434cf13 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker Date: Fri, 10 Oct 2025 16:12:08 -0700 Subject: [PATCH 2/2] do not crash on file url in default fileexists --- internal/api/server.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/internal/api/server.go b/internal/api/server.go index 4e69f462d2..20b1e48fdd 100644 --- a/internal/api/server.go +++ b/internal/api/server.go @@ -6,6 +6,8 @@ import ( "encoding/binary" "fmt" "io" + "net/url" + "path/filepath" "runtime/debug" "strconv" "strings" @@ -668,6 +670,18 @@ func (s *Server) DirectoryExists(path string) bool { return s.fs.DirectoryExists(path) } +func fileURLToPath(rawURL string) (string, error) { + u, err := url.Parse(rawURL) + if err != nil { + return "", err + } + if u.Scheme != "file" { + return "", fmt.Errorf("not a file URL: %s", u.Scheme) + } + // On Windows, url.Path starts with "/", e.g. /C:/path/to/file + return filepath.FromSlash(u.Path), nil +} + // FileExists implements vfs.FS. func (s *Server) FileExists(path string) bool { if s.enabledCallbacks&CallbackFileExists != 0 { @@ -679,6 +693,13 @@ func (s *Server) FileExists(path string) bool { return string(result) == "true" } } + if strings.HasPrefix(path, "file://") { + path, err := fileURLToPath(path) + if err != nil { + panic(err) + } + return s.fs.FileExists(path) + } return s.fs.FileExists(path) }