| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9950103 commit c2b6edf
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1475,11 +1475,11 @@ E('ERR_INVALID_REPL_EVAL_CONFIG', | |||
| 1475 | 1475 | E('ERR_INVALID_REPL_INPUT', '%s', TypeError); | |
| 1476 | 1476 | E('ERR_INVALID_RETURN_PROPERTY', (input, name, prop, value) => { | |
| 1477 | 1477 | return `Expected a valid ${input} to be returned for the "${prop}" from the` + | |
| 1478 | - ` "${name}" function but got ${determineSpecificType(value)}.`; | ||
| 1478 | + ` "${name}" hook but got ${determineSpecificType(value)}.`; | ||
| 1479 | 1479 | }, TypeError); | |
| 1480 | 1480 | E('ERR_INVALID_RETURN_PROPERTY_VALUE', (input, name, prop, value) => { | |
| 1481 | 1481 | return `Expected ${input} to be returned for the "${prop}" from the` + | |
| 1482 | - ` "${name}" function but got ${determineSpecificType(value)}.`; | ||
| 1482 | + ` "${name}" hook but got ${determineSpecificType(value)}.`; | ||
| 1483 | 1483 | }, TypeError); | |
| 1484 | 1484 | E('ERR_INVALID_RETURN_VALUE', (input, name, value) => { | |
| 1485 | 1485 | const type = determineSpecificType(value); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -128,7 +128,7 @@ function assertBufferSource(body, allowString, hookName) { | |||
| 128 | 128 | */ | |
| 129 | 129 | function stringify(body) { | |
| 130 | 130 | if (typeof body === 'string') { return body; } | |
| 131 | - assertBufferSource(body, false, 'transformSource'); | ||
| 131 | + assertBufferSource(body, false, 'load'); | ||
| 132 | 132 | const { TextDecoder } = require('internal/encoding'); | |
| 133 | 133 | DECODER = DECODER === null ? new TextDecoder() : DECODER; | |
| 134 | 134 | return DECODER.decode(body); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -43,6 +43,11 @@ await assert.rejects( | |||
| 43 | 43 | { code: 'ERR_INVALID_RETURN_PROPERTY_VALUE' }, | |
| 44 | 44 | ); | |
| 45 | 45 | ||
| 46 | + await assert.rejects(import('esmHook/commonJsNullSource.mjs'), { | ||
| 47 | + code: 'ERR_INVALID_RETURN_PROPERTY_VALUE', | ||
| 48 | + message: /"source".*'load'.*got type bigint/, | ||
| 49 | + }); | ||
| 50 | + | ||
| 46 | 51 | await import('../fixtures/es-module-loaders/js-as-esm.js') | |
| 47 | 52 | .then((parsedModule) => { | |
| 48 | 53 | assert.strictEqual(typeof parsedModule, 'object'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -97,5 +97,13 @@ export function load(url, context, next) { | |||
| 97 | 97 | }; | |
| 98 | 98 | } | |
| 99 | 99 | ||
| 100 | + if (url.endsWith('esmHook/commonJsNullSource.mjs')) { | ||
| 101 | + return { | ||
| 102 | + format: 'commonjs', | ||
| 103 | + shortCircuit: true, | ||
| 104 | + source: 1n, | ||
| 105 | + }; | ||
| 106 | + } | ||
| 107 | + | ||
| 100 | 108 | return next(url); | |
| 101 | 109 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments