<commit_before>//
// This file is part of Honey Require
//
// Copyright (c) 2015 <NAME>
//
// Honey Require is free software: you can redistribute it and/or modify it
// under the terms of the MIT License (MIT).
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// You should have received a copy of the MIT License along with Honey Require.
// If not, see <https://opensource.org/licenses/MIT>.
//
////////////////////////////////////////////////////////////////////////////////

// NOTE The load parameter points to the function, which prepares the
//      environment for each module and runs its code. Scroll down to the end of
//      the file to see the function definition.
(function(load) { 'use strict';

// NOTE Mozilla still sets the wrong fileName property for errors that occur
//      inside an eval call (even with sourceURL). However, the stack
//      contains the correct source, so it can be used to re-threw the error
//      with the correct fileName property.
// WARN Re-throwing an error object will mess up the stack trace and the
//      column number.
    if (typeof (new Error()).fileName == "string") {
        self.addEventListener("error", function(evt) {
            if (evt.error instanceof Error) {
                if (pwd[0]) {
                    evt.preventDefault();
                    throw new evt.error.constructor(evt.error.message, pwd[0].uri, evt.error.lineNumber);
                }
                else {
                    var m = evt.error.stack.match(/^[^\n@]*@([^\n]+):\d+:\d+/);
                    if (m === null) {
                        console.warn("Honey: unable to read file name from stack");
                    }
                    else if (evt.error.fileName != m[1]) {
                        evt.preventDefault();
                        throw new evt.error.constructor(evt.error.message, m[1], evt.error.lineNumber);
                    }
                }
            }
        }, false);
    }

// INFO Current module descriptors
//      pwd[0] contains the descriptor of the currently loaded module,
//      pwd[1] contains the descriptor its parent module and so on.

    var pwd = Array();

// INFO Path parser
//      Older browsers don't support the URL interface, therefore we use an
//      anchor element as parser in that case. Thes breaks web worker support,
//      but we don't care since these browsers also don't support web workers.

    var parser = URL ? new URL(location.href) : document.createElement('A');

// INFO Module cache
//      Contains getter functions for the exports objects of all the loaded
//      modules. The getter for the module 'mymod' is name '$name' to prevent
//      collisions with predefined object properties (see note below).
//      As long as a module has not been loaded the getter is either undefined
//      or contains the module code as a function (in case the module has been
//      pre-loaded in a bundle).
// WARN IE8 supports defineProperty only for DOM objects, therfore we use a
//      HTMLDivElement as cache in that case. This breaks web worker support,
//      but we don't care since IE8 has no web workers at all.

    try {
        var cache = new Object();
        Object.defineProperty(cache, "foo", {'value':"bar",'configurable':true});
        delete cache.foo;
    }
    catch (e) {
        console.warn("Honey: falling back to DOM workaround for defineProperty ("+e+")");
        cache = document.createElement('DIV');
    }

// INFO Send lock
//      Sending the request causes the event loop to continue. Therefore
//      pending AJAX load events for the same url might be executed before
//      the synchronous onLoad is called. This should be no problem, but in
//      Chrome the responseText of the sneaked in load events will be empty.
//      Therefore we have to lock the loading while executing send().

    var lock = new Object();

// INFO Honey options
//      The values can be set by defining a object called Honey. The<commit_msg>latest version of honey-require<commit_after>//
// This file is part of Honey Require
//
// Copyright (c) 2015 <NAME>
//
// Honey Require is free software: you can redistribute it and/or modify it
// under the terms of the MIT License (MIT).
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// You should have received a copy of the MIT License along with Honey Require.
// If not, see <https://opensource.org/licenses/MIT>.
//
////////////////////////////////////////////////////////////////////////////////

// NOTE The load parameter points to the function, which prepares the
//      environment for each module and runs its code. Scroll down to the end of
//      the file to see the function definition.
(function(load) { 'use strict';

// NOTE Mozilla still sets the wrong fileName property for errors that occur
//      inside an eval call (even with sourceURL). However, the stack
//      contains the correct source, so it can be used to re-threw the error
//      with the correct fileName property.
// WARN Re-throwing an error object will mess up the stack trace and the
//      column number.
    if (typeof (new Error()).fileName == "string") {
        self.addEventListener("error", function(evt) {
            if (evt.error instanceof Error) {
                if (pwd[0]) {
                    evt.preventDefault();
                    throw new evt.error.constructor(evt.error.message, pwd[0].uri, evt.error.lineNumber);
                }
                else {
                    var m = evt.error.stack.match(/^[^\n@]*@([^\n]+):\d+:\d+/);
                    if (m === null) {
                        console.warn("Honey: unable to read file name from stack");
                    }
                    else if (evt.error.fileName != m[1]) {
                        evt.preventDefault();
                        throw new evt.error.constructor(evt.error.message, m[1], evt.error.lineNumber);
                    }
                }
            }
        }, false);
    }

// INFO Current module descriptors
//      pwd[0] contains the descriptor of the currently loaded module,
//      pwd[1] contains the descriptor its parent module and so on.

    var pwd = Array();

// INFO Path parser
//      Older browsers don't support the URL interface, therefore we use an
//      anchor element as parser in that case. Thes breaks web worker support,
//      but we don't care since these browsers also don't support web workers.

    try {
        var parser = new URL(location.href);
    }
    catch (e) {
        console.warn("Honey: falling back to DOM workaround for URL parser ("+e+")");
        parser = document.createElement('A');
    }

// INFO Module cache
//      Contains getter functions for the exports objects of all the loaded
//      modules. The getter for the module 'mymod' is name '$name' to prevent
//      collisions with predefined object properties (see note below).
//      As long as a module has not been loaded the getter is either undefined
//      or contains the module code as a function (in case the module has been
//      pre-loaded in a bundle).
// WARN IE8 supports defineProperty only for DOM objects, therfore we use a
//      HTMLDivElement as cache in that case. This breaks web worker support,
//      but we don't care since IE8 has no web workers at all.

    try {
        var cache = new Object();
        Object.defineProperty(cache, "foo", {'value':"bar",'configurable':true});
        delete cache.foo;
    }
    catch (e) {
        console.warn("Honey: falling back to DOM workaround for cache object ("+e+")");
        cache = document.createElement('DIV');
    }

// INFO Send lock
//      Sending the request causes the event loop to continue. Therefore
//      pending AJAX load events for the same url might be executed before
//      the synchronous onLoad is called. This should be no problem, but in
//      Chrome the responseText of the sneaked in load events will be empty.
//      Therefore we have to lock the loading while executing send().

    var lock = new Object();

// INFO Honey options
//      The values can be set by defining a object called Honey. The
{'fraction_non_alphanumeric': 0.1083000443852641, 'fraction_numerical': 0.002663115845539281, 'mean_word_length': 2.15913073957238, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '6630446', 'n_tokens_mistral': 2304, 'n_tokens_neox': 2211, 'n_words': 1082}