<commit_before>/*
 * Traceur and Babel transpile hook for Loader
 */
(function(Loader) {
  // Returns an array of ModuleSpecifiers
  var transpiler, transpilerModule;

  // use Traceur by default
  Loader.prototype.transpiler = 'traceur';

  Loader.prototype.transpile = function(load) {
    if (!transpiler) {
      transpilerModule = this.get('@' + this.transpiler);

      if (transpilerModule) {
        transpilerModule = transpilerModule['default'];
      }
      else {
        transpilerModule = __global[this.transpiler];
        if (!transpilerModule && typeof require != 'undefined') {
          var curSystem = __global.System;
          transpilerModule = require(this.transpiler == 'babel' ? 'babel-core' : 'traceur');
          __global.System = curSystem;
        }
        if (!transpilerModule)
          throw new TypeError('Include Traceur or Babel for module syntax support.');
        this.set('@' + this.transpiler, this.newModule({ 'default': transpilerModule, __useDefault: true }));
      }

      if (this.transpiler == 'babel')
        transpiler = babelTranspile;
      else if (this.transpiler == 'traceur')
        transpiler = traceurTranspile;
    }

    return 'var __moduleAddress = "' + load.address + '";' + transpiler.call(this, load);
  }

  function traceurTranspile(load) {
    var options = this.traceurOptions || {};
    options.modules = 'instantiate';
    options.script = false;
    options.sourceMaps = 'inline';
    options.filename = load.address;
    options.inputSourceMap = load.metadata.sourceMap;

    var compiler = new transpilerModule.Compiler(options);
    var source = doTraceurCompile(load.source, compiler, options.filename);

    // add "!eval" to end of Traceur sourceURL
    // I believe this does something?
    source += '!eval';

    return source;
  }
  function doTraceurCompile(source, compiler, filename) {
    try {
      return compiler.compile(source, filename);
    }
    catch(e) {
      // traceur throws an error array
      throw e[0];
    }
  }

  function babelTranspile(load) {
    var options = this.babelOptions || {};
    options.modules = 'system';
    options.sourceMap = 'inline';
    options.filename = load.address;
    options.code = true;
    options.ast = false;
    options.blacklist = options.blacklist || [];
    options.blacklist.push('react');

    var source = transpilerModule.transform(load.source, options).code;

    // add "!eval" to end of Babel sourceURL
    // I believe this does something?
    return source + '\n//# sourceURL=' + load.address + '!eval';
  }


})(__global.LoaderPolyfill);<commit_msg>rename transpiler modules<commit_after>/*
 * Traceur and Babel transpile hook for Loader
 */
(function(Loader) {
  // Returns an array of ModuleSpecifiers
  var transpiler, transpilerModule;

  // use Traceur by default
  Loader.prototype.transpiler = 'traceur';

  Loader.prototype.transpile = function(load) {
    if (!transpiler) {
      transpilerModule = this.get(this.transpiler);

      if (transpilerModule) {
        transpilerModule = transpilerModule['default'];
      }
      else {
        transpilerModule = __global[this.transpiler];
        if (!transpilerModule && typeof require != 'undefined') {
          var curSystem = __global.System;
          transpilerModule = require(this.transpiler == 'babel' ? 'babel-core' : 'traceur');
          __global.System = curSystem;
        }
        if (!transpilerModule)
          throw new TypeError('Include Traceur or Babel for module syntax support.');
        this.set(this.transpiler, this.newModule({ 'default': transpilerModule, __useDefault: true }));
      }

      if (this.transpiler == 'babel')
        transpiler = babelTranspile;
      else if (this.transpiler == 'traceur')
        transpiler = traceurTranspile;
    }

    return 'var __moduleAddress = "' + load.address + '";' + transpiler.call(this, load);
  }

  function traceurTranspile(load) {
    var options = this.traceurOptions || {};
    options.modules = 'instantiate';
    options.script = false;
    options.sourceMaps = 'inline';
    options.filename = load.address;
    options.inputSourceMap = load.metadata.sourceMap;

    var compiler = new transpilerModule.Compiler(options);
    var source = doTraceurCompile(load.source, compiler, options.filename);

    // add "!eval" to end of Traceur sourceURL
    // I believe this does something?
    source += '!eval';

    return source;
  }
  function doTraceurCompile(source, compiler, filename) {
    try {
      return compiler.compile(source, filename);
    }
    catch(e) {
      // traceur throws an error array
      throw e[0];
    }
  }

  function babelTranspile(load) {
    var options = this.babelOptions || {};
    options.modules = 'system';
    options.sourceMap = 'inline';
    options.filename = load.address;
    options.code = true;
    options.ast = false;
    options.blacklist = options.blacklist || [];
    options.blacklist.push('react');

    var source = transpilerModule.transform(load.source, options).code;

    // add "!eval" to end of Babel sourceURL
    // I believe this does something?
    return source + '\n//# sourceURL=' + load.address + '!eval';
  }


})(__global.LoaderPolyfill);
{'fraction_non_alphanumeric': 0.12337164750957855, 'fraction_numerical': 0.0003831417624521073, 'mean_word_length': 2.952308856926571, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1257260', 'n_tokens_mistral': 1587, 'n_tokens_neox': 1535, 'n_words': 369}