Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: remove Atomics.notify alias #22830

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions lib/internal/per_context.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,4 @@
(function(global) {
// https://github.com/nodejs/node/issues/14909
if (global.Intl) delete global.Intl.v8BreakIterator;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👆 Should probably check in on the global.Intl bit in a follow-up (not this PR) to see if it's still needed too.

// 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));
19 changes: 0 additions & 19 deletions test/parallel/test-atomics-notify.js

This file was deleted.