<commit_before>function Console() {

}

Console.prototype = {
    LOG: 1,
    WARN: 2,
    ERROR:3,
    log: function(message) {
        print(this.LOG, message);
    },

    warn: function(message) {
        print(this.WARN, message);
    },

    error: function(message) {
        print(this.ERROR, message);
    }
}
console = new Console;


// This projects Point object is a C++ object!!!!
var pt = new Point(6, 1);

pt.mul(2);

console.log("Hurray! Success!");
console.error("Something went wrong");
console.warn("You might be on a cliphanger! watch out");<commit_msg>Lets kick the engine! Adding the shim system classes<commit_after>function Console() {

}

Console.prototype = {
    LOG: 0,
    INFO: 1,
    WARN: 2,
    ERROR:3,
    log: function(message) {
        print(this.LOG, message);
    },

    info: function(message) {
        print(this.INFO, message);
    },

    warn: function(message) {
        print(this.WARN, message);
    },

    error: function(message) {
        print(this.ERROR, message);
    }
}
console = new Console;


function JSM() {
    this._artifacts = {};
}

JSM.prototype = {
    TYPE_EXECUTABLE: 1,
    TYPE_SHARED_LIBRARY: 2,
    TYPE_STATIC_LIBRARY: 3,
    TYPE_ACTION: 4,
    TYPE_CONFIG: 5,
    TYPE_SOURCE_LIST: 6,

    _isString: function(str) {
        return typeof str === 'string' || str instanceof String; 
    },

    _isNumber: function(num) {
        return typeof num === 'number' || num instanceof Number; 
    },

    _toArgumentsObject: function (name, type, depsList, definition) {
        if (arguments.length <= 3) 
            throw 'Requires minimum 3 arguments, ' + arguments.length + ' passed.';
        if (!this._isString(name))
            throw 'Invalid type passed for "name"';

        if (!this._isNumber(type))
            throw 'Invaild type passed for "type"';

        var deps = null;
        if (depsList instanceof Array) {
            deps = depsList;
        } else if (depsList instanceof Function) {
            definition = depsList;
            delete depsList;
            deps = [];
        } else {
            throw "Unknow parameters";
        }

        definition = definition;
        return {
            name: name,
            type: type,
            depsList: deps,
            definition: definition
        };
    },

    library: function(name, type, depsList, libraryDefinition) {
        this._declareArtifact(this._toArgumentsObject(name, type, depsList, libraryDefinition));
    },

    executable: function(name, depsList, executableDefinition) {
        this._declareArtifact(this._toArgumentsObject(name, this.TYPE_EXECUTABLE, depsList, libraryDefinition));
    },

    action: function(name, depsList, actionDefinition) {
        this._declareArtifact(this._toArgumentsObject(name, this.TYPE_ACTION, depsList, libraryDefinition));
    },

    _declareArtifact: function(artifact) {
        console.log(artifact.name);
        console.log(artifact.type);
        console.log(artifact.depsList.join(", "));
        console.log(artifact.definition);
        console.warn('........');
    }
};

var jsm = new JSM();

jsm.library('lib1', jsm.TYPE_STATIC_LIBRARY, function() {});
jsm.library('lib2', jsm.TYPE_STATIC_LIBRARY, ['lib1'], function() {});
{'fraction_non_alphanumeric': 0.13118279569892474, 'fraction_numerical': 0.0064516129032258064, 'mean_word_length': 2.5238095238095237, 'pattern_counts': {'":': 0, '<': 4, '<?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': '6994119', 'n_tokens_mistral': 1028, 'n_tokens_neox': 974, 'n_words': 229}