demo/scripts/dialog-polyfill.js
function(opt_returnValue) {
      if (!this.dialog_.hasAttribute('open')) {
        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);

      // Leave returnValue untouched in case it was set directly on the element
      if (opt_returnValue !== undefined) {
        this.dialog_.returnValue = opt_returnValue;
      }

      // Triggering "close" event for any attached listeners on the <dialog>.
      var closeEvent = new supportCustomEvent('close', {
        bubbles: false,
        cancelable: false
      });
      this.dialog_.dispatchEvent(closeEvent);
    }
function(opt_returnValue) {
      if (!this.dialog_.hasAttribute('open')) {
        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);

      // Leave returnValue untouched in case it was set directly on the element
      if (opt_returnValue !== undefined) {
        this.dialog_.returnValue = opt_returnValue;
      }

      // Triggering "close" event for any attached listeners on the <dialog>.
      var closeEvent = new supportCustomEvent('close', {
        bubbles: false,
        cancelable: false
      });
      this.dialog_.dispatchEvent(closeEvent);
    }
function ( opt_returnValue ) { if ( ! this . dialog_ . hasAttribute ( 'open' ) ) { 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 ) ; // Leave returnValue untouched in case it was set directly on the element if ( opt_returnValue !== undefined ) { this . dialog_ . returnValue = opt_returnValue ; } // Triggering "close" event for any attached listeners on the <dialog>. var closeEvent = new supportCustomEvent ( 'close' , { bubbles : false , cancelable : false } ) ; this . dialog_ . dispatchEvent ( closeEvent ) ; }
Closes this HTMLDialogElement. This is optional vs clearing the open
attribute, however this fires a 'close' event.

@param {string=} opt_returnValue to use as the returnValue
Closes this HTMLDialogElement . This is optional vs clearing the open attribute however this fires a close event .