@@ -379,7 +379,7 @@ async function executeCode(request, executionId) {
379379 // Host sent a `cancel` IPC which called `isolate.dispose()`. Any
380380 // in-flight compileScript/run then throws; detect that authoritatively
381381 // via the isolate flag rather than fuzzy-matching the error message.
382- if ( isolate && isolate . isDisposed ) {
382+ if ( isolate ? .isDisposed ) {
383383 return {
384384 result : null ,
385385 stdout,
@@ -789,10 +789,9 @@ async function executeTask(request, executionId) {
789789 timings . brokerInstall = Date . now ( ) - tPhase
790790 tPhase = Date . now ( )
791791
792- const bootstrapScript = await isolate . compileScript (
793- `(async () => { ${ task . bootstrap } })()` ,
794- { filename : `sandbox/${ task . id } /bootstrap.js` }
795- )
792+ const bootstrapScript = await isolate . compileScript ( `(async () => { ${ task . bootstrap } })()` , {
793+ filename : `sandbox/${ task . id } /bootstrap.js` ,
794+ } )
796795 releaseables . push ( bootstrapScript )
797796 await bootstrapScript . run ( context , { timeout : timeoutMs , promise : true } )
798797 timings . taskBootstrap = Date . now ( ) - tPhase
@@ -917,15 +916,15 @@ async function executeTask(request, executionId) {
917916 // Cancellation: host sent `cancel` IPC which called `isolate.dispose()`.
918917 // Detect authoritatively via the isolate flag so we don't depend on
919918 // isolated-vm's internal error wording.
920- if ( isolate && isolate . isDisposed ) {
919+ if ( isolate ? .isDisposed ) {
921920 return {
922921 result : null ,
923922 stdout,
924923 error : { message : 'Execution cancelled' , name : 'AbortError' } ,
925924 timings,
926925 }
927926 }
928- if ( err . message && err . message . includes ( 'Script execution timed out' ) ) {
927+ if ( err . message ? .includes ( 'Script execution timed out' ) ) {
929928 return {
930929 result : null ,
931930 stdout,
0 commit comments