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:
dlim 2016-02-23 13:45:36 -08:00
parent a2fda5b5a5
commit 8b8d966746

View File

@ -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;