Skip to content

module: allow loading files with % in the name

Because the module resolver applies percent decoding due to being URL-based for browser alignment, files with % characters in them cannot be loaded. For example a file at an actual path "x%20.js" gets decoded to the incorrect path "x .js".

We can support this if we carefully ensure that double encoding is supported of the form "x%2520.js" (just as is supported in browser module specifiers).

In order to make this work, a small fix to the URL filepath -> URL conversion code is needed, which is included here.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

url, esmodules

Merge request reports

Loading