<commit_before>define(
	[
		"../meta"
	],
	function (meta) {
		"use strict";

		meta({
			"entity": "module",
			"export": "injectSuper",
			"description": "super methods"
		});

		meta({
			"entity": "function",
			"name": "injectSuper",
			"description": "Generates a proxy function with injected instance methods of superCall and superApply",
			"arguments": [{
				"name": "method",
				"type": "function",
				"description": "This function is executed by the proxy function with the same context and arguments"
			}, {
				"name": "superMethod",
				"type": "function",
				"description": "This function accessible on the context from superCall or superApply while method is executing",
				"required": false
			}],
			"return": {
				"type": "function",
				"description": "A proxy for method"
			}
		});

		var temp = {};

		function injectSuper (method, superMethod) {
			if (!superMethod) {
				superMethod = new SuperMethodAbstract();
			}
			return function () {
				prep.call(this);
				inject.call(this, superMethod);
				execute.call(this, method, arguments);
				cleanup.call(this);
				return temp.result;
			};
		}

		function prep () {
			temp.superCall = this.superCall;
			temp.superApply = this.superApply;
		}

		function inject (superMethod) {
			this.superCall = superMethod;
			this.superApply = superApply(superMethod);
		}

		function execute (method, args) {
			temp.result = method.apply(this, args);
		}

		function cleanup () {
			this.superCall = temp.superCall;
			this.superApply = temp.superApply;
		}

		function superApply (superMethod) {
			return function (args) {
				return superMethod.apply(this, args);
			};
		}

		function SuperMethodAbstract () {
			return function () {<commit_msg>Checking for empty context before injecting super methods in class/super module. When a super wrapped method is call with an empty it will error if trying append super methods and when the global scope is the context it would pollute the global scope with the super methods during the call.<commit_after>define(
	[
		"../meta"
	],
	function (meta) {
		"use strict";

		meta({
			"entity": "module",
			"export": "injectSuper",
			"description": "super methods"
		});

		meta({
			"entity": "function",
			"name": "injectSuper",
			"description": "Generates a proxy function with injected instance methods of superCall and superApply",
			"arguments": [{
				"name": "method",
				"type": "function",
				"description": "This function is executed by the proxy function with the same context and arguments"
			}, {
				"name": "superMethod",
				"type": "function",
				"description": "This function accessible on the context from superCall or superApply while method is executing",
				"required": false
			}],
			"return": {
				"type": "function",
				"description": "A proxy for method"
			}
		});

		var temp = {},
			emptyContext = this;

		function injectSuper (method, superMethod) {
			if (!superMethod) {
				superMethod = new SuperMethodAbstract();
			}
			return function () {
				setup.call(this, superMethod);
				execute.call(this, method, arguments);
				cleanup.call(this);
				return temp.result;
			};
		}

		function setup (superMethod) {
			if (this !== emptyContext) {
				prep.call(this);
				inject.call(this, superMethod);
			}
		}

		function prep () {
			temp.superCall = this.superCall;
			temp.superApply = this.superApply;
		}

		function inject (superMethod) {
			this.superCall = superMethod;
			this.superApply = superApply(superMethod);
		}

		function execute (method, args) {
			temp.result = method.apply(this, args);
		}

		function cleanup () {
			if (this !== emptyContext) {
				this.superCall = temp.superCall;
				this.superApply = temp.superApply;
			}
		}

		function superApply (superMethod) {
			return function (args) {
				return superMethod.apply(this, args);
			};
		}

		function SuperMethodAbstract () {
			return function () {
{'fraction_non_alphanumeric': 0.1300563236047107, 'fraction_numerical': 0.0, 'mean_word_length': 3.3314855875831486, 'pattern_counts': {'":': 34, '<': 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': '7347455', 'n_tokens_mistral': 1420, 'n_tokens_neox': 1138, 'n_words': 346}