<commit_before>(function(global) {
	var states = {
		PENDING: -1,
		REJECTED: 0,
		FULFILLED: 1
	};

	var doNext = (typeof process === 'object' && process.nextTick) ||
		(typeof setImmediate === 'function' && setImmediate) ||
		function(func) { setTimeout(func, 0); };

	function isObject(object) {
		return object && typeof object === (typeof {});
	}

	function isFunction(object) {
		return object && typeof object === (typeof isFunction);
	}

	function doResolution(promise, x) {
		if (isObject(x) || isFunction(x)) {
			// 2.3.1: If promise and x refer to the same object, reject promise with a TypeError as the reason.
			if (x === promise.promise) {
				promise.reject(new TypeError('Cannot fulfill a promise with itself as the value'));
			}

			try {
				// 2.3.3.1: Let then be x.then. 3.5
				then = x.then;
			}
			catch(e) {
				// 2.3.3.2: If retrieving the property x.then results in a thrown exception e, reject promise with e as the reason.
				return promise.reject(e);
			}

			if (isFunction(then)) {
				var called = false;

				try {
					// 2.3.2: If x is a promise, adopt its state. 3.4<commit_msg>Fix leaking then variable<commit_after>(function(global) {
	var states = {
		PENDING: -1,
		REJECTED: 0,
		FULFILLED: 1
	};

	var doNext = (typeof process === 'object' && process.nextTick) ||
		(typeof setImmediate === 'function' && setImmediate) ||
		function(func) { setTimeout(func, 0); };

	function isObject(object) {
		return object && typeof object === (typeof {});
	}

	function isFunction(object) {
		return object && typeof object === (typeof isFunction);
	}

	function doResolution(promise, x) {
		if (isObject(x) || isFunction(x)) {
			// 2.3.1: If promise and x refer to the same object, reject promise with a TypeError as the reason.
			if (x === promise.promise) {
				promise.reject(new TypeError('Cannot fulfill a promise with itself as the value'));
			}
			
			var then;
			try {
				// 2.3.3.1: Let then be x.then. 3.5
				then = x.then;
			}
			catch(e) {
				// 2.3.3.2: If retrieving the property x.then results in a thrown exception e, reject promise with e as the reason.
				return promise.reject(e);
			}

			if (isFunction(then)) {
				var called = false;

				try {
					// 2.3.2: If x is a promise, adopt its state. 3.4
{'fraction_non_alphanumeric': 0.14052863436123347, 'fraction_numerical': 0.019383259911894272, 'mean_word_length': 2.9702797202797204, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '6007258', 'n_tokens_mistral': 889, 'n_tokens_neox': 757, 'n_words': 246}