mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
lib: do not crash using workers with disabled shared array buffers
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>
This commit is contained in:
committed by
GitHub
parent
9bbde3d7ba
commit
fbd55a8139
@@ -1,5 +1,12 @@
|
||||
'use strict';
|
||||
/* global SharedArrayBuffer */
|
||||
|
||||
if (typeof SharedArrayBuffer === 'undefined') {
|
||||
throw new Error('SharedArrayBuffers must be enabled to run this benchmark');
|
||||
}
|
||||
|
||||
if (typeof Atomics === 'undefined') {
|
||||
throw new Error('Atomics must be enabled to run this benchmark');
|
||||
}
|
||||
|
||||
const common = require('../common.js');
|
||||
const bench = common.createBenchmark(main, {
|
||||
|
||||
Reference in New Issue
Block a user