<commit_before>class EventGroup {
    private static _uniqueId = 0;
    private _parent;
    private _eventRecords: any[];
    private _id = EventGroup._uniqueId++;

    public constructor(parent: any) {
        this._parent = parent;
        this._eventRecords = [];
    }

    public dispose() {
        this.off();
        this._parent = null;
    }

    public on(target: any, eventName: string, callback: (args ? : any) => void) {

        if (eventName.indexOf(',') > -1) {
            var events = eventName.split(/[ ,]+/);

            for (var i = 0; i < events.length; i++) {
                this.on(target, events[i], callback);
            }
        } else {
            var parent = this._parent;
            var eventRecord = {
                target: target,
                eventName: eventName,
                parent: parent,
                callback: callback,
                elementCallback: null
            };

            // Initialize and wire up the record on the target, so that it can call the callback if the event fires.
            target.__events__ = target.__events__ || {};
            target.__events__[eventName] = target.__events__[eventName] || {
                count: 0
            };
            target.__events__[eventName][this._id] = target.__events__[eventName][this._id] || [];
            target.__events__[eventName][this._id].push(eventRecord);
            target.__events__[eventName].count++;

            if (_isElement(target)) {
                eventRecord.elementCallback = _processElementEvent;
                target.addEventListener(eventName, _processElementEvent);
            }

            // Remember the record locally, so that it can be removed.
            this._eventRecords.push(eventRecord);

            function _processElementEvent() {
                var result = callback.apply(parent, arguments);
                if (result === false && arguments[0] && arguments[0].preventDefault) {
                    var e = arguments[0];

                    e.preventDefault();
                    e.cancelBubble = true;
                }

                return result;
            }
        }
    }

    public off(target ? : any, eventName ? : string, callback ? : (args ? : any) => void) {
        if (true) {

        }

        for (var i = 0; i < this._eventRecords.length; i++) {
            var eventRecord = this._eventRecords[i];
            if ((!target || target === eventRecord.target) &&
                (!eventName || eventName === eventRecord.eventName) &&
                (!callback || callback === eventRecord.callback)) {<commit_msg>Fix error that halts rendering on Firefox due to different hoisting behavior<commit_after>class EventGroup {
    private static _uniqueId = 0;
    private _parent;
    private _eventRecords: any[];
    private _id = EventGroup._uniqueId++;

    public constructor(parent: any) {
        this._parent = parent;
        this._eventRecords = [];
    }

    public dispose() {
        this.off();
        this._parent = null;
    }

    public on(target: any, eventName: string, callback: (args ? : any) => void) {

        if (eventName.indexOf(',') > -1) {
            var events = eventName.split(/[ ,]+/);

            for (var i = 0; i < events.length; i++) {
                this.on(target, events[i], callback);
            }
        } else {
            var parent = this._parent;
            var eventRecord = {
                target: target,
                eventName: eventName,
                parent: parent,
                callback: callback,
                elementCallback: null
            };

            // Initialize and wire up the record on the target, so that it can call the callback if the event fires.
            target.__events__ = target.__events__ || {};
            target.__events__[eventName] = target.__events__[eventName] || {
                count: 0
            };
            target.__events__[eventName][this._id] = target.__events__[eventName][this._id] || [];
            target.__events__[eventName][this._id].push(eventRecord);
            target.__events__[eventName].count++;

            function _processElementEvent() {
                var result = callback.apply(parent, arguments);
                if (result === false && arguments[0] && arguments[0].preventDefault) {
                    var e = arguments[0];

                    e.preventDefault();
                    e.cancelBubble = true;
                }

                return result;
            }

            if (_isElement(target)) {
                eventRecord.elementCallback = _processElementEvent;
                target.addEventListener(eventName, _processElementEvent);
            }

            // Remember the record locally, so that it can be removed.
            this._eventRecords.push(eventRecord);
        }
    }

    public off(target ? : any, eventName ? : string, callback ? : (args ? : any) => void) {
        if (true) {

        }

        for (var i = 0; i < this._eventRecords.length; i++) {
            var eventRecord = this._eventRecords[i];
            if ((!target || target === eventRecord.target) &&
                (!eventName || eventName === eventRecord.eventName) &&
                (!callback || callback === eventRecord.callback)) {
{'fraction_non_alphanumeric': 0.11591466868038512, 'fraction_numerical': 0.0030205776854823484, 'mean_word_length': 1.6893401015228426, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2710653', 'n_tokens_mistral': 1377, 'n_tokens_neox': 1307, 'n_words': 337}