mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
a8b3d7b26b
The explicit goal is to let users use `import.meta.url` to re-load thecurrent module inside a Worker instance. Fixes: https://github.com/nodejs/node/issues/30780 PR-URL: https://github.com/nodejs/node/pull/31664 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
7 lines
271 B
JavaScript
7 lines
271 B
JavaScript
import '../common/index.mjs';
|
|
import assert from 'assert';
|
|
import { Worker } from 'worker_threads';
|
|
|
|
const re = /The argument 'options\.eval' must be false when 'filename' is not a string\./;
|
|
assert.throws(() => new Worker(new URL(import.meta.url), { eval: true }), re);
|