11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_ciconst common = require('../common'); 41cb0ef41Sopenharmony_ciconst { Worker } = require('worker_threads'); 51cb0ef41Sopenharmony_ciconst assert = require('assert'); 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_cinew Worker(new URL('data:text/javascript,')) 81cb0ef41Sopenharmony_ci .on('error', common.mustNotCall()); 91cb0ef41Sopenharmony_cinew Worker(new URL('data:text/javascript,export{}')) 101cb0ef41Sopenharmony_ci .on('error', common.mustNotCall()); 111cb0ef41Sopenharmony_ci 121cb0ef41Sopenharmony_cinew Worker(new URL('data:text/plain,')) 131cb0ef41Sopenharmony_ci .on('error', common.mustCall()); 141cb0ef41Sopenharmony_cinew Worker(new URL('data:text/javascript,module.exports={}')) 151cb0ef41Sopenharmony_ci .on('error', common.mustCall()); 161cb0ef41Sopenharmony_ci 171cb0ef41Sopenharmony_cinew Worker(new URL('data:text/javascript,await Promise.resolve()')) 181cb0ef41Sopenharmony_ci .on('error', common.mustNotCall()); 191cb0ef41Sopenharmony_cinew Worker(new URL('data:text/javascript,await Promise.reject()')) 201cb0ef41Sopenharmony_ci .on('error', common.mustCall()); 211cb0ef41Sopenharmony_cinew Worker(new URL('data:text/javascript,await new Promise(()=>{})')) 221cb0ef41Sopenharmony_ci .on( 231cb0ef41Sopenharmony_ci 'exit', 241cb0ef41Sopenharmony_ci common.mustCall((exitCode) => { assert.strictEqual(exitCode, 13); }) 251cb0ef41Sopenharmony_ci ); 26