error-actor.js (611B)
1 /* Any copyright is dedicated to the Public Domain. 2 * http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 "use strict"; 5 6 const { Actor } = require("resource://devtools/shared/protocol/Actor.js"); 7 8 /** 9 * Test actor designed to check that clients are properly notified of errors when calling 10 * methods on old style actors. 11 */ 12 class ErrorActor extends Actor { 13 constructor(conn, tab) { 14 super(conn, { typeName: "error", methods: [] }); 15 this.tab = tab; 16 this.requestTypes = { 17 error: this.onError, 18 }; 19 } 20 onError() { 21 throw new Error("error"); 22 } 23 } 24 25 exports.ErrorActor = ErrorActor;