mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-13 20:14:57 -10:00
Some actors weren't using any specification. They now have to pass a bare minimal spec object. Unifying them to the regular Actor interface helps merging constructor with initialize and instantiate all the actors without any code branch. Differential Revision: https://phabricator.services.mozilla.com/D169359
26 lines
611 B
JavaScript
26 lines
611 B
JavaScript
/* Any copyright is dedicated to the Public Domain.
|
|
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
|
|
"use strict";
|
|
|
|
const { Actor } = require("resource://devtools/shared/protocol/Actor.js");
|
|
|
|
/**
|
|
* Test actor designed to check that clients are properly notified of errors when calling
|
|
* methods on old style actors.
|
|
*/
|
|
class ErrorActor extends Actor {
|
|
constructor(conn, tab) {
|
|
super(conn, { typeName: "error", methods: [] });
|
|
this.tab = tab;
|
|
this.requestTypes = {
|
|
error: this.onError,
|
|
};
|
|
}
|
|
onError() {
|
|
throw new Error("error");
|
|
}
|
|
}
|
|
|
|
exports.ErrorActor = ErrorActor;
|