Files
Alexandre Poirot 44e5012d2c Bug 1813648 - [devtools] Remove ActorClassWithSpec and all its dependencies. r=devtools-reviewers,jdescottes
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
2023-02-14 10:34:19 +00:00

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;