jspm_packages/npm/babel-core@5.8.38/lib/api/browser.js
function runScripts() {
  var scripts = [];
  var types = ["text/ecmascript-6", "text/6to5", "text/babel", "module"];
  var index = 0;

  /**
   * Transform and execute script. Ensures correct load order.
   */

  var exec = function exec() {
    var param = scripts[index];
    if (param instanceof Array) {
      transform.run.apply(transform, param);
      index++;
      exec();
    }
  };

  /**
   * Load, transform, and execute all scripts.
   */

  var run = function run(script, i) {
    var opts = {};

    if (script.src) {
      transform.load(script.src, function (param) {
        scripts[i] = param;
        exec();
      }, opts, true);
    } else {
      opts.filename = "embedded";
      scripts[i] = [script.innerHTML, opts];
    }
  };

  // Collect scripts with Babel `types`.

  var _scripts = global.document.getElementsByTagName("script");

  for (var i = 0; i < _scripts.length; ++i) {
    var _script = _scripts[i];
    if (types.indexOf(_script.type) >= 0) scripts.push(_script);
  }

  for (i in scripts) {
    run(scripts[i], i);
  }

  exec();
}
function runScripts() {
  var scripts = [];
  var types = ["text/ecmascript-6", "text/6to5", "text/babel", "module"];
  var index = 0;

  /**
   * Transform and execute script. Ensures correct load order.
   */

  var exec = function exec() {
    var param = scripts[index];
    if (param instanceof Array) {
      transform.run.apply(transform, param);
      index++;
      exec();
    }
  };

  /**
   * Load, transform, and execute all scripts.
   */

  var run = function run(script, i) {
    var opts = {};

    if (script.src) {
      transform.load(script.src, function (param) {
        scripts[i] = param;
        exec();
      }, opts, true);
    } else {
      opts.filename = "embedded";
      scripts[i] = [script.innerHTML, opts];
    }
  };

  // Collect scripts with Babel `types`.

  var _scripts = global.document.getElementsByTagName("script");

  for (var i = 0; i < _scripts.length; ++i) {
    var _script = _scripts[i];
    if (types.indexOf(_script.type) >= 0) scripts.push(_script);
  }

  for (i in scripts) {
    run(scripts[i], i);
  }

  exec();
}
function runScripts ( ) { var scripts = [ ] ; var types = [ "text/ecmascript-6" , "text/6to5" , "text/babel" , "module" ] ; var index = 0 ; /**
   * Transform and execute script. Ensures correct load order.
   */ var exec = function exec ( ) { var param = scripts [ index ] ; if ( param instanceof Array ) { transform . run . apply ( transform , param ) ; index ++ ; exec ( ) ; } } ; /**
   * Load, transform, and execute all scripts.
   */ var run = function run ( script , i ) { var opts = { } ; if ( script . src ) { transform . load ( script . src , function ( param ) { scripts [ i ] = param ; exec ( ) ; } , opts , true ) ; } else { opts . filename = "embedded" ; scripts [ i ] = [ script . innerHTML , opts ] ; } } ; // Collect scripts with Babel `types`. var _scripts = global . document . getElementsByTagName ( "script" ) ; for ( var i = 0 ; i < _scripts . length ; ++ i ) { var _script = _scripts [ i ] ; if ( types . indexOf ( _script . type ) >= 0 ) scripts . push ( _script ) ; } for ( i in scripts ) { run ( scripts [ i ] , i ) ; } exec ( ) ; }
Load and transform all scripts of `types`.

@example
<script type="module"></script>
Load and transform all scripts of types .