We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
determineSpecificType
1 parent 6ba4ebd commit c679348Copy full SHA for c679348
1 file changed
lib/internal/errors.js
@@ -1354,17 +1354,11 @@ E('ERR_INVALID_REPL_EVAL_CONFIG',
1354
E('ERR_INVALID_REPL_INPUT', '%s', TypeError);
1355
E('ERR_INVALID_RETURN_PROPERTY', (input, name, prop, value) => {
1356
return `Expected a valid ${input} to be returned for the "${prop}" from the` +
1357
- ` "${name}" function but got ${value}.`;
+ ` "${name}" function but got ${determineSpecificType(value)}.`;
1358
}, TypeError);
1359
E('ERR_INVALID_RETURN_PROPERTY_VALUE', (input, name, prop, value) => {
1360
- let type;
1361
- if (value?.constructor?.name) {
1362
- type = `instance of ${value.constructor.name}`;
1363
- } else {
1364
- type = `type ${typeof value}`;
1365
- }
1366
return `Expected ${input} to be returned for the "${prop}" from the` +
1367
- ` "${name}" function but got ${type}.`;
1368
1369
E('ERR_INVALID_RETURN_VALUE', (input, name, value) => {
1370
const type = determineSpecificType(value);
0 commit comments