<commit_before>/**
 * @license MPL 1.1/GPL 2.0/LGPL 2.1, see license.txt
 * @author <NAME> <<EMAIL>>
 * @copyright 2011 JSONovich Team. All Rights Reserved.
 * @copyright Portions (C) 2009, 2010 the Mozilla Foundation.
 * @description This file contains the JSONovich bootstrap for older Gecko browsers.
 * @todo When dropping Gecko 1.9.1/Firefox 3.5 support, remove emulation of XPCOMUtils lazy getters.
 * @todo When dropping Gecko 1.9.2/Firefox 3.6 support, all this code becomes unnecessary.
 *
 * Changelog:
 * [2011-05] - Created FF4 legacy bootstrap for JSONovich extension
 */

const ADDON_NAME = 'JSONovich';
const ADDON_LNAME = 'jsonovich';
const ADDON_DOMAIN = 'lackoftalent.org';
const IN_CHROME = true;
const IN_CONTENT = true; // no process separation or message manager
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cm = Components.manager;
const Cr = Components.results;
const Cu = Components.utils;

var TS = {
    'Bootstrap': [Date.now()]
};
var electrolyte = null;
var getResourceURI = null;

Cu['import']("resource://gre/modules/XPCOMUtils.jsm");

function getResourceURISpec(path) {
    return getResourceURI(path).spec;
}

if(!XPCOMUtils.defineLazyGetter) { // emulate XPCOMUtils.defineLazyGetter (introduced in Gecko 1.9.2/FF3.6)
    // @see http://hg.mozilla.org/mozilla-central/diff/f2ebd467b1cd/js/src/xpconnect/loader/XPCOMUtils.jsm
    XPCOMUtils.defineLazyGetter = function XPCU_defineLazyGetter(aObject, aName, aLambda) {
        aObject.__defineGetter__(aName, function() {
            delete aObject[aName];
            return aObject[aName] = aLambda.apply(aObject);
        });
    }
}
if(!XPCOMUtils.defineLazyServiceGetter) { // emulate XPCOMUtils.defineLazyServiceGetter (introduced in Gecko 1.9.2/FF3.6)
    // @see http://hg.mozilla.org/mozilla-central/diff/acb4f43ba5ab/js/src/xpconnect/loader/XPCOMUtils.jsm
    XPCOMUtils.defineLazyServiceGetter = function XPCU_defineLazyServiceGetter(aObject, aName, aContract, aInterfaceName) {
        XPCOMUtils.defineLazyGetter(aObject, aName, function XPCU_serviceLambda() {
            return Cc[aContract].getService(Ci[aInterfaceName]);
        });
    }
}
let Services = {}; // emulate Services.jsm (introduced in Gecko 2/FF4)
// @see http://hg.mozilla.org/mozilla-central/diff/365acfca64dc/toolkit/content/Services.jsm
XPCOMUtils.defineLazyServiceGetter(Services, "scriptloader", "@mozilla.org/moz/jssubscript-loader;1", "mozIJSSubScriptLoader");
// @see http://hg.mozilla.org/mozilla-central/diff/78e5543c0bc4/toolkit/content/Services.jsm
XPCOMUtils.defineLazyServiceGetter(Services, "obs", "@mozilla.org/observer-service;1", "nsIObserverService");
XPCOMUtils.defineLazyServiceGetter(Services, "io", "@mozilla.org/network/io-service;1", "nsIIOService2");

function startup() {
    electrolyte = {};
    Services.scriptloader.loadSubScript(getResourceURISpec('modules/electrolyte.js'), electrolyte);
    if(electrolyte.startup) {
        electrolyte.startup();
    }
}

function uninstall() {
    if(electrolyte.uninstall) {<commit_msg>Fixed missing emulation of some Services.jsm features in pre-Gecko2 browsers.<commit_after>/**
 * @license MPL 1.1/GPL 2.0/LGPL 2.1, see license.txt
 * @author <NAME> <<EMAIL>>
 * @copyright 2011 JSONovich Team. All Rights Reserved.
 * @copyright Portions (C) 2009, 2010 the Mozilla Foundation.
 * @description This file contains the JSONovich bootstrap for older Gecko browsers.
 * @todo When dropping Gecko 1.9.1/Firefox 3.5 support, remove emulation of XPCOMUtils lazy getters.
 * @todo When dropping Gecko 1.9.2/Firefox 3.6 support, all this code becomes unnecessary.
 *
 * Changelog:
 * [2011-05] - Created FF4 legacy bootstrap for JSONovich extension
 */

const ADDON_NAME = 'JSONovich';
const ADDON_LNAME = 'jsonovich';
const ADDON_DOMAIN = 'lackoftalent.org';
const IN_CHROME = true;
const IN_CONTENT = true; // no process separation or message manager
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cm = Components.manager;
const Cr = Components.results;
const Cu = Components.utils;

var TS = {
    'Bootstrap': [Date.now()]
};
var electrolyte = null;
var getResourceURI = null;

Cu['import']("resource://gre/modules/XPCOMUtils.jsm");

function getResourceURISpec(path) {
    return getResourceURI(path).spec;
}

if(!XPCOMUtils.defineLazyGetter) { // emulate XPCOMUtils.defineLazyGetter (introduced in Gecko 1.9.2/FF3.6)
    // @see http://hg.mozilla.org/mozilla-central/diff/f2ebd467b1cd/js/src/xpconnect/loader/XPCOMUtils.jsm
    XPCOMUtils.defineLazyGetter = function XPCU_defineLazyGetter(aObject, aName, aLambda) {
        aObject.__defineGetter__(aName, function() {
            delete aObject[aName];
            return aObject[aName] = aLambda.apply(aObject);
        });
    }
}
if(!XPCOMUtils.defineLazyServiceGetter) { // emulate XPCOMUtils.defineLazyServiceGetter (introduced in Gecko 1.9.2/FF3.6)
    // @see http://hg.mozilla.org/mozilla-central/diff/acb4f43ba5ab/js/src/xpconnect/loader/XPCOMUtils.jsm
    XPCOMUtils.defineLazyServiceGetter = function XPCU_defineLazyServiceGetter(aObject, aName, aContract, aInterfaceName) {
        XPCOMUtils.defineLazyGetter(aObject, aName, function XPCU_serviceLambda() {
            return Cc[aContract].getService(Ci[aInterfaceName]);
        });
    }
}
let Services = {}; // emulate Services.jsm (introduced in Gecko 2/FF4)
// @see http://hg.mozilla.org/mozilla-central/diff/365acfca64dc/toolkit/content/Services.jsm
XPCOMUtils.defineLazyGetter(Services, "appinfo", function () {
    return Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo).QueryInterface(Ci.nsIXULRuntime);
});
XPCOMUtils.defineLazyServiceGetter(Services, "vc", "@mozilla.org/xpcom/version-comparator;1", "nsIVersionComparator");
XPCOMUtils.defineLazyServiceGetter(Services, "scriptloader", "@mozilla.org/moz/jssubscript-loader;1", "mozIJSSubScriptLoader");
// @see http://hg.mozilla.org/mozilla-central/diff/78e5543c0bc4/toolkit/content/Services.jsm
XPCOMUtils.defineLazyServiceGetter(Services, "obs", "@mozilla.org/observer-service;1", "nsIObserverService");
XPCOMUtils.defineLazyServiceGetter(Services, "io", "@mozilla.org/network/io-service;1", "nsIIOService2");

function startup() {
    electrolyte = {};
    Services.scriptloader.loadSubScript(getResourceURISpec('modules/electrolyte.js'), electrolyte);
    if(electrolyte.startup) {
        electrolyte.startup();
    }
}

function uninstall() {
    if(electrolyte.uninstall) {
{'fraction_non_alphanumeric': 0.12871747211895912, 'fraction_numerical': 0.023079306071871128, 'mean_word_length': 4.639301310043668, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '1344749', 'n_tokens_mistral': 2323, 'n_tokens_neox': 2178, 'n_words': 414}