diff options
Diffstat (limited to 'lib/internal/bootstrap/pre_execution.js')
| -rw-r--r-- | lib/internal/bootstrap/pre_execution.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js index 3724e9fb9a..08cc5807b4 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js @@ -246,12 +246,12 @@ function setupFetch() { } const handler = require('internal/v8').getWasmStreamingHandler(); - const cached = handler?.get(response.url); + const cached = await handler?.get(response.url); if (cached !== undefined && cache !== null) { if (streamState.setCompiledModuleBytes(cached)) { return; } else { - handler.delete(response.url); + await handler.delete(response.url); } } @@ -270,8 +270,13 @@ function setupFetch() { }, (url, buffer) => { const handler = require('internal/v8').getWasmStreamingHandler(); try { - handler?.set(url, buffer); + Promise.resolve(handler?.set(url, buffer)) + .catch((e) => { + const { triggerUncaughtException } = internalBinding('errors'); + triggerUncaughtException(e, true); + }); } catch (e) { + const { triggerUncaughtException } = internalBinding('errors'); triggerUncaughtException(e, false); } }); |
