diff --git a/lib/internal/per_context/setup.js b/lib/internal/per_context/setup.js index 725ba403df2348..16bd7db586b156 100644 --- a/lib/internal/per_context/setup.js +++ b/lib/internal/per_context/setup.js @@ -5,40 +5,11 @@ 'use strict'; // https://github.com/nodejs/node/issues/14909 -if (global.Intl) delete global.Intl.v8BreakIterator; +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 -// 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 AtomicsNotify = global.Atomics.notify; -const ReflectApply = global.Reflect.apply; - -const warning = 'Atomics.wake will be removed in a future version, ' + - 'use Atomics.notify instead.'; - -let wakeWarned = false; -function wake(typedArray, index, count) { - if (!wakeWarned) { - wakeWarned = true; - - if (global.process !== undefined) { - global.process.emitWarning(warning, 'Atomics'); - } else { - global.console.error(`Atomics: ${warning}`); - } - } - - return ReflectApply(AtomicsNotify, this, arguments); +if (global.Atomics) { + delete global.Atomics.wake; } - -global.Object.defineProperties(global.Atomics, { - wake: { - value: wake, - writable: true, - enumerable: false, - configurable: true, - }, -}); diff --git a/test/parallel/test-atomics-notify.js b/test/parallel/test-atomics-notify.js deleted file mode 100644 index 16dd1bb0c7dac1..00000000000000 --- a/test/parallel/test-atomics-notify.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -const { expectWarning } = 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.'); - -Atomics.wake(new Int32Array(new SharedArrayBuffer(4)), 0, 0);