<commit_before>"use strict";
(function(context){
	
	context["doAsync"] = function(chainStart, chainName){
		
		// setting up the execution array-like
		var executionChain = {length:0};
		
		// setting up a psudo push function for the array-like 
		executionChain.addLink = function(callback, callbackName){
			// keep a copy of the current index for the reference of the duration of the function
			var executionIndex = executionChain.length;
			executionChain.length += 1;
			
			// append the callback to the list wtih some other fancy stuff
			executionChain[executionIndex] = {exe:callback, applyContext:{}, passQueue:[]};
			
			// if a name exists, put a reference to the callback to the name as well
			if (callbackName){
				executionChain[callbackName] = executionChain[executionIndex];
			}
			
			// temporary pass function to put the data into a queue (to be overwritten later)
			var tempPass = executionChain[executionIndex].applyContext.pass = function(){
				var recieved = Array.prototype.slice.call(arguments);
				
				// if new pass has not been assigned, add to pasqueue (support for synchronous functions)
				if(executionChain[executionIndex].applyContext.pass == tempPass){
					executionChain[executionIndex].passQueue.push({targetLink:executionIndex+1, args:recieved});
				}
				// use new pass (support for async functions)
				else {
					executionChain[executionIndex].applyContext.pass.apply(undefined, recieved);
				}
			}
			
			// function that ends the execution chain
			executionChain[executionIndex].applyContext.end = executionChain[executionIndex].applyContext.destroy = function(){
				Array.prototype.forEach.call(executionChain, function(link){
					link.exe = function(){};
					link.applyContext = {};
					link.passQueue = [];
				})
				chainer.then = function(){};
			}
			
			executionChain[executionIndex].applyContext.jump = function(target){
				var targetLinkIndex = executionIndex + target;
				
				// if the target is for something that hasn't been set yet, return the function to set a value for the future
				if (targetLinkIndex >= executionChain.length){
					return function(){
						var recieved = Array.prototype.slice.call(arguments);
						executionChain[executionIndex].passQueue.push({targetLink:targetLinkIndex, args:recieved});
					}
				}
				// else if target already exists, return the target link's previous function's pass function
				else if (targetLinkIndex < executionChain.length && targetLinkIndex > 0){
					return function(){
						var recieved = Array.prototype.slice.call(arguments); 
						executionChain[targetLinkIndex].exe.apply(executionChain[targetLinkIndex].applyContext, recieved);
					}
				}
				// all other conditions
				else {
					return false;
				}
			}
			
			executionChain[executionIndex].applyContext.jumpTo = function(target){
				// target is part of chain
				if (!executionChain[target]){
					return function(){
						var recieved = Array.prototype.slice.call(arguments); 
						executionChain[executionIndex].passQueue.push({targetLink:target, args:recieved});
					}
				}
				// target is not part of the chain
				else{
					return function (){
						var recieved = Array.prototype.slice.call(arguments); 
						executionChain[target].exe.apply(executionChain[target].applyContext, recieved);
					}
				}
			}
			
			executionChain[executionIndex].applyContext.self = function(){
				var recieved = Array.prototype.slice.call(arguments); 
				executionChain[executionIndex].applyContext.jump(0).apply(executionChain[executionIndex].applyContext, recieved);
			}
		}
		
		// function to initiate the chain
		var chainer = function(){
			var recieved = Array.prototype.slice.call(arguments);
			var instanceGlobals = {};
			Array.prototype.forEach.call(executionChain, function(link){
				link.applyContext.globals = instanceGlobals;
			})
			executionChain[0].exe.apply(executionChain[0].applyContext, recieved);
		};
		<commit_msg>change jump to piggy back off jumpto instead<commit_after>"use strict";
(function(context){
	
	context["doAsync"] = function(chainStart, chainName){
		
		// setting up the execution array-like
		var executionChain = {length:0};
		
		// setting up a psudo push function for the array-like 
		executionChain.addLink = function(callback, callbackName){
			// keep a copy of the current index for the reference of the duration of the function
			var executionIndex = executionChain.length;
			executionChain.length += 1;
			
			// append the callback to the list wtih some other fancy stuff
			executionChain[executionIndex] = {exe:callback, applyContext:{}, passQueue:[]};
			
			// if a name exists, put a reference to the callback to the name as well
			if (callbackName){
				executionChain[callbackName] = executionChain[executionIndex];
			}
			
			// temporary pass function to put the data into a queue (to be overwritten later)
			var tempPass = executionChain[executionIndex].applyContext.pass = function(){
				var recieved = Array.prototype.slice.call(arguments);
				
				// if new pass has not been assigned, add to pasqueue (support for synchronous functions)
				if(executionChain[executionIndex].applyContext.pass == tempPass){
					executionChain[executionIndex].passQueue.push({targetLink:executionIndex+1, args:recieved});
				}
				// use new pass (support for async functions)
				else {
					executionChain[executionIndex].applyContext.pass.apply(undefined, recieved);
				}
			}
			
			// function that ends the execution chain
			executionChain[executionIndex].applyContext.end = executionChain[executionIndex].applyContext.destroy = function(){
				Array.prototype.forEach.call(executionChain, function(link){
					link.exe = function(){};
					link.applyContext = {};
					link.passQueue = [];
				})
				chainer.then = function(){};
			}
			
			executionChain[executionIndex].applyContext.jumpTo = executionChain[executionIndex].applyContext.jumpto = function(target){
				// target is part of chain
				if (!executionChain[target]){
					return function(){
						var recieved = Array.prototype.slice.call(arguments); 
						executionChain[executionIndex].passQueue.push({targetLink:target, args:recieved});
					}
				}
				// target is not part of the chain
				else{
					return function (){
						var recieved = Array.prototype.slice.call(arguments); 
						executionChain[target].exe.apply(executionChain[target].applyContext, recieved);
					}
				}
			}
			
			executionChain[executionIndex].applyContext.jump = function(target){
				var targetLinkIndex = executionIndex + target;
				// piggy back off jumpto instead
				return executionChain[executionIndex].applyContext.jumpTo(targetLinkIndex);
			}
			
			executionChain[executionIndex].applyContext.self = function(){
				var recieved = Array.prototype.slice.call(arguments); 
				executionChain[executionIndex].applyContext.jump(0).apply(executionChain[executionIndex].applyContext, recieved);
			}
		}
		
		// function to initiate the chain
		var chainer = function(){
			var recieved = Array.prototype.slice.call(arguments);
			var instanceGlobals = {};
			Array.prototype.forEach.call(executionChain, function(link){
				link.applyContext.globals = instanceGlobals;
			})
			executionChain[0].exe.apply(executionChain[0].applyContext, recieved);
		};
		
{'fraction_non_alphanumeric': 0.10628085573230937, 'fraction_numerical': 0.0017827756445419638, 'mean_word_length': 3.772905759162304, 'pattern_counts': {'":': 0, '<': 4, '<?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': '1241358', 'n_tokens_mistral': 2552, 'n_tokens_neox': 1937, 'n_words': 498}