<commit_before>﻿(function () {
    "use strict";

    // Event symbol
    const EVENT_SYM = Symbol("events");

    // Enable nodelists to work with the spread operator
    NodeList.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator];

    // Browser constructor
    function Browser() {
        this[EVENT_SYM] = {};
        this.currentUrl = "";
        this.documentTitle = "";
        this.favorites = new Map;
        this.loading = false;
        this.roamingFolder = Windows.Storage.ApplicationData.current.roamingFolder;
    }

    // Simple event management - listen for a particular event
    Browser.prototype.on = function (type, listener) {
        let listeners = this[EVENT_SYM][type] || (this[EVENT_SYM][type] = []);

        if (listeners.indexOf(listener) < 0) {
            listeners.push(listener);
        }
        return this;
    };

    // Simple event management - stop listening for a particular event
    Browser.prototype.off = function (type, listener) {
        let listeners = this[EVENT_SYM][type],
            index = listeners ? listeners.indexOf(listener) : -1;

        if (index > -1) {
            listeners.splice(index, 1);
        }
        return this;
    };

    // Simple event management - trigger a particular event
    Browser.prototype.trigger = function (type) {
        let event = { type };
        let listeners = this[EVENT_SYM][type] || [];

        listeners.forEach((listener) => listener.call(this, event));
        return this;
    };

    let browser = new Browser;

    addEventListener("DOMContentLoaded", function () {
        // Get the UI elements
        this.element = document.querySelector("#browser");
        this.webview = document.querySelector("#WebView");
        this.documentTitle = this.webview.documentTitle;
        this.stopButton = document.querySelector("#stopButton");
        this.forwardButton = document.querySelector("#forwardButton");
        this.backButton = document.querySelector("#backButton");
        this.favButton = document.querySelector("#favButton");
        this.addFavButton = document.querySelector("#addFavButton");
        this.clearFavButton = document.querySelector("#clearFavButton");
        this.settingsButton = document.querySelector("#settingsButton");
        this.clearCacheButton = document.querySelector("#clearCacheButton");
        this.favMenu = document.querySelector("#favMenu");
        this.settingsMenu = document.querySelector("#settingsMenu");
        this.urlInput = document.querySelector("#urlInput");
        this.container = document.querySelector(".container");
        this.favList = document.querySelector("#favorites");
        this.favicon = document.querySelector("#favicon");

        // Set the initial navigation state
        this.forwardButton.disabled = true;<commit_msg>Use property shorthands for Browser.prototype assignments.<commit_after>﻿(function () {
    "use strict";

    // Event symbol
    const EVENT_SYM = Symbol("events");

    // Enable nodelists to work with the spread operator
    NodeList.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator];

    // Browser constructor
    function Browser() {
        this[EVENT_SYM] = {};
        this.currentUrl = "";
        this.documentTitle = "";
        this.favorites = new Map;
        this.loading = false;
        this.roamingFolder = Windows.Storage.ApplicationData.current.roamingFolder;
    }

    Browser.prototype = {
        constructor: Browser,

        // Simple event management - listen for a particular event
        on (type, listener) {
            let listeners = this[EVENT_SYM][type] || (this[EVENT_SYM][type] = []);

            if (listeners.indexOf(listener) < 0) {
                listeners.push(listener);
            }
            return this;
        },

        // Simple event management - stop listening for a particular event
        off (type, listener) {
            let listeners = this[EVENT_SYM][type],
                index = listeners ? listeners.indexOf(listener) : -1;

            if (index > -1) {
                listeners.splice(index, 1);
            }
            return this;
        },

        // Simple event management - trigger a particular event
        trigger (type) {
            let event = { type };
            let listeners = this[EVENT_SYM][type] || [];

            listeners.forEach((listener) => listener.call(this, event));
            return this;
        }
    };

    let browser = new Browser;

    addEventListener("DOMContentLoaded", function () {
        // Get the UI elements
        this.element = document.querySelector("#browser");
        this.webview = document.querySelector("#WebView");
        this.documentTitle = this.webview.documentTitle;
        this.stopButton = document.querySelector("#stopButton");
        this.forwardButton = document.querySelector("#forwardButton");
        this.backButton = document.querySelector("#backButton");
        this.favButton = document.querySelector("#favButton");
        this.addFavButton = document.querySelector("#addFavButton");
        this.clearFavButton = document.querySelector("#clearFavButton");
        this.settingsButton = document.querySelector("#settingsButton");
        this.clearCacheButton = document.querySelector("#clearCacheButton");
        this.favMenu = document.querySelector("#favMenu");
        this.settingsMenu = document.querySelector("#settingsMenu");
        this.urlInput = document.querySelector("#urlInput");
        this.container = document.querySelector(".container");
        this.favList = document.querySelector("#favorites");
        this.favicon = document.querySelector("#favicon");

        // Set the initial navigation state
        this.forwardButton.disabled = true;
{'fraction_non_alphanumeric': 0.12116484659386376, 'fraction_numerical': 0.0013867221355520888, 'mean_word_length': 2.6107634543178975, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '5495369', 'n_tokens_mistral': 1454, 'n_tokens_neox': 1429, 'n_words': 310}