<commit_before>const electron = require('electron');
const app = electron.app;
const fs = require('fs');
const path = require('path');
const url = require('url');

// Mapping between hostname and file path.
var hostPathMap = {};
var hostPathMapNextKey = 0;

var getHostForPath = function(path) {
  var key;
  key = "extension-" + (++hostPathMapNextKey);
  hostPathMap[key] = path;
  return key;
};

var getPathForHost = function(host) {
  return hostPathMap[host];
};

// Cache extensionInfo.
var extensionInfoMap = {};

var getExtensionInfoFromPath = function(srcDirectory) {
  var manifest, page;
  manifest = JSON.parse(fs.readFileSync(path.join(srcDirectory, 'manifest.json')));
  if (extensionInfoMap[manifest.name] == null) {

    // We can not use 'file://' directly because all resources in the extension
    // will be treated as relative to the root in Chrome.
    page = url.format({
      protocol: 'chrome-extension',
      slashes: true,
      hostname: getHostForPath(srcDirectory),
      pathname: manifest.devtools_page
    });
    extensionInfoMap[manifest.name] = {
      startPage: page,
      name: manifest.name,
      srcDirectory: srcDirectory,
      exposeExperimentalAPIs: true
    };
    return extensionInfoMap[manifest.name];
  }
};

// The loaded extensions cache and its persistent path.
var loadedExtensions = null;
var loadedExtensionsPath = null;

app.on('will-quit', function() {
  try {
    loadedExtensions = Object.keys(extensionInfoMap).map(function(key) {
      return extensionInfoMap[key].srcDirectory;
    });
    if (loadedExtensions.length > 0) {
      try {
        fs.mkdirSync(path.dirname(loadedExtensionsPath));
      } catch (error) {
        // Ignore error
      }
      return fs.writeFileSync(loadedExtensionsPath, JSON.stringify(loadedExtensions));
    } else {
      fs.unlinkSync(loadedExtensionsPath);
    }
  } catch (error) {
    // Ignore error
  }<commit_msg>Don't return anything from will-quit handler<commit_after>const electron = require('electron');
const app = electron.app;
const fs = require('fs');
const path = require('path');
const url = require('url');

// Mapping between hostname and file path.
var hostPathMap = {};
var hostPathMapNextKey = 0;

var getHostForPath = function(path) {
  var key;
  key = "extension-" + (++hostPathMapNextKey);
  hostPathMap[key] = path;
  return key;
};

var getPathForHost = function(host) {
  return hostPathMap[host];
};

// Cache extensionInfo.
var extensionInfoMap = {};

var getExtensionInfoFromPath = function(srcDirectory) {
  var manifest, page;
  manifest = JSON.parse(fs.readFileSync(path.join(srcDirectory, 'manifest.json')));
  if (extensionInfoMap[manifest.name] == null) {

    // We can not use 'file://' directly because all resources in the extension
    // will be treated as relative to the root in Chrome.
    page = url.format({
      protocol: 'chrome-extension',
      slashes: true,
      hostname: getHostForPath(srcDirectory),
      pathname: manifest.devtools_page
    });
    extensionInfoMap[manifest.name] = {
      startPage: page,
      name: manifest.name,
      srcDirectory: srcDirectory,
      exposeExperimentalAPIs: true
    };
    return extensionInfoMap[manifest.name];
  }
};

// The loaded extensions cache and its persistent path.
var loadedExtensions = null;
var loadedExtensionsPath = null;

app.on('will-quit', function() {
  try {
    loadedExtensions = Object.keys(extensionInfoMap).map(function(key) {
      return extensionInfoMap[key].srcDirectory;
    });
    if (loadedExtensions.length > 0) {
      try {
        fs.mkdirSync(path.dirname(loadedExtensionsPath));
      } catch (error) {
        // Ignore error
      }
      fs.writeFileSync(loadedExtensionsPath, JSON.stringify(loadedExtensions));
    } else {
      fs.unlinkSync(loadedExtensionsPath);
    }
  } catch (error) {
    // Ignore error
  }
{'fraction_non_alphanumeric': 0.12099276111685625, 'fraction_numerical': 0.001034126163391934, 'mean_word_length': 3.5198598130841123, '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': '4651922', 'n_tokens_mistral': 1154, 'n_tokens_neox': 1128, 'n_words': 286}