Skip to content

Commit 2862eb0

Browse files
committed
address PR feedback
1 parent 2516239 commit 2862eb0

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

lib/internal/errors.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,11 +1452,11 @@ E('ERR_INVALID_REPL_EVAL_CONFIG',
14521452
E('ERR_INVALID_REPL_INPUT', '%s', TypeError);
14531453
E('ERR_INVALID_RETURN_PROPERTY', (input, name, prop, value) => {
14541454
return `Expected a valid ${input} to be returned for the "${prop}" from the` +
1455-
` "${name}" function but got ${determineSpecificType(value)}.`;
1455+
` "${name}" hook but got ${determineSpecificType(value)}.`;
14561456
}, TypeError);
14571457
E('ERR_INVALID_RETURN_PROPERTY_VALUE', (input, name, prop, value) => {
14581458
return `Expected ${input} to be returned for the "${prop}" from the` +
1459-
` "${name}" function but got ${determineSpecificType(value)}.`;
1459+
` "${name}" hook but got ${determineSpecificType(value)}.`;
14601460
}, TypeError);
14611461
E('ERR_INVALID_RETURN_VALUE', (input, name, value) => {
14621462
const type = determineSpecificType(value);

test/es-module/test-esm-loader.mjs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ await assert.rejects(
4343
{ code: 'ERR_INVALID_RETURN_PROPERTY_VALUE' },
4444
);
4545

46-
await assert.rejects(
47-
import('esmHook/commonJsNullSource.mjs'),
48-
{
49-
code: 'ERR_INVALID_RETURN_PROPERTY_VALUE',
50-
message: /for the "source" from the "load" function but got null/,
51-
},
52-
);
46+
try {
47+
await import('esmHook/commonJsNullSource.mjs');
48+
} catch (e) {
49+
assert.strictEqual(e.code, 'ERR_INVALID_RETURN_PROPERTY_VALUE');
50+
assert(e.message.includes('"source"'));
51+
assert(e.message.includes('"load"'));
52+
assert(e.message.includes('got null'));
53+
}
5354

5455
await import('../fixtures/es-module-loaders/js-as-esm.js')
5556
.then((parsedModule) => {

0 commit comments

Comments
 (0)