string errors -> Error
This commit is contained in:
Родитель
eac4baa34f
Коммит
016bdf2d1b
|
@ -177,13 +177,13 @@
|
|||
*/
|
||||
showModal: function() {
|
||||
if (this.dialog_.hasAttribute('open')) {
|
||||
throw 'Failed to execute \'showModal\' on dialog: The element is already open, and therefore cannot be opened modally.';
|
||||
throw new Error('Failed to execute \'showModal\' on dialog: The element is already open, and therefore cannot be opened modally.');
|
||||
}
|
||||
if (!document.body.contains(this.dialog_)) {
|
||||
throw 'Failed to execute \'showModal\' on dialog: The element is not in a Document.'
|
||||
throw new Error('Failed to execute \'showModal\' on dialog: The element is not in a Document.');
|
||||
}
|
||||
if (!dialogPolyfill.dm.pushDialog(this)) {
|
||||
throw 'Failed to execute \'showModal\' on dialog: There are too many open modal dialogs.'
|
||||
throw new Error('Failed to execute \'showModal\' on dialog: There are too many open modal dialogs.');
|
||||
}
|
||||
this.show();
|
||||
this.openAsModal_ = true;
|
||||
|
@ -223,7 +223,7 @@
|
|||
*/
|
||||
close: function(opt_returnValue) {
|
||||
if (!this.dialog_.hasAttribute('open')) {
|
||||
throw 'Failed to execute \'close\' on dialog: The element does not have an \'open\' attribute, and therefore cannot be closed.'
|
||||
throw new Error('Failed to execute \'close\' on dialog: The element does not have an \'open\' attribute, and therefore cannot be closed.');
|
||||
}
|
||||
this.setOpen(false);
|
||||
|
||||
|
@ -303,7 +303,7 @@
|
|||
'may not work correctly', element);
|
||||
}
|
||||
if (element.nodeName.toUpperCase() != 'DIALOG') {
|
||||
throw 'Failed to register dialog: The element is not a dialog.';
|
||||
throw new Error('Failed to register dialog: The element is not a dialog.');
|
||||
}
|
||||
new dialogPolyfillInfo(/** @type {!HTMLDialogElement} */ (element));
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче