<commit_before>/**
 * Sinon core utilities. For internal use only.
 *
 * @author <NAME> (<EMAIL>)
 * @license BSD
 *
 * Copyright (c) 2010-2013 <NAME>
 */
"use strict";

var match = require("./sinon/match");
var deepEqual = require("./sinon/util/core/deep-equal");
var deprecated = require("./sinon/util/core/deprecated");
var objectKeys = require("./sinon/util/core/object-keys");

function exposeCoreUtils(target, utils) {
    var keys = objectKeys(utils);
    for (var i = 0; i < keys.length; i++) {
        var key = keys[i];
        var value = utils[key];

        // allow deepEqual to check equality of matchers through dependency injection. Otherwise we get a circular
        // dependency
        if (key === "deepEqual") {
            value = deepEqual.use(match);
        }
        if (typeof value === "function") {
            value = deprecated.wrap(value, deprecated.defaultMsg(key));
        }
        target[key] = value;
    }
}

function exposeEventTarget(target, eventTarget) {
    var keys = objectKeys(eventTarget);
    for (var i = 0; i < keys.length; i++) {
        var key = keys[i];
        target[key] = deprecated.wrap(eventTarget[key], deprecated.defaultMsg("EventTarget"));
    }
}

// Expose internal utilities on `sinon` global for backwards compatibility.
exposeCoreUtils(exports, require("./sinon/util/core/index"));

exports.assert = require("./sinon/assert");
exports.collection = require("./sinon/collection");
exports.match = match;
exports.spy = require("./sinon/spy");
exports.spyCall = require("./sinon/call");
exports.stub = require("./sinon/stub");
exports.mock = require("./sinon/mock");
exports.sandbox = require("./sinon/sandbox");
exports.expectation = require("./sinon/mock-expectation");
exports.createStubInstance = require("./sinon/stub").createStubInstance;

var fakeTimers = require("./sinon/util/fake_timers");
exports.useFakeTimers = fakeTimers.useFakeTimers;
exports.clock = fakeTimers.clock;
exports.timers = fakeTimers.timers;

var event = require("./sinon/util/event");
exports.Event = deprecated.wrap(event.Event, deprecated.defaultMsg("Event"));
exports.CustomEvent = deprecated.wrap(event.CustomEvent, deprecated.defaultMsg("CustomEvent"));
exports.ProgressEvent = deprecated.wrap(event.ProgressEvent, deprecated.defaultMsg("ProgressEvent"));
exports.EventTarget = {};
exposeEventTarget(exports.EventTarget, event.EventTarget);

var fakeXdr = require("./sinon/util/fake_xdomain_request");
exports.xdr = fakeXdr.xdr;
exports.FakeXDomainRequest = fakeXdr.FakeXDomainRequest;
exports.useFakeXDomainRequest = fakeXdr.useFakeXDomainRequest;

var fakeXhr = require("./sinon/util/fake_xml_http_request");
exports.xhr = fakeXhr.xhr;
exports.FakeXMLHttpRequest = fakeXhr.FakeXMLHttpRequest;
exports.useFakeXMLHttpRequest = fakeXhr.useFakeXMLHttpRequest;

exports.fakeServer = require("./sinon/util/fake_server");
exports.fakeServerWithClock = require("./sinon/util/fake_server_with_clock");
<commit_msg>Remove XDR from exports<commit_after>/**
 * Sinon core utilities. For internal use only.
 *
 * @author <NAME> (<EMAIL>)
 * @license BSD
 *
 * Copyright (c) 2010-2013 <NAME>
 */
"use strict";

var match = require("./sinon/match");
var deepEqual = require("./sinon/util/core/deep-equal");
var deprecated = require("./sinon/util/core/deprecated");
var objectKeys = require("./sinon/util/core/object-keys");

function exposeCoreUtils(target, utils) {
    var keys = objectKeys(utils);
    for (var i = 0; i < keys.length; i++) {
        var key = keys[i];
        var value = utils[key];

        // allow deepEqual to check equality of matchers through dependency injection. Otherwise we get a circular
        // dependency
        if (key === "deepEqual") {
            value = deepEqual.use(match);
        }
        if (typeof value === "function") {
            value = deprecated.wrap(value, deprecated.defaultMsg(key));
        }
        target[key] = value;
    }
}

function exposeEventTarget(target, eventTarget) {
    var keys = objectKeys(eventTarget);
    for (var i = 0; i < keys.length; i++) {
        var key = keys[i];
        target[key] = deprecated.wrap(eventTarget[key], deprecated.defaultMsg("EventTarget"));
    }
}

// Expose internal utilities on `sinon` global for backwards compatibility.
exposeCoreUtils(exports, require("./sinon/util/core/index"));

exports.assert = require("./sinon/assert");
exports.collection = require("./sinon/collection");
exports.match = match;
exports.spy = require("./sinon/spy");
exports.spyCall = require("./sinon/call");
exports.stub = require("./sinon/stub");
exports.mock = require("./sinon/mock");
exports.sandbox = require("./sinon/sandbox");
exports.expectation = require("./sinon/mock-expectation");
exports.createStubInstance = require("./sinon/stub").createStubInstance;

var fakeTimers = require("./sinon/util/fake_timers");
exports.useFakeTimers = fakeTimers.useFakeTimers;
exports.clock = fakeTimers.clock;
exports.timers = fakeTimers.timers;

var event = require("./sinon/util/event");
exports.Event = deprecated.wrap(event.Event, deprecated.defaultMsg("Event"));
exports.CustomEvent = deprecated.wrap(event.CustomEvent, deprecated.defaultMsg("CustomEvent"));
exports.ProgressEvent = deprecated.wrap(event.ProgressEvent, deprecated.defaultMsg("ProgressEvent"));
exports.EventTarget = {};
exposeEventTarget(exports.EventTarget, event.EventTarget);

var fakeXhr = require("./sinon/util/fake_xml_http_request");
exports.xhr = fakeXhr.xhr;
exports.FakeXMLHttpRequest = fakeXhr.FakeXMLHttpRequest;
exports.useFakeXMLHttpRequest = fakeXhr.useFakeXMLHttpRequest;

exports.fakeServer = require("./sinon/util/fake_server");
exports.fakeServerWithClock = require("./sinon/util/fake_server_with_clock");

{'fraction_non_alphanumeric': 0.15180132913606156, 'fraction_numerical': 0.003497726477789437, 'mean_word_length': 4.354868913857678, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '1244043', 'n_tokens_mistral': 1766, 'n_tokens_neox': 1729, 'n_words': 346}