Skip to content
Merged
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
13 changes: 9 additions & 4 deletions NativeScript/runtime/Worker.mm
Original file line number Diff line number Diff line change
Expand Up @@ -729,11 +729,16 @@ throw NativeScriptException(
return;
}
// HTML: a message that cannot be read still reaches its target, as a
// `messageerror` event carrying nothing, which leaves `data` at the
// null it defaults to. Delivery stores what it is given, so an
// undefined here would surface as undefined.
// `messageerror` event. Its `data` is the failure, the same as a port's
// (NativeMessagePort::Drain) and as what Node hands
// `worker.on("messageerror")`; null when nothing was thrown, since
// delivery stores the payload as given and a bare undefined would
// surface as such.
data = tc.HasCaught() ? tc.Exception() : Local<Value>();
if (data.IsEmpty() || data->IsUndefined()) {
data = v8::Null(isolate);
}
tc.Reset();
data = v8::Null(isolate);
ports = Local<Value>();
type = "messageerror";
}
Expand Down
Loading