Permalink
Browse files

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>
  • Loading branch information...
devsnek committed Sep 13, 2018
1 parent 8d7aa21 commit a7b59d6204656f45abb91158648f19687b7c73b0
Showing with 6 additions and 14 deletions.
  1. +6 −14 lib/internal/per_context.js
@@ -8,20 +8,18 @@
// https://github.com/nodejs/node/issues/21219
// Adds Atomics.notify and warns on first usage of Atomics.wake
// https://github.com/v8/v8/commit/c79206b363 adds Atomics.notify so
// now we alias Atomics.wake to notify so that we can remove it
// semver major without worrying about V8.
const AtomicsWake = global.Atomics.wake;
const AtomicsNotify = global.Atomics.notify;
const ReflectApply = global.Reflect.apply;
// wrap for function.name
function notify(...args) {
return ReflectApply(AtomicsWake, this, args);
}
const warning = 'Atomics.wake will be removed in a future version, ' +
'use Atomics.notify instead.';
let wakeWarned = false;
function wake(...args) {
function wake(typedArray, index, count) {
if (!wakeWarned) {
wakeWarned = true;
@@ -32,16 +30,10 @@
}
}
return ReflectApply(AtomicsWake, this, args);
return ReflectApply(AtomicsNotify, this, arguments);
}
global.Object.defineProperties(global.Atomics, {
notify: {
value: notify,
writable: true,
enumerable: false,
configurable: true,
},
wake: {
value: wake,
writable: true,

0 comments on commit a7b59d6

Please sign in to comment.