<commit_before>const AST = require("./ast.js")
const path = require("path")
const utils = require("./utils")
const logger = require("../logger")

let tabs = "";
let numTabs = 0;

const context = {
	currSourceFile: null,
	compileIndex: 0,
	flags: null
};

const requirements = {
	inherits: false
};

const clsCtx = {
	inside: false,
	insideConstr: false,
	id: null,
	superCls: null
};

function genRequirementResult(modulesPath)
{
	return `(function(scope) {
	scope.module = { exports: {} };
	scope.modules = {};
	scope.modulesCached = {};
	scope.modulesPath = ${modulesPath};
	scope.process = {
		env: {
			NODE_ENV: "dev"
		}
	};

	scope._inherits = function(a, b)
	{
		var protoA = a.prototype;
		var proto = Object.create(b.prototype);

		for(var key in protoA)
		{
			var param = Object.getOwnPropertyDescriptor(protoA, key);
			if(param.get || param.set) {
				Object.defineProperty(proto, key, param);
			}
			else {
				proto[key] = protoA[key];
			}
		}

		a.prototype = proto;
		a.prototype.constructor = a;

		if(b.__inherit === undefined) {
			b.__inherit = {};
		}

		b.__inherit[a.name] = a;
	}
})(window || global);\n\n`;
}

function genModulePaths()
{
	let result = "";

	const modules = context.flags.modules;
	for(const key in modules)
	{
		const module = modules[key];
<commit_msg>Update inherit function that all parents are informed about child.<commit_after>const AST = require("./ast.js")
const path = require("path")
const utils = require("./utils")
const logger = require("../logger")

let tabs = "";
let numTabs = 0;

const context = {
	currSourceFile: null,
	compileIndex: 0,
	flags: null
};

const requirements = {
	inherits: false
};

const clsCtx = {
	inside: false,
	insideConstr: false,
	id: null,
	superCls: null
};

function genRequirementResult(modulesPath)
{
	return `(function(scope) {
	scope.module = { exports: {} };
	scope.modules = {};
	scope.modulesCached = {};
	scope.modulesPath = ${modulesPath};
	scope.process = {
		env: {
			NODE_ENV: "dev"
		}
	};

	scope._inherits = function(a, b)
	{
		var protoA = a.prototype;
		var proto = Object.create(b.prototype);

		for(var key in protoA)
		{
			var param = Object.getOwnPropertyDescriptor(protoA, key);
			if(param.get || param.set) {
				Object.defineProperty(proto, key, param);
			}
			else {
				proto[key] = protoA[key];
			}
		}

		a.prototype = proto;
		a.prototype.constructor = a;
		a.__parent = b;

		if(b.__inherit === undefined) {
			b.__inherit = {};
		}

		b.__inherit[a.name] = a;

		var parent = b.__parent;
		while(parent)
		{
			parent.__inherit[a.name] = a;
			parent = parent.__parent;
		}
	}
})(window || global);\n\n`;
}

function genModulePaths()
{
	let result = "";

	const modules = context.flags.modules;
	for(const key in modules)
	{
		const module = modules[key];

{'fraction_non_alphanumeric': 0.15738411785842615, 'fraction_numerical': 0.001437297879985627, 'mean_word_length': 3.4830917874396135, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5291404', 'n_tokens_mistral': 1082, 'n_tokens_neox': 985, 'n_words': 225}