<commit_before>var hasConsole = typeof console === "object";

exports.logError = function(msg){
	if (hasConsole && typeof console.error !== "undefined") {
		console.error(msg);
	}
};

exports.logInfo = function(msg){
	if (hasConsole && typeof console.log !== "undefined") {
		console.log(msg);
	}
};

/**
 * Whether browser supports __proto__
 *
 * Used to skip tests in browsers without support (IE <= 10)
 *
 * see https://babeljs.io/docs/usage/caveats/#internet-explorer-classes-10-and-below-
 *
 * @return {Function} When called evaluates to `true` if __proto__ is supported
 */
exports.supportsProto = function supportsProto() {
	var foo = {};
	foo.__proto__ = { bar: "baz" };
	return foo.bar === "baz";
};

exports.supportsAsyncAwait = function(){
	var fn = new Function("async function test() { }");
	try {
		fn();
		return true;
	} else {
		return false;
	}
};


var makePassQUnitHTML =  function() {
	return [
		"<script>",
			"window.done = window.parent.done;",
			"window.assert = window.parent.assert;",
		"</script>"
	].join("\n");
};

/**
 * Returns a string of html attributes
 * @param {Object} attrs The key is the attr name and the value its value
 * @return {string} An string like 'foo="bar" baz="quz"'
 */
var processScriptTagAttrs = function(attrs) {
	attrs = attrs || {};<commit_msg>fix the try catch<commit_after>var hasConsole = typeof console === "object";

exports.logError = function(msg){
	if (hasConsole && typeof console.error !== "undefined") {
		console.error(msg);
	}
};

exports.logInfo = function(msg){
	if (hasConsole && typeof console.log !== "undefined") {
		console.log(msg);
	}
};

/**
 * Whether browser supports __proto__
 *
 * Used to skip tests in browsers without support (IE <= 10)
 *
 * see https://babeljs.io/docs/usage/caveats/#internet-explorer-classes-10-and-below-
 *
 * @return {Function} When called evaluates to `true` if __proto__ is supported
 */
exports.supportsProto = function supportsProto() {
	var foo = {};
	foo.__proto__ = { bar: "baz" };
	return foo.bar === "baz";
};

exports.supportsAsyncAwait = function(){
	var fn = new Function("async function test() { }");
	try {
		fn();
		return true;
	} catch(ex) {
		return false;
	}
};


var makePassQUnitHTML =  function() {
	return [
		"<script>",
			"window.done = window.parent.done;",
			"window.assert = window.parent.assert;",
		"</script>"
	].join("\n");
};

/**
 * Returns a string of html attributes
 * @param {Object} attrs The key is the attr name and the value its value
 * @return {string} An string like 'foo="bar" baz="quz"'
 */
var processScriptTagAttrs = function(attrs) {
	attrs = attrs || {};
{'fraction_non_alphanumeric': 0.16622188333968738, 'fraction_numerical': 0.0030499428135722455, 'mean_word_length': 3.9323308270676693, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '7610970', 'n_tokens_mistral': 895, 'n_tokens_neox': 852, 'n_words': 237}