-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
per_context: add warning to Atomics.wake
PR-URL: #21518 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
- Loading branch information
Showing
3 changed files
with
55 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
'use strict'; | ||
|
||
require('../common'); | ||
const { expectWarning, noWarnCode } = require('../common'); | ||
|
||
const assert = require('assert'); | ||
const { runInNewContext } = require('vm'); | ||
|
||
assert.strictEqual(Atomics.wake, Atomics.notify); | ||
assert.strictEqual(typeof Atomics.wake, 'function'); | ||
assert.strictEqual(typeof Atomics.notify, 'function'); | ||
|
||
assert(runInNewContext('Atomics.wake === Atomics.notify')); | ||
assert.strictEqual(runInNewContext('typeof Atomics.wake'), 'function'); | ||
assert.strictEqual(runInNewContext('typeof Atomics.notify'), 'function'); | ||
|
||
expectWarning( | ||
'Atomics', | ||
'Atomics.wake will be removed in a future version, ' + | ||
'use Atomics.notify instead.', noWarnCode); | ||
|
||
Atomics.wake(new Int32Array(new SharedArrayBuffer(4)), 0, 0); |