| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -168,7 +168,7 @@ class Hooks { | |||
| 168 | 168 | port: insideLoader, | |
| 169 | 169 | }); | |
| 170 | 170 | ||
| 171 | - if (preloaded == null) { return; } | ||
| 171 | + if (preloaded == null) { continue; } | ||
| 172 | 172 | ||
| 173 | 173 | if (typeof preloaded !== 'string') { // [2] | |
| 174 | 174 | throw new ERR_INVALID_RETURN_VALUE( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -348,6 +348,20 @@ describe('Loader hooks', { concurrency: true }, () => { | |||
| 348 | 348 | }); | |
| 349 | 349 | }); | |
| 350 | 350 | ||
| 351 | + it('should handle globalPreload returning undefined', async () => { | ||
| 352 | + const { code, signal, stdout, stderr } = await spawnPromisified(execPath, [ | ||
| 353 | + '--no-warnings', | ||
| 354 | + '--experimental-loader', | ||
| 355 | + 'data:text/javascript,export function globalPreload(){}', | ||
| 356 | + fixtures.path('empty.js'), | ||
| 357 | + ]); | ||
| 358 | + | ||
| 359 | + assert.strictEqual(stderr, ''); | ||
| 360 | + assert.strictEqual(stdout, ''); | ||
| 361 | + assert.strictEqual(code, 0); | ||
| 362 | + assert.strictEqual(signal, null); | ||
| 363 | + }); | ||
| 364 | + | ||
| 351 | 365 | it('should be fine to call `process.removeAllListeners("beforeExit")` from the main thread', async () => { | |
| 352 | 366 | const { code, signal, stdout, stderr } = await spawnPromisified(execPath, [ | |
| 353 | 367 | '--no-warnings', | |
| Back | FazBrowse Home | New Git URL |
0 commit comments