зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1649738 - Log an error when calling targetFront.actorHasMethod() for an unknown or uninitialized actor. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D81850
This commit is contained in:
Родитель
ece484d43f
Коммит
5b6373fb8b
|
@ -261,6 +261,13 @@ function TargetMixin(parentClass) {
|
|||
*/
|
||||
actorHasMethod(actorName, methodName) {
|
||||
return this.getActorDescription(actorName).then(desc => {
|
||||
if (!desc) {
|
||||
console.error(
|
||||
`Actor "${actorName}" was not found in the protocol description.
|
||||
Ensure you used the correct typename and that the actor is initialized.`
|
||||
);
|
||||
}
|
||||
|
||||
if (desc?.methods) {
|
||||
return !!desc.methods.find(method => method.name === methodName);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче