Skip to content

Commit 36aaa95

Browse files
committed
src,test: enable per_context.js shim
This reverts commit f5d29d5. It also updates the shim to use shim `wake` using `notify`. Refs: nodejs#565 Refs: nodejs#567 Refs: nodejs/node#22844
1 parent 49e76bc commit 36aaa95

3 files changed

Lines changed: 6 additions & 20 deletions

File tree

lib/internal/per_context.js

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,18 @@
88

99
// https://github.com/nodejs/node/issues/21219
1010
// Adds Atomics.notify and warns on first usage of Atomics.wake
11+
// https://github.com/v8/v8/commit/c79206b363 adds Atomics.notify so
12+
// now we alias Atomics.wake to notify so that we can remove it
13+
// semver major without worrying about V8.
1114

12-
const AtomicsWake = global.Atomics.wake;
15+
const AtomicsNotify = global.Atomics.notify;
1316
const ReflectApply = global.Reflect.apply;
1417

15-
// wrap for function.name
16-
function notify(...args) {
17-
return ReflectApply(AtomicsWake, this, args);
18-
}
19-
2018
const warning = 'Atomics.wake will be removed in a future version, ' +
2119
'use Atomics.notify instead.';
2220

2321
let wakeWarned = false;
24-
function wake(...args) {
22+
function wake(typedArray, index, count) {
2523
if (!wakeWarned) {
2624
wakeWarned = true;
2725

@@ -32,16 +30,10 @@
3230
}
3331
}
3432

35-
return ReflectApply(AtomicsWake, this, args);
33+
return ReflectApply(AtomicsNotify, this, arguments);
3634
}
3735

3836
global.Object.defineProperties(global.Atomics, {
39-
notify: {
40-
value: notify,
41-
writable: true,
42-
enumerable: false,
43-
configurable: true,
44-
},
4537
wake: {
4638
value: wake,
4739
writable: true,

src/node.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2978,7 +2978,6 @@ Local<Context> NewContext(Isolate* isolate,
29782978
context->SetEmbedderData(
29792979
ContextEmbedderIndex::kAllowWasmCodeGeneration, True(isolate));
29802980

2981-
#ifndef NODE_ENGINE_CHAKRACORE
29822981
{
29832982
// Run lib/internal/per_context.js
29842983
Context::Scope context_scope(context);
@@ -2989,7 +2988,6 @@ Local<Context> NewContext(Isolate* isolate,
29892988
&per_context_src).ToLocalChecked();
29902989
s->Run(context).ToLocalChecked();
29912990
}
2992-
#endif
29932991

29942992
return context;
29952993
}

test/parallel/parallel.status

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,6 @@ test-vm-createcacheddata : SKIP
229229
# Issue: https://github.com/nodejs/node-chakracore/issues/563
230230
test-zlib-unused-weak : SKIP
231231

232-
# Removed the wake->notify shim code
233-
# Issue: https://github.com/nodejs/node-chakracore/issues/565
234-
test-atomics-notify : SKIP
235-
236232
# These tests rely on V8's custom heap dumping and validation
237233
test-heapdump-dns : SKIP
238234
test-heapdump-fs-promise : SKIP

0 commit comments

Comments
 (0)