@@ -4031,16 +4031,37 @@ Local<Context> NewContext(Isolate* isolate,
40314031 auto context = Context::New (isolate, nullptr , object_template);
40324032 if (context.IsEmpty ()) return context;
40334033 HandleScope handle_scope (isolate);
4034- auto intl_key = FIXED_ONE_BYTE_STRING (isolate, " Intl" );
4035- auto break_iter_key = FIXED_ONE_BYTE_STRING (isolate, " v8BreakIterator" );
40364034 context->SetEmbedderData (
40374035 ContextEmbedderIndex::kAllowWasmCodeGeneration , True (isolate));
4036+
4037+ auto intl_key = FIXED_ONE_BYTE_STRING (isolate, " Intl" );
4038+ auto break_iter_key = FIXED_ONE_BYTE_STRING (isolate, " v8BreakIterator" );
40384039 Local<Value> intl_v;
40394040 if (context->Global ()->Get (context, intl_key).ToLocal (&intl_v) &&
40404041 intl_v->IsObject ()) {
40414042 Local<Object> intl = intl_v.As <Object>();
40424043 intl->Delete (context, break_iter_key).FromJust ();
40434044 }
4045+
4046+ // https://github.com/nodejs/node/issues/21219
4047+ // TODO(devsnek): remove when v8 supports Atomics.notify
4048+ auto atomics_key = FIXED_ONE_BYTE_STRING (isolate, " Atomics" );
4049+ Local<Value> atomics_v;
4050+ if (context->Global ()->Get (context, atomics_key).ToLocal (&atomics_v) &&
4051+ atomics_v->IsObject ()) {
4052+ Local<Object> atomics = atomics_v.As <Object>();
4053+ auto wake_key = FIXED_ONE_BYTE_STRING (isolate, " wake" );
4054+
4055+ Local<Value> wake = atomics->Get (context, wake_key).ToLocalChecked ();
4056+ auto notify_key = FIXED_ONE_BYTE_STRING (isolate, " notify" );
4057+
4058+ v8::PropertyDescriptor desc (wake, true );
4059+ desc.set_enumerable (false );
4060+ desc.set_configurable (true );
4061+
4062+ atomics->DefineProperty (context, notify_key, desc).ToChecked ();
4063+ }
4064+
40444065 return context;
40454066}
40464067
0 commit comments