diff --git a/lib/internal/per_context.js b/lib/internal/per_context.js index f07e8822296b03..d8bedcf463f618 100644 --- a/lib/internal/per_context.js +++ b/lib/internal/per_context.js @@ -5,48 +5,4 @@ (function(global) { // https://github.com/nodejs/node/issues/14909 if (global.Intl) delete global.Intl.v8BreakIterator; - - // https://github.com/nodejs/node/issues/21219 - // Adds Atomics.notify and warns on first usage of Atomics.wake - - const AtomicsWake = global.Atomics.wake; - 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) { - if (!wakeWarned) { - wakeWarned = true; - - if (global.process !== undefined) { - global.process.emitWarning(warning, 'Atomics'); - } else { - global.console.error(`Atomics: ${warning}`); - } - } - - return ReflectApply(AtomicsWake, this, args); - } - - global.Object.defineProperties(global.Atomics, { - notify: { - value: notify, - writable: true, - enumerable: false, - configurable: true, - }, - wake: { - value: wake, - writable: true, - enumerable: false, - configurable: true, - }, - }); }(this)); diff --git a/test/parallel/test-atomics-notify.js b/test/parallel/test-atomics-notify.js deleted file mode 100644 index fc59d5aa331084..00000000000000 --- a/test/parallel/test-atomics-notify.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -const { expectWarning, noWarnCode } = require('../common'); - -const assert = require('assert'); -const { runInNewContext } = require('vm'); - -assert.strictEqual(typeof Atomics.wake, 'function'); -assert.strictEqual(typeof Atomics.notify, 'function'); - -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);