<commit_before>/*
 * Helma License Notice
 *
 * The contents of this file are subject to the Helma License
 * Version 2.0 (the "License"). You may not use this file except in
 * compliance with the License. A copy of the License is available at
 * http://adele.helma.org/download/helma/license.txt
 *
 * Copyright 1998-2006 Helma Software. All Rights Reserved.
 *
 * $RCSfile: Object.js,v $
 * $Author: zumbrunn $
 * $Revision: 8714 $
 * $Date: 2007-12-13 13:21:48 +0100 (Don, 13 Dez 2007) $
 */

module.shared = true;

/**
 * @fileoverview Adds useful methods to the JavaScript Object type.
 */


/**
 * copy the properties of an object into
 * a new object
 * @param Object the source object
 * @param Object the (optional) target object
 * @return Object the resulting object
 */
Object.defineProperty(Object.prototype, "clone", {
    value: function(clone, recursive) {
        if (!clone)
            clone = new this.constructor();
        var value;
        for (var propName in this) {
            value = this[propName];
            if (recursive && value.constructor == Object) {
                clone[propName] = value.clone(new value.constructor(), recursive);
            } else {
                clone[propName] = value;
            }
        }
        return clone;
    }
});


/**
 * Creates a new object as the as the keywise union of the provided objects.
 * Whenever a key exists in a later object that already existed in an earlier
 * object, the according value of the earlier object takes precedence.
 */
Object.defineProperty(Object.prototype, "merge", {
    value: function() {
        var result = {};
        for (var i = arguments.length; i > 0; --i) {
            var obj = arguments[i - 1];
            for (var property in obj) {
                result[property] = obj[property];
            }<commit_msg>Make merge a static method on the Object constructor instead of an instance method.<commit_after>/*
 * Helma License Notice
 *
 * The contents of this file are subject to the Helma License
 * Version 2.0 (the "License"). You may not use this file except in
 * compliance with the License. A copy of the License is available at
 * http://adele.helma.org/download/helma/license.txt
 *
 * Copyright 1998-2006 Helma Software. All Rights Reserved.
 *
 * $RCSfile: Object.js,v $
 * $Author: zumbrunn $
 * $Revision: 8714 $
 * $Date: 2007-12-13 13:21:48 +0100 (Don, 13 Dez 2007) $
 */

module.shared = true;

/**
 * @fileoverview Adds useful methods to the JavaScript Object type.
 */


/**
 * copy the properties of an object into
 * a new object
 * @param Object the source object
 * @param Object the (optional) target object
 * @return Object the resulting object
 */
Object.defineProperty(Object.prototype, "clone", {
    value: function(clone, recursive) {
        if (!clone)
            clone = new this.constructor();
        var value;
        for (var propName in this) {
            value = this[propName];
            if (recursive && value.constructor == Object) {
                clone[propName] = value.clone(new value.constructor(), recursive);
            } else {
                clone[propName] = value;
            }
        }
        return clone;
    }
});


/**
 * Creates a new object as the as the keywise union of the provided objects.
 * Whenever a key exists in a later object that already existed in an earlier
 * object, the according value of the earlier object takes precedence.
 */
Object.defineProperty(Object, "merge", {
    value: function() {
        var result = {};
        for (var i = arguments.length; i > 0; --i) {
            var obj = arguments[i - 1];
            for (var property in obj) {
                result[property] = obj[property];
            }
{'fraction_non_alphanumeric': 0.10723860589812333, 'fraction_numerical': 0.021447721179624665, 'mean_word_length': 2.422935779816514, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1167155', 'n_tokens_mistral': 1092, 'n_tokens_neox': 1006, 'n_words': 397}