зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1225563 - Log error in JS that Doorhangers only support one positive and one negative button if invalid buttons are provided. r=nalexander
This commit is contained in:
Родитель
26467246e9
Коммит
62a6c6000f
|
@ -2283,6 +2283,11 @@ var NativeWindow = {
|
|||
aButtons = [];
|
||||
}
|
||||
|
||||
if (aButtons.length > 2) {
|
||||
console.log("Doorhanger can have a maximum of two buttons!");
|
||||
aButtons.length = 2;
|
||||
}
|
||||
|
||||
aButtons.forEach((function(aButton) {
|
||||
this._callbacks[this._callbacksId] = { cb: aButton.callback, prompt: this._promptId };
|
||||
aButton.callback = this._callbacksId;
|
||||
|
|
Загрузка…
Ссылка в новой задаче