diff --git a/lib/internal/per_context.js b/lib/internal/per_context.js index f07e8822296b03..ddf874c7eac656 100644 --- a/lib/internal/per_context.js +++ b/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,