<commit_before>var async = require('async')
var RSVP = require('rsvp')

var transformers = require('../transformers')
var Component = require('../component').Component


exports.CompilerCollection = CompilerCollection
CompilerCollection.prototype = Object.create(transformers.Transformer.prototype)
CompilerCollection.prototype.constructor = CompilerCollection
function CompilerCollection () {
  this.compilers = []
}

CompilerCollection.prototype.addCompiler = function (compiler) {
  this.compilers.push(compiler)
  return this
}

CompilerCollection.prototype.transform = RSVP.denodeify(function (srcDir, destDir, callback) {
  async.eachSeries(this.compilers, function (compiler, compilerCallback) {
    try { // this should go away, or be a domain handler instead
      compiler.compile(srcDir, destDir, function (err) {
        setImmediate(function () { // async to avoid long stack traces
          compilerCallback(err)
        })
      })
    } catch (err) {
      err.message = compiler.constructor.name + ': ' + err.message
      compilerCallback(err)
    }
  }, function (err) {
    callback(err)
  })
})


exports.Compiler = Compiler
Compiler.prototype = Object.create(Component.prototype)
Compiler.prototype.constructor = Compiler
function Compiler () {}<commit_msg>Stop augmenting the error message<commit_after>var async = require('async')
var RSVP = require('rsvp')

var transformers = require('../transformers')
var Component = require('../component').Component


exports.CompilerCollection = CompilerCollection
CompilerCollection.prototype = Object.create(transformers.Transformer.prototype)
CompilerCollection.prototype.constructor = CompilerCollection
function CompilerCollection () {
  this.compilers = []
}

CompilerCollection.prototype.addCompiler = function (compiler) {
  this.compilers.push(compiler)
  return this
}

CompilerCollection.prototype.transform = RSVP.denodeify(function (srcDir, destDir, callback) {
  async.eachSeries(this.compilers, function (compiler, compilerCallback) {
    try { // this should go away, or be a domain handler instead
      compiler.compile(srcDir, destDir, function (err) {
        setImmediate(function () { // async to avoid long stack traces
          compilerCallback(err)
        })
      })
    } catch (err) {
      compilerCallback(err)
    }
  }, function (err) {
    callback(err)
  })
})


exports.Compiler = Compiler
Compiler.prototype = Object.create(Component.prototype)
Compiler.prototype.constructor = Compiler
function Compiler () {}
{'fraction_non_alphanumeric': 0.11142061281337047, 'fraction_numerical': 0.0, 'mean_word_length': 4.337579617834395, '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': '2987257', 'n_tokens_mistral': 667, 'n_tokens_neox': 657, 'n_words': 153}