mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00

This allows the repl to function normally while using the `--no-harmony-sharedarraybuffer` V8 flag. It also fixes using workers while using the `--no-harmony-atomics` V8 flag. Fixes: https://github.com/nodejs/node/issues/39717 Signed-off-by: Ruben Bridgewater <ruben@bridgewater.de> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> PR-URL: https://github.com/nodejs/node/pull/41023 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
21 lines
545 B
JavaScript
21 lines
545 B
JavaScript
// Flags: --no-harmony-atomics
|
|
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const { Worker } = require('worker_threads');
|
|
|
|
// Regression test for https://github.com/nodejs/node/issues/39717.
|
|
|
|
// Do not use isMainThread so that this test itself can be run inside a Worker.
|
|
if (!process.env.HAS_STARTED_WORKER) {
|
|
process.env.HAS_STARTED_WORKER = 1;
|
|
const w = new Worker(__filename);
|
|
|
|
w.on('exit', common.mustCall((status) => {
|
|
assert.strictEqual(status, 2);
|
|
}));
|
|
} else {
|
|
process.exit(2);
|
|
}
|