From a7b59d6204656f45abb91158648f19687b7c73b0 Mon Sep 17 00:00:00 2001
From: Gus Caplan <me@gus.host>
Date: Thu, 13 Sep 2018 12:03:17 -0500
Subject: [PATCH] src: flip Atomics.notify alias

PR-URL: https://github.com/nodejs/node/pull/22844
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Kyle Farnung <kfarnung@microsoft.com>
---
 lib/internal/per_context.js | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

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,