<commit_before>function call(target: any, type: string, listener: EventListener, standard: string, fallback: string): boolean {
    let standardFn: any = target[standard];
    let fallbackFn: any = target[fallback];

    if (standardFn !== undefined) {
        standardFn(type, listener);
        return true;
    } else if (fallbackFn !== undefined) {
        fallbackFn(`on${type}`, listener);
        return true;
    } else {
        return false;
    }
}

function createEvent(type: string): Event {
    if (typeof(Event) === 'function') {
        return new Event(type);
    } else {
        let event: Event = document.createEvent('Event');
        event.initEvent(type, false, false);
        return event;
    }<commit_msg>Correct event listener call context<commit_after>function call(target: any, type: string, listener: EventListener, standard: string, fallback: string): boolean {
    let standardFn: any = target[standard];
    let fallbackFn: any = target[fallback];

    if (typeof standardFn === 'function') {
        standardFn.call(target, type, listener);
        return true;
    } else if (typeof fallbackFn === 'function') {
        fallbackFn.call(target, `on${type}`, listener);
        return true;
    } else {
        return false;
    }
}

function createEvent(type: string): Event {
    if (typeof(Event) === 'function') {
        return new Event(type);
    } else {
        let event: Event = document.createEvent('Event');
        event.initEvent(type, false, false);
        return event;
    }
{'fraction_non_alphanumeric': 0.12958115183246074, 'fraction_numerical': 0.0, 'mean_word_length': 2.950904392764858, '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': '1819274', 'n_tokens_mistral': 429, 'n_tokens_neox': 424, 'n_words': 124}