Skip to content

Commit

Permalink
lib: remove Atomics.wake
Browse files Browse the repository at this point in the history
PR-URL: #27033
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
  • Loading branch information
devsnek committed Apr 3, 2019
1 parent 9dba96d commit 15c0947
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 53 deletions.
39 changes: 5 additions & 34 deletions lib/internal/per_context/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
});
19 changes: 0 additions & 19 deletions test/parallel/test-atomics-notify.js

This file was deleted.

0 comments on commit 15c0947

Please sign in to comment.