<commit_before>import { createHook, executionAsyncId } from 'async_hooks'

let asyncContexters = new Map()

createHook({
	init(asyncId, type, triggerAsyncId) {
		for (let contexts of asyncContexters.values()) {
			contexts.set(asyncId, contexts.get(triggerAsyncId))
		}
	},
	destroy(asyncId) {
		for (let contexts of asyncContexters.values()) {
			contexts.delete(asyncId)
		}
	},
}).enable()

export default class AsyncContexter {
	constructor() {
		asyncContexters.set(this, new Map())
	}
	new() {
		let asyncId = executionAsyncId()
		let contexts = asyncContexters.get(this)
		let context = Object.create(contexts.get(asyncId) || null)
		contexts.set(asyncId, context)
		return context
	}
	get current() {
		return asyncContexters.get(this).get(executionAsyncId())
	}
}<commit_msg>make AsyncContexter#new a getter as well, instead of a method<commit_after>import { createHook, executionAsyncId } from 'async_hooks'

let asyncContexters = new Map()

createHook({
	init(asyncId, type, triggerAsyncId) {
		for (let contexts of asyncContexters.values()) {
			contexts.set(asyncId, contexts.get(triggerAsyncId))
		}
	},
	destroy(asyncId) {
		for (let contexts of asyncContexters.values()) {
			contexts.delete(asyncId)
		}
	},
}).enable()

export default class AsyncContexter {
	constructor() {
		asyncContexters.set(this, new Map())
	}
	get new() {
		let asyncId = executionAsyncId()
		let contexts = asyncContexters.get(this)
		let context = Object.create(contexts.get(asyncId) || null)
		contexts.set(asyncId, context)
		return context
	}
	get current() {
		return asyncContexters.get(this).get(executionAsyncId())
	}
}
{'fraction_non_alphanumeric': 0.1271604938271605, 'fraction_numerical': 0.0, 'mean_word_length': 4.937728937728938, 'pattern_counts': {'":': 0, '<': 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': '772222', 'n_tokens_mistral': 586, 'n_tokens_neox': 546, 'n_words': 120}