<commit_before>class Impl {
    static modules = {};

    // returns true if the running host supports wasm modules (all browsers except IE)
    static wasmSupported() {
        let supported = null;

        if (supported === null) {
            supported = (() => {
                try {
                    if (typeof WebAssembly === "object" && typeof WebAssembly.instantiate === "function") {
                        const module = new WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00));
                        if (module instanceof WebAssembly.Module)
                            return new WebAssembly.Instance(module) instanceof WebAssembly.Instance;
                    }
                } catch (e) { }
                return false;
            })();
        }

        return supported;
    }

    // load a script
    static loadScript(url, callback) {
        const s = document.createElement('script');<commit_msg>Cache wasm support test correctly (#4452)<commit_after>// wrapper function that caches the func result on first invocation and
// then subsequently returns the cached value
const cachedResult = (func) => {
    const uninitToken = {};
    let result = uninitToken;
    return () => {
        if (result === uninitToken) {
            result = func();
        }
        return result;
    };
};

class Impl {
    static modules = {};

    // returns true if the running host supports wasm modules (all browsers except IE)
    static wasmSupported = cachedResult(() => {
        try {
            if (typeof WebAssembly === "object" && typeof WebAssembly.instantiate === "function") {
                const module = new WebAssembly.Module(Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00));
                if (module instanceof WebAssembly.Module)
                    return new WebAssembly.Instance(module) instanceof WebAssembly.Instance;
            }
        } catch (e) { }
        return false;
    });

    // load a script
    static loadScript(url, callback) {
        const s = document.createElement('script');
{'fraction_non_alphanumeric': 0.10531354715174725, 'fraction_numerical': 0.023934897079942556, 'mean_word_length': 1.9772079772079771, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1323991', 'n_tokens_mistral': 583, 'n_tokens_neox': 531, 'n_words': 168}