<commit_before>var path = require('path');
var fs = require('fs');
var dart2jsaas = require('dart2jsaas');

var format = require('util').format;
var areEqual = require('./util').areEqual;
var random = function() {
  return Math.round(Math.random() * 10000);
};

var DART_ADAPTER_TPL = fs.readFileSync(__dirname + '/../static/adapter.dart.tmpl').toString();
var TEMP_DIR = process.env.TMPDIR || process.env.TMP || process.env.TEMP || '/tmp';
var DART_IMPORT = 'import "%s" as %s;';


var initDartUnittest = function(emitter, /* config.files */ files, /* config.basePath */ basePath,
  /* config.karmaDartImports */ customImports, /* config.hostname */ hostname, /* config.port */ port,
  logger, customFileHandlers) {

  var log = logger.create('dart');



  customFileHandlers.push({
    urlRegex: /.*dart.js(\?[0-9]*)?$/,
    handler: function(request, response, fa, fb, basePath) {
      var url = request.url.substr(1);  // Drop the leading slash.

      var filename = (/[^\/]*dart.js(\?[0-9]*)?$/).exec(url)[0];

      var dart2js = dart2jsaas.setupSystem({
        fetcherBaseUrl: 'http://' + hostname + ':' + port + '/' + url.replace(filename, '')
      });

      dart2js(filename.replace(/\.js(\?[0-9]*)?$/, '')).then(function(outjs) {
        response.writeHead(200);
        response.end(outjs);
      }).done();
    }
  });<commit_msg>fix(dart2js): Pass checkedMode option to dart2jsaas<commit_after>var path = require('path');
var fs = require('fs');
var dart2jsaas = require('dart2jsaas');

var format = require('util').format;
var areEqual = require('./util').areEqual;
var random = function() {
  return Math.round(Math.random() * 10000);
};

var DART_ADAPTER_TPL = fs.readFileSync(__dirname + '/../static/adapter.dart.tmpl').toString();
var TEMP_DIR = process.env.TMPDIR || process.env.TMP || process.env.TEMP || '/tmp';
var DART_IMPORT = 'import "%s" as %s;';


var initDartUnittest = function(emitter, /* config.files */ files, /* config.basePath */ basePath,
  /* config.karmaDartImports */ customImports, /* config.hostname */ hostname, /* config.port */ port,
  logger, customFileHandlers, /* config.dart2js */ dart2js) {

  var log = logger.create('dart');

  // Default to true.
  var useDart2JsCheckedMode = dart2js == undefined ?
      true : dart2js.checked == undefined ?
          true : dart2js.checked;

  customFileHandlers.push({
    urlRegex: /.*dart.js(\?[0-9]*)?$/,
    handler: function(request, response, fa, fb, basePath) {
      var url = request.url.substr(1);  // Drop the leading slash.

      var filename = (/[^\/]*dart.js(\?[0-9]*)?$/).exec(url)[0];

      var dart2js = dart2jsaas.setupSystem({
        fetcherBaseUrl: 'http://' + hostname + ':' + port + '/' + url.replace(filename, ''),
        dart2jsCheckedMode: useDart2JsCheckedMode
      });

      dart2js(filename.replace(/\.js(\?[0-9]*)?$/, '')).then(function(outjs) {
        response.writeHead(200);
        response.end(outjs);
      }).done();
    }
  });
{'fraction_non_alphanumeric': 0.19629005059021923, 'fraction_numerical': 0.017537942664418212, 'mean_word_length': 3.4202682563338302, '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': '1941747', 'n_tokens_mistral': 1064, 'n_tokens_neox': 1023, 'n_words': 195}