Skip to content

Commit a7b59d6

Browse files
committed
src: flip Atomics.notify alias
PR-URL: #22844 Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Kyle Farnung <kfarnung@microsoft.com>
1 parent 8d7aa21 commit a7b59d6

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

lib/internal/per_context.js

+6-14
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,18 @@
88

99
// https://github.com/nodejs/node/issues/21219
1010
// Adds Atomics.notify and warns on first usage of Atomics.wake
11+
// https://github.com/v8/v8/commit/c79206b363 adds Atomics.notify so
12+
// now we alias Atomics.wake to notify so that we can remove it
13+
// semver major without worrying about V8.
1114

12-
const AtomicsWake = global.Atomics.wake;
15+
const AtomicsNotify = global.Atomics.notify;
1316
const ReflectApply = global.Reflect.apply;
1417

15-
// wrap for function.name
16-
function notify(...args) {
17-
return ReflectApply(AtomicsWake, this, args);
18-
}
19-
2018
const warning = 'Atomics.wake will be removed in a future version, ' +
2119
'use Atomics.notify instead.';
2220

2321
let wakeWarned = false;
24-
function wake(...args) {
22+
function wake(typedArray, index, count) {
2523
if (!wakeWarned) {
2624
wakeWarned = true;
2725

@@ -32,16 +30,10 @@
3230
}
3331
}
3432

35-
return ReflectApply(AtomicsWake, this, args);
33+
return ReflectApply(AtomicsNotify, this, arguments);
3634
}
3735

3836
global.Object.defineProperties(global.Atomics, {
39-
notify: {
40-
value: notify,
41-
writable: true,
42-
enumerable: false,
43-
configurable: true,
44-
},
4537
wake: {
4638
value: wake,
4739
writable: true,

0 commit comments

Comments
 (0)