<commit_before>var importObject = {
  imports: {
    imported_func: function(arg) {
      console.log(arg);
    }
  }
};

onmessage = function(e) {
  console.log('module received from main thread');
  var mod = e.data;

  WebAssembly.instantiate(mod, importObject).then(function(instance) {
    instance.exports.exported_func();
  });

  var exports = WebAssembly.Module.exports(mod);
  console.log(exports[0]);
};<commit_msg>Update wasm_worker.js<commit_after>const importObject = {
  imports: {
    imported_func: arg => {
      console.log(arg);
    }
  }
};

window.onmessage = function(event) {
  console.log("module received from main thread");
  const module = event.data;

  WebAssembly.instantiate(module, importObject)
    .then(instance => {
      instance.exports.exported_func();
    });

  const exports = WebAssembly.Module.exports(module);
  console.log(exports[0]);
};
{'fraction_non_alphanumeric': 0.14463276836158193, 'fraction_numerical': 0.0022598870056497176, 'mean_word_length': 3.8950276243093924, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1758894', 'n_tokens_mistral': 286, 'n_tokens_neox': 283, 'n_words': 48}