node/test/parallel/test-worker-no-sab.js
Michaël Zasso 8c36168b42
test: update flag to disable SharedArrayBuffer
`--no-harmony-sharedarraybuffer` was removed from V8 but it's still
possible to disable the feature with
`--enable-sharedarraybuffer-per-context`.

PR-URL: https://github.com/nodejs/node/pull/49639
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2023-10-10 08:27:59 +02:00

22 lines
563 B
JavaScript

// Flags: --enable-sharedarraybuffer-per-context
'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);
}