<commit_before>System.autoLoad = (name, deps, fn) => {
    deps = deps || [];
    deps = deps.map(n => System.normalizeSync(n, name));
    var loadedModules = [];
    var mustWait = false;
    deps.every(mName => {
        const m = System.get(mName);
        if (!m) {
            mustWait = true;
            return false;
        }
        loadedModules.push(m);
    });
    if (mustWait) {
        System.register(name, deps, fn);
        return System.import(name);
    }
    const exports = {};
    const registerExport = (key, value) => {
        if (typeof  key === 'object'){
            Object(key).forEach((k) => exports[k] = key[k]);
            return;
        }
        exports[key] = value;
    };
    const declaration = fn(registerExport, exports);
    if (!declaration.setters || !declaration.execute) {
        throw new TypeError('Invalid Module form for ' + name);
    }
    declaration.setters.forEach((setFn, index) => {
        setFn(loadedModules[index]);
    });
    const output = declaration.execute.call(this);
    if (output) {
        declaration.exports = output;
    }
    const newModule = System.newModule(exports);
    System.set(name, newModule);
    return Promise.resolve(newModule);
};<commit_msg>displaying errors in autoload function<commit_after>System.autoLoad = (name, deps, fn) => {
    deps = deps || [];
    deps = deps.map(n => System.normalizeSync(n, name));
    var loadedModules = [];
    var mustWait = false;
    deps.every(mName => {
        const m = System.get(mName);
        if (!m) {
            mustWait = true;
            return false;
        }
        loadedModules.push(m);
    });

    if (mustWait) {
        System.register(name, deps, fn);
        const p = System.import(name);
        p.catch(console.error.bind(console));
        return p;
    }

    try {
        const exports = {};
        const registerExport = (key, value) => {
            if (typeof  key === 'object') {
                Object(key).forEach((k) => exports[k] = key[k]);
                return;
            }
            exports[key] = value;
        };
        const declaration = fn(registerExport, exports);
        if (!declaration.setters || !declaration.execute) {
            throw new TypeError('Invalid Module form for ' + name);
        }
        declaration.setters.forEach((setFn, index) => {
            setFn(loadedModules[index]);
        });
        const output = declaration.execute.call(this);
        if (output) {
            declaration.exports = output;
        }
        const newModule = System.newModule(exports);
        System.set(name, newModule);
        return Promise.resolve(newModule);
    } catch(err) {
        console.error(err);
        return Promise.reject(err);
    }
};
{'fraction_non_alphanumeric': 0.14150943396226415, 'fraction_numerical': 0.0, 'mean_word_length': 2.019715224534502, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '5290673', 'n_tokens_mistral': 809, 'n_tokens_neox': 814, 'n_words': 173}