Bug 1623350 - Convert exited response to an error. r=jdescottes

Differential Revision: https://phabricator.services.mozilla.com/D67456

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alexandre Poirot 2020-03-19 15:08:07 +00:00
Родитель 2c6d4bea78
Коммит 4a3b5e2165
2 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -672,7 +672,7 @@ where *tabThreadActor* is the name of a thread-like actor representing the tab's
If the user closes the tab before the client attaches to it, *targetActor* replies:
```
{ "from":<targetActor>, "type":"exited" }
{ "from":<targetActor>, "error":"exited" }
```
When the client is no longer interested in interacting with the tab, the client can request:

Просмотреть файл

@ -6,6 +6,10 @@
/* global XPCNativeWrapper */
// protocol.js uses objects as exceptions in order to define
// error packets.
/* eslint-disable no-throw-literal */
/*
* BrowsingContextTargetActor is an abstract class used by target actors that hold
* documents, such as frames, chrome windows, etc.
@ -988,7 +992,9 @@ const browsingContextTargetPrototype = {
attach(request) {
if (this.exited) {
return { type: "exited" };
throw {
error: "exited",
};
}
this._attach();