closure/goog/base.js
function fetchInOwnScriptThenLoad() {
      /** @type {!HTMLDocument} */
      var doc = goog.global.document;

      var key = goog.Dependency.registerCallback_(function() {
        goog.Dependency.unregisterCallback_(key);
        load();
      });

      var script = '<script type="text/javascript">' +
          goog.protectScriptTag_('goog.Dependency.callback_("' + key + '");') +
          '</' +
          'script>';
      doc.write(
          goog.TRUSTED_TYPES_POLICY_ ?
              goog.TRUSTED_TYPES_POLICY_.createHTML(script) :
              script);
    }
function fetchInOwnScriptThenLoad() {
      /** @type {!HTMLDocument} */
      var doc = goog.global.document;

      var key = goog.Dependency.registerCallback_(function() {
        goog.Dependency.unregisterCallback_(key);
        load();
      });

      var script = '<script type="text/javascript">' +
          goog.protectScriptTag_('goog.Dependency.callback_("' + key + '");') +
          '</' +
          'script>';
      doc.write(
          goog.TRUSTED_TYPES_POLICY_ ?
              goog.TRUSTED_TYPES_POLICY_.createHTML(script) :
              script);
    }
function fetchInOwnScriptThenLoad ( ) { /** @type {!HTMLDocument} */ var doc = goog . global . document ; var key = goog . Dependency . registerCallback_ ( function ( ) { goog . Dependency . unregisterCallback_ ( key ) ; load ( ) ; } ) ; var script = '<script type="text/javascript">' + goog . protectScriptTag_ ( 'goog.Dependency.callback_("' + key + '");' ) + '</' + 'script>' ; doc . write ( goog . TRUSTED_TYPES_POLICY_ ? goog . TRUSTED_TYPES_POLICY_ . createHTML ( script ) : script ) ; }
Do not fetch now; in FireFox 47 the synchronous XHR doesn't block all events. If we fetched now and then document.write'd the contents the document.write would be an eval and would execute too soon! Instead write a script tag to fetch and eval synchronously at the correct time.
Do not fetch now ; in FireFox 47 the synchronous XHR doesn t block all events . If we fetched now and then document . write d the contents the document . write would be an eval and would execute too soon! Instead write a script tag to fetch and eval synchronously at the correct time .