| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -169,7 +169,7 @@ class Hooks { | |||
| 169 | 169 | port: insideLoader, | |
| 170 | 170 | }); | |
| 171 | 171 | ||
| 172 | - if (preloaded == null) { return; } | ||
| 172 | + if (preloaded == null) { continue; } | ||
| 173 | 173 | ||
| 174 | 174 | if (typeof preloaded !== 'string') { // [2] | |
| 175 | 175 | throw new ERR_INVALID_RETURN_VALUE( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -400,6 +400,20 @@ describe('Loader hooks', { concurrency: true }, () => { | |||
| 400 | 400 | }); | |
| 401 | 401 | }); | |
| 402 | 402 | ||
| 403 | + it('should handle globalPreload returning undefined', async () => { | ||
| 404 | + const { code, signal, stdout, stderr } = await spawnPromisified(execPath, [ | ||
| 405 | + '--no-warnings', | ||
| 406 | + '--experimental-loader', | ||
| 407 | + 'data:text/javascript,export function globalPreload(){}', | ||
| 408 | + fixtures.path('empty.js'), | ||
| 409 | + ]); | ||
| 410 | + | ||
| 411 | + assert.strictEqual(stderr, ''); | ||
| 412 | + assert.strictEqual(stdout, ''); | ||
| 413 | + assert.strictEqual(code, 0); | ||
| 414 | + assert.strictEqual(signal, null); | ||
| 415 | + }); | ||
| 416 | + | ||
| 403 | 417 | it('should be fine to call `process.removeAllListeners("beforeExit")` from the main thread', async () => { | |
| 404 | 418 | const { code, signal, stdout, stderr } = await spawnPromisified(execPath, [ | |
| 405 | 419 | '--no-warnings', | |
| Back | FazBrowse Home | New Git URL |
0 commit comments