<commit_before>function stopPropagation() {
	this._isPropagationStopped = true;
	if (this._stopPropagation) {
		this._stopPropagation();
	} else {
		this.cancelBubble = true;
	}
}

function isPropagationStopped() {
	return this._isPropagationStopped;
}

function stopImmediatePropagation() {
	this._isImmediatePropagationStopped = true;
	this._isPropagationStopped = true;
	if (this._stopImmediatePropagation) {
		this._stopImmediatePropagation();
	} else {
		this.cancelBubble = true;
	}
}

function isImmediatePropagationStopped() {
	return this._isImmediatePropagationStopped;
}

function preventDefault() {
	this._isDefaultPrevented = true;

	if (this._preventDefault) {
		this._preventDefault();
	} else {
		this.returnValue = false;
	}
}

function isDefaultPrevented() {
	return this._isDefaultPrevented;
}

const hookPlugins = {};
export function registerHook(type, hook) {
	let hooks = hookPlugins[type] = hookPlugins[type] || [];
	hooks.push(hook);
}

function eventHooks(nativeEvent) {
	// Extend nativeEvent
	nativeEvent._stopPropagation = nativeEvent.stopPropagation;
	nativeEvent.stopPropagation = stopPropagation;
	nativeEvent.isPropagationStopped = isPropagationStopped;

	nativeEvent._stopImmediatePropagation = nativeEvent.stopImmediatePropagation;
	nativeEvent.stopImmediatePropagation = stopImmediatePropagation;
	nativeEvent.isImmediatePropagationStopped = isImmediatePropagationStopped;

	nativeEvent._preventDefault = nativeEvent.preventDefault;
	nativeEvent.preventDefault = preventDefault;
	nativeEvent.isDefaultPrevented = isDefaultPrevented;

	// Plugins
	// register other eventHooks elsewhere, which will be called and injected here
	// registerHook('scroll', nativeEvent => {
	//	 // logic here
	// });
	let hooks = hookPlugins[nativeEvent.type];
	if (hooks) {
		let len = hookPlugins.length;
		for(let i = 0; i < len; i++) {
			hookPlugins[i](nativeEvent);
		}
	}

	return nativeEvent;
}

export default eventHooks;<commit_msg>Bugfix: should be iterating over hooks not hookPlugins<commit_after>function stopPropagation() {
	this._isPropagationStopped = true;
	if (this._stopPropagation) {
		this._stopPropagation();
	} else {
		this.cancelBubble = true;
	}
}

function isPropagationStopped() {
	return this._isPropagationStopped;
}

function stopImmediatePropagation() {
	this._isImmediatePropagationStopped = true;
	this._isPropagationStopped = true;
	if (this._stopImmediatePropagation) {
		this._stopImmediatePropagation();
	} else {
		this.cancelBubble = true;
	}
}

function isImmediatePropagationStopped() {
	return this._isImmediatePropagationStopped;
}

function preventDefault() {
	this._isDefaultPrevented = true;

	if (this._preventDefault) {
		this._preventDefault();
	} else {
		this.returnValue = false;
	}
}

function isDefaultPrevented() {
	return this._isDefaultPrevented;
}

const hookPlugins = {};
export function registerHook(type, hook) {
	let hooks = hookPlugins[type] = hookPlugins[type] || [];
	hooks.push(hook);
}

function eventHooks(nativeEvent) {
	// Extend nativeEvent
	nativeEvent._stopPropagation = nativeEvent.stopPropagation;
	nativeEvent.stopPropagation = stopPropagation;
	nativeEvent.isPropagationStopped = isPropagationStopped;

	nativeEvent._stopImmediatePropagation = nativeEvent.stopImmediatePropagation;
	nativeEvent.stopImmediatePropagation = stopImmediatePropagation;
	nativeEvent.isImmediatePropagationStopped = isImmediatePropagationStopped;

	nativeEvent._preventDefault = nativeEvent.preventDefault;
	nativeEvent.preventDefault = preventDefault;
	nativeEvent.isDefaultPrevented = isDefaultPrevented;

	// Plugins
	// register other eventHooks elsewhere, which will be called and injected here
	// registerHook('scroll', nativeEvent => {
	//	 // logic here
	// });
	let hooks = hookPlugins[nativeEvent.type];
	if (hooks) {
		let len = hooks.length;
		for(let i = 0; i < len; i++) {
			hooks[i](nativeEvent);
		}
	}

	return nativeEvent;
}

export default eventHooks;
{'fraction_non_alphanumeric': 0.10119198579761603, 'fraction_numerical': 0.000507227998985544, 'mean_word_length': 5.5514950166112955, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1040975', 'n_tokens_mistral': 1258, 'n_tokens_neox': 1284, 'n_words': 232}