forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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. Fixes: nodejs#39717 Co-authored-by: Shelley Vohr <[email protected]> Signed-off-by: Ruben Bridgewater <[email protected]>
- Loading branch information
Showing
4 changed files
with
43 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Flags: --no-harmony-sharedarraybuffer | ||
|
||
'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); | ||
} |