<commit_before>export default function subscribeMixin (target) {

    // TODO: temporarily commenting out use of ES6 Set due to apparent traceur bug on iOS8 mobile safari
    // need to diagnose further and report to traceur if confirmed

    // var listeners = new Set();
    var listeners = [];

    return Object.assign(target, {

        subscribe(listener) {
            // listeners.add(listener);
            listeners.push(listener);
        },

        unsubscribe(listener) {
            // listeners.delete(listener);
            var index = listeners.indexOf(listener);
            if (index > -1) {
                listeners.splice(index, 1);
            }
        },

        unsubscribeAll() {
            // listeners.clear();
            listeners = [];
        },
        unsubscribeAll() {
            listeners.clear();
        },
        trigger(event, ...data) {
            for (var listener of listeners) {
                if (typeof listener[event] === 'function') {
                    listener[event](...data);
                }
            }
        }

    });

}
<commit_msg>fix merge<commit_after>export default function subscribeMixin (target) {

    // TODO: temporarily commenting out use of ES6 Set due to apparent traceur bug on iOS8 mobile safari
    // need to diagnose further and report to traceur if confirmed

    // var listeners = new Set();
    var listeners = [];

    return Object.assign(target, {

        subscribe(listener) {
            // listeners.add(listener);
            listeners.push(listener);
        },

        unsubscribe(listener) {
            // listeners.delete(listener);
            var index = listeners.indexOf(listener);
            if (index > -1) {
                listeners.splice(index, 1);
            }
        },

        unsubscribeAll() {
            // listeners.clear();
            listeners = [];
        },

        trigger(event, ...data) {
            for (var listener of listeners) {
                if (typeof listener[event] === 'function') {
                    listener[event](...data);
                }
            }
        }

    });

}

{'fraction_non_alphanumeric': 0.11376404494382023, 'fraction_numerical': 0.003745318352059925, 'mean_word_length': 1.4964953271028036, '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': '6839932', 'n_tokens_mistral': 541, 'n_tokens_neox': 514, 'n_words': 139}