<commit_before>// ## Simple JavaScript Inheritance
// - By <NAME> http://ejohn.org/
// - MIT Licensed.
/* class.js */

// Inspired by base2 and Prototype
(function () {
	var initializing = false,
		fnTest = (/xyz/).test(function () {
			var xyz;
		}) ? (/\bsup\b/) : (/.*/);

	// The base Class implementation (does nothing)
	this.Class = function () {};

	// Create a new Class that inherits from this class
	Class.extend = function extend(prop) {
		var sup = this.prototype,
		    This = this,
		    prototype, name, tmp, ret, func;

		// Instantiate a base class (but only create the instance,
		// don't run the init constructor)
		initializing = true;
		prototype = new This();
		initializing = false;

		// Copy the properties over onto the new prototype
		for (name in prop) {			
			if (prop.hasOwnProperty(name)) {
				func = prop[name];

				// Check if we're overwriting an existing function
				prototype[name] = (typeof func === "function") && (typeof sup[name] === "function") && fnTest.test(func) ? (function (name, fn) {
					return function () {
						tmp = this.sup;

						// Add a new .sup() method that is the same method
						// but on the super-class
						this.sup = sup[name];

						// The method only need to be bound temporarily, so we
						// remove it when we're done executing
						ret = fn.apply(this, arguments);
						this.sup = tmp;

						return ret;
					};
				}(name, func)) : func;
			}
		}

		prototype.vars = $.extend(true, {}, this.prototype.vars, prototype.vars); // inherit vars

		// The dummy class constructor
		function Class(vars) {

			if (vars) {
				$.extend(true, this.vars, vars); // override this.vars object with passed argument
			}
			
			// All construction is actually done in the init method
			if (!initializing && this.init) {
				this.init.apply(this, arguments);
			}<commit_msg>fixed vars inhertiance through multiple rosy-class inherits<commit_after>// ## Simple JavaScript Inheritance
// - By <NAME> http://ejohn.org/
// - MIT Licensed.
/* class.js */

// Inspired by base2 and Prototype
(function () {
	var initializing = false,
		fnTest = (/xyz/).test(function () {
			var xyz;
		}) ? (/\bsup\b/) : (/.*/);

	// The base Class implementation (does nothing)
	this.Class = function () {};

	// Create a new Class that inherits from this class
	Class.extend = function extend(prop) {
		var sup = this.prototype,
		    This = this,
		    prototype, name, tmp, ret, func;

		// Instantiate a base class (but only create the instance,
		// don't run the init constructor)
		initializing = true;
		prototype = new This();
		initializing = false;

		// Copy the properties over onto the new prototype
		for (name in prop) {			
			if (prop.hasOwnProperty(name)) {
				func = prop[name];

				// Check if we're overwriting an existing function
				prototype[name] = (typeof func === "function") && (typeof sup[name] === "function") && fnTest.test(func) ? (function (name, fn) {
					return function () {
						tmp = this.sup;

						// Add a new .sup() method that is the same method
						// but on the super-class
						this.sup = sup[name];

						// The method only need to be bound temporarily, so we
						// remove it when we're done executing
						ret = fn.apply(this, arguments);
						this.sup = tmp;

						return ret;
					};
				}(name, func)) : func;
			}
		}

		prototype.vars = $.extend(true, {}, this.prototype.vars, prototype.vars); // inherit vars

		// The dummy class constructor
		function Class(vars) {

			this.vars = $.extend(true, {}, this.vars, vars); // override this.vars object with passed argument
			
			// All construction is actually done in the init method
			if (!initializing && this.init) {
				this.init.apply(this, arguments);
			}
{'fraction_non_alphanumeric': 0.13708165997322624, 'fraction_numerical': 0.000535475234270415, 'mean_word_length': 2.623666343355965, 'pattern_counts': {'":': 0, '<': 5, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5902365', 'n_tokens_mistral': 1347, 'n_tokens_neox': 1098, 'n_words': 389}