@@ -251,14 +251,16 @@ void Message::AdoptSharedValueConveyor(SharedValueConveyor&& conveyor) {
251
251
252
252
namespace {
253
253
254
- MaybeLocal<Function> GetEmitMessageFunction (Local<Context> context) {
254
+ MaybeLocal<Function> GetEmitMessageFunction (Local<Context> context,
255
+ IsolateData* isolate_data) {
255
256
Isolate* isolate = context->GetIsolate ();
256
257
Local<Object> per_context_bindings;
257
258
Local<Value> emit_message_val;
258
- if (!GetPerContextExports (context).ToLocal (&per_context_bindings) ||
259
- !per_context_bindings->Get (context,
260
- FIXED_ONE_BYTE_STRING (isolate, " emitMessage" ))
261
- .ToLocal (&emit_message_val)) {
259
+ if (!GetPerContextExports (context, isolate_data)
260
+ .ToLocal (&per_context_bindings) ||
261
+ !per_context_bindings
262
+ ->Get (context, FIXED_ONE_BYTE_STRING (isolate, " emitMessage" ))
263
+ .ToLocal (&emit_message_val)) {
262
264
return MaybeLocal<Function>();
263
265
}
264
266
CHECK (emit_message_val->IsFunction ());
@@ -682,7 +684,8 @@ MessagePort::MessagePort(Environment* env,
682
684
}
683
685
684
686
Local<Function> emit_message_fn;
685
- if (!GetEmitMessageFunction (context).ToLocal (&emit_message_fn))
687
+ if (!GetEmitMessageFunction (context, env->isolate_data ())
688
+ .ToLocal (&emit_message_fn))
686
689
return ;
687
690
emit_message_fn_.Reset (env->isolate (), emit_message_fn);
688
691
0 commit comments