mirror of
https://github.com/nodejs/node.git
synced 2025-05-07 13:23:28 +00:00

Remove extraneous code from test-worker-syntax-error. Because the worker is called with `eval: true`, there is no need to set an environment variable indicating whether the worker has started and so on. The test file is only ever executed by the main thread. PR-URL: https://github.com/nodejs/node/pull/26144 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
12 lines
350 B
JavaScript
12 lines
350 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const { Worker } = require('worker_threads');
|
|
|
|
const w = new Worker('abc)', { eval: true });
|
|
w.on('message', common.mustNotCall());
|
|
w.on('error', common.mustCall((err) => {
|
|
assert.strictEqual(err.constructor, SyntaxError);
|
|
assert(/SyntaxError/.test(err));
|
|
}));
|