mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 21:19:50 +01:00
d9f394e607
PR-URL: https://github.com/nodejs/node/pull/48513 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Harshitha K P <harshitha014@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
26 lines
856 B
JavaScript
26 lines
856 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
const { Worker } = require('worker_threads');
|
|
const assert = require('assert');
|
|
|
|
new Worker(new URL('data:text/javascript,'))
|
|
.on('error', common.mustNotCall());
|
|
new Worker(new URL('data:text/javascript,export{}'))
|
|
.on('error', common.mustNotCall());
|
|
|
|
new Worker(new URL('data:text/plain,'))
|
|
.on('error', common.mustCall());
|
|
new Worker(new URL('data:text/javascript,module.exports={}'))
|
|
.on('error', common.mustCall());
|
|
|
|
new Worker(new URL('data:text/javascript,await Promise.resolve()'))
|
|
.on('error', common.mustNotCall());
|
|
new Worker(new URL('data:text/javascript,await Promise.reject()'))
|
|
.on('error', common.mustCall());
|
|
new Worker(new URL('data:text/javascript,await new Promise(()=>{})'))
|
|
.on(
|
|
'exit',
|
|
common.mustCall((exitCode) => { assert.strictEqual(exitCode, 13); })
|
|
);
|