<commit_before>(function (root) {

    function EventListener() {
        this._ = {};
    }

    EventListener.prototype._on = function (ev, fn) {
        var l = this._[ev] = this._[ev] || [];
        l.push(fn);
        return this;
    };

    EventListener.prototype._emit = function (ev) {
        var self = this
          , args = []
          , event = null
          , l = null
          ;

        if (typeof ev === "object") {
            event = ev.event;
            args = ev.args;
        } else {
            event = ev;
            args = Array.prototype.slice.call(arguments, 1)
        }

        l = this._[event];
        if (!l || !l.length) { return; }

        l.forEach(function (fn) {
            fn.apply(self, args);
        });
    };

    EventListener.prototype.on = EventListener.prototype._on;
    EventListener.prototype.emit = EventListener.prototype._emit;

    var _workers = {};

    function Worky(script, loaded) {

        var self = {};

        if (this.constructor !== Worky && script) {
            return new Worky(script, loaded);
        }

        if (!script) {
            self = Object.create(EventListener.prototype);
        } else {
            self = this;
        }

        EventListener.call(self);
        self.is_worker = !script;

        // We are inside of a worker
        if (!script) {
            root.onmessage = function (ev) {
               debugger
            }; //Worky.receiver.call(self);
            self.emit = Worky.emitter.call(root, true);
            return self;
        }

        // Inside of a window, creating a worker
        self.worker = new Worker(script);
        self.worker.onload = function () {
            debugger
            self._emit("load");
        };
        self.worker.onmessage = Worky.receiver.call(self);
        self.emit = Worky.emitter.call(self.worker, true);
    }

    Worky.receiver = function () {
        var self = this;
        return function (ev) {
            self._emit(ev.data);
        };<commit_msg>Fixed the emit call inside of a worker<commit_after>(function (root) {

    function EventListener() {
        this._ = {};
    }

    EventListener.prototype._on = function (ev, fn) {
        var l = this._[ev] = this._[ev] || [];
        l.push(fn);
        return this;
    };

    EventListener.prototype._emit = function (ev) {
        var self = this
          , args = []
          , event = null
          , l = null
          ;

        if (typeof ev === "object") {
            event = ev.event;
            args = ev.args;
        } else {
            event = ev;
            args = Array.prototype.slice.call(arguments, 1)
        }

        l = this._[event];
        if (!l || !l.length) { return; }

        l.forEach(function (fn) {
            fn.apply(self, args);
        });
    };

    EventListener.prototype.on = EventListener.prototype._on;
    EventListener.prototype.emit = EventListener.prototype._emit;

    var _workers = {};

    function Worky(script, loaded) {

        var self = {};

        if (this.constructor !== Worky && script) {
            return new Worky(script, loaded);
        }

        if (!script) {
            self = Object.create(EventListener.prototype);
        } else {
            self = this;
        }

        EventListener.call(self);
        self.is_worker = !script;

        // We are inside of a worker
        if (!script) {
            root.onmessage = Worky.receiver.call(self);
            self.emit = Worky.emitter.call(root);
            return self;
        }

        // Inside of a window, creating a worker
        self.worker = new Worker(script);
        self.worker.onmessage = Worky.receiver.call(self);
        self.emit = Worky.emitter.call(self.worker);
    }

    Worky.receiver = function () {
        var self = this;
        return function (ev) {
            self._emit(ev.data);
        };
{'fraction_non_alphanumeric': 0.12880921895006403, 'fraction_numerical': 0.0005121638924455825, 'mean_word_length': 1.51513200257566, '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': '1143483', 'n_tokens_mistral': 1134, 'n_tokens_neox': 1085, 'n_words': 250}