GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — esm: fix return type of `import.meta.resolve` · nodejs/node@46d730a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal
    • errors.js
  • test/es-module
    • test-esm-import-meta-resolve.mjs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/errors.js‎

Copy file name to clipboardExpand all lines: lib/internal/errors.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1455,7 +1455,7 @@ E('ERR_MISSING_ARGS',
14551455
E('ERR_MISSING_OPTION', '%s is required', TypeError);
14561456
E('ERR_MODULE_NOT_FOUND', function(path, base, exactUrl) {
14571457
if (exactUrl) {
1458-
lazyInternalUtil().setOwnProperty(this, 'url', exactUrl);
1458+
lazyInternalUtil().setOwnProperty(this, 'url', `${exactUrl}`);
14591459
}
14601460
return `Cannot find ${
14611461
exactUrl ? 'module' : 'package'} '${path}' imported from ${base}`;
Collapse file

‎test/es-module/test-esm-import-meta-resolve.mjs‎

Copy file name to clipboardExpand all lines: test/es-module/test-esm-import-meta-resolve.mjs
+2-4Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ const fixtures = dirname.slice(0, dirname.lastIndexOf('/', dirname.length - 2) +
99

1010
assert.strictEqual(import.meta.resolve('./test-esm-import-meta.mjs'),
1111
dirname + 'test-esm-import-meta.mjs');
12-
const notFound = import.meta.resolve('./notfound.mjs');
13-
assert.strictEqual(new URL(notFound).href, new URL('./notfound.mjs', import.meta.url).href);
14-
const noExtension = import.meta.resolve('./asset');
15-
assert.strictEqual(new URL(noExtension).href, new URL('./asset', import.meta.url).href);
12+
assert.strictEqual(import.meta.resolve('./notfound.mjs'), new URL('./notfound.mjs', import.meta.url).href);
13+
assert.strictEqual(import.meta.resolve('./asset'), new URL('./asset', import.meta.url).href);
1614
try {
1715
import.meta.resolve('does-not-exist');
1816
assert.fail();

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.