ronantakizawa/codereview-bench huggingface dataset:
Repository: sveltejs/svelte
File: packages/svelte/src/internal/client/dom/elements/attributes.js (JavaScript)

Code before:
			}
		}

		for (key in next) {
			set_custom_element_data(node, key, next[key]);
		}

		return next;
	}

	return set_attributes(
		/** @type {Element & ElementCSSInlineStyle} */ (node),
		prev,
		next,
		node.namespaceURI !== namespace_svg,
		css_hash
	);
}

/**
 * List of attributes that should always be set through the attr method,
 * because updating them through the property setter doesn't work reliably.
 * In the example of `width`/`height`, the problem is that the setter only
 * accepts numeric values, but the attribute can also be set to a string like `50%`.
 * If this list becomes too big, rethink this approach. In case of draggable trying to
 * set `element.draggable='false'` will actually set draggable to `true`
 */
var always_set_through_set_attribute = ['width', 'height', 'draggable'];

/** @type {Map<string, string[]>} */
var setters_cache = new Map();

/** @param {Element} element */
function get_setters(element) {
	/** @type {string[]} */
	var setters = [];
	var descriptors;
	var proto = get_prototype_of(element);

	// Stop at Element, from there on there's only unnecessary setters we're not interested in
	while (proto.constructor.name !== 'Element') {
		descriptors = get_descriptors(proto);

		for (var key in descriptors) {
			if (descriptors[key].set && !always_set_through_set_attribute.includes(key)) {
				setters.push(key);
			}
		}

		proto = get_prototype_of(proto);
	}

Review comment (suggestion):
Would be better to first name the draggable case, then the "if this list becomes too big" sentence - that way things are grouped better

Code after:
			}
		}

		for (key in next) {
			set_custom_element_data(node, key, next[key]);
		}

		return next;
	}

	return set_attributes(
		/** @type {Element & ElementCSSInlineStyle} */ (node),
		prev,
		next,
		node.namespaceURI !== namespace_svg,
		css_hash
	);
}

/**
 * List of attributes that should always be set through the attr method,
 * because updating them through the property setter doesn't work reliably.
 * In the example of `width`/`height`, the problem is that the setter only
 * accepts numeric values, but the attribute can also be set to a string like `50%`.
 * In case of draggable trying to set `element.draggable='false'` will actually set
 * draggable to `true`. If this list becomes too big, rethink this approach.
 */
var always_set_through_set_attribute = ['width', 'height', 'draggable'];

/** @type {Map<string, string[]>} */
var setters_cache = new Map();

/** @param {Element} element */
function get_setters(element) {
	/** @type {string[]} */
	var setters = [];
	var descriptors;
	var proto = get_prototype_of(element);

	// Stop at Element, from there on there's only unnecessary setters we're not interested in
	while (proto.constructor.name !== 'Element') {
		descriptors = get_descriptors(proto);

		for (var key in descriptors) {
			if (descriptors[key].set && !always_set_through_set_attribute.includes(key)) {
				setters.push(key);
			}
		}

		proto = get_prototype_of(proto);
	}
Repository: sveltejs/svelte
File: packages/svelte/tests/runtime-runes/samples/svelte-element-draggable/_config.js (JavaScript)

Code before:
import { ok, test } from '../../test';
import { flushSync } from 'svelte';

export default test({
	html: `<div draggable="false"></div>`,

	async test({ assert, target, logs }) {
		const div = target.querySelector('div');
		ok(div);

		assert.deepEqual(div.getAttribute('draggable'), 'false');
	}
});


Review comment (suggestion):
I think we probably want to assert that the property is false:

```suggestion
		assert.deepEqual(div.draggable, false);
```

Code after:
import { ok, test } from '../../test';
import { flushSync } from 'svelte';

export default test({
	html: `<div draggable="false"></div><div draggable="false"></div>`,

	async test({ assert, target, logs }) {
		const [div, div2] = target.querySelectorAll('div');
		ok(div);
		ok(div2);

		assert.deepEqual(div.getAttribute('draggable'), 'false');
		assert.deepEqual(div.draggable, false);
		assert.deepEqual(div2.getAttribute('draggable'), 'false');
		assert.deepEqual(div2.draggable, false);
	}
});
Repository: sveltejs/svelte
File: packages/svelte/tests/server-side-rendering/samples/css-injected-options-nested/Nested.svelte (Svelte)

Code before:
<svelte:options css="injected" />

<div class="foo">foo</div>

<style>
	.foo {
		color: red;
	}
</style>


Review comment (suggestion):
this should use a different class name than the one in `main.svelte` to make the expected outcome more obvious (right now it's two foo classes, hard to visually check)

Code after:
<svelte:options css="injected" />

<div class="bar">bar</div>

<style>
	.bar {
		color: red;
	}
</style>
Repository: sveltejs/svelte
File: packages/svelte/src/reactivity/date.js (JavaScript)

Code before:

	/** @type {Map<keyof Date, Source<unknown>>} */
	#deriveds = new Map();

	/** @param {any[]} params */
	constructor(...params) {
		// @ts-ignore
		super(...params);
		if (!inited) this.#init();
	}

	#init() {
		inited = true;

		var proto = SvelteDate.prototype;
		var date_proto = Date.prototype;

		var methods = /** @type {Array<keyof Date & string>} */ (
			Object.getOwnPropertyNames(date_proto)
		);

		for (const method of methods) {
			if (method.startsWith('get') || method.startsWith('to')) {
				// @ts-ignore
				proto[method] = function (...args) {
					// If we have no params, then don't cache or create a derived
					// @ts-ignore
					if (args.length > 0) {
						get(this.#time);
						// @ts-ignore
						return date_proto[method].apply(this, args);
					}

					var d = this.#deriveds.get(method);

					if (d === undefined) {
						d = derived(() => {
							get(this.#time);
							// @ts-ignore
							return date_proto[method].apply(this, args);
						});

						this.#deriveds.set(method, d);
					}

					return get(d);
				};
			}

			if (method.startsWith('set')) {
				// @ts-ignore

Review comment (suggestion):
comment says the opposite of the code

```suggestion
					// don't memoize if there are arguments
```

Code after:

	/** @type {Map<keyof Date, Source<unknown>>} */
	#deriveds = new Map();

	/** @param {any[]} params */
	constructor(...params) {
		// @ts-ignore
		super(...params);
		if (!inited) this.#init();
	}

	#init() {
		inited = true;

		var proto = SvelteDate.prototype;
		var date_proto = Date.prototype;

		var methods = /** @type {Array<keyof Date & string>} */ (
			Object.getOwnPropertyNames(date_proto)
		);

		for (const method of methods) {
			if (method.startsWith('get') || method.startsWith('to')) {
				// @ts-ignore
				proto[method] = function (...args) {
					// don't memoize if there are arguments
					// @ts-ignore
					if (args.length > 0) {
						get(this.#time);
						// @ts-ignore
						return date_proto[method].apply(this, args);
					}

					var d = this.#deriveds.get(method);

					if (d === undefined) {
						d = derived(() => {
							get(this.#time);
							// @ts-ignore
							return date_proto[method].apply(this, args);
						});

						this.#deriveds.set(method, d);
					}

					return get(d);
				};
			}

			if (method.startsWith('set')) {
				// @ts-ignore
Repository: sveltejs/svelte
File: packages/svelte/src/reactivity/date.test.ts (TypeScript)

Code before:

	flushSync(() => {
		expect_all_changes_to_be_false();
		changes = {
			...changes,
			getMonth: true,
			getUTCMonth: true,
			getDay: true,
			getUTCDay: true,
			getMilliseconds: true,
			getUTCMilliseconds: true,
			getTime: true,
			toISOString: true,
			toJSON: true,
			toUTCString: true,
			toString: true,
			toLocaleString: true
		};
		test_description = 'changing month';
		date.setMonth(date.getMonth() + 1);
	});

	cleanup();
});

test('Datae.toLocaleString', () => {
	const date = new SvelteDate(initial_date);

	const log: any = [];

	const cleanup = effect_root(() => {
		render_effect(() => {
			log.push(date.toLocaleString(undefined, { month: 'long', year: 'numeric' }));
		});
		render_effect(() => {
			log.push(date.toLocaleString(undefined, { month: 'long' }));
		});
	});

	flushSync();

	assert.deepEqual(log, [
		initial_date.toLocaleString(undefined, { month: 'long', year: 'numeric' }),
		initial_date.toLocaleString(undefined, { month: 'long' })
	]);

	cleanup();
});

test('Date.instanceOf', () => {
	assert.equal(new SvelteDate() instanceof Date, true);

Review comment (suggestion):
```suggestion
test('Date.toLocaleString', () => {
```

Code after:

	flushSync(() => {
		expect_all_changes_to_be_false();
		changes = {
			...changes,
			getMonth: true,
			getUTCMonth: true,
			getDay: true,
			getUTCDay: true,
			getMilliseconds: true,
			getUTCMilliseconds: true,
			getTime: true,
			toISOString: true,
			toJSON: true,
			toUTCString: true,
			toString: true,
			toLocaleString: true
		};
		test_description = 'changing month';
		date.setMonth(date.getMonth() + 1);
	});

	cleanup();
});

test('Date.toLocaleString', () => {
	const date = new SvelteDate(initial_date);

	const log: any = [];

	const cleanup = effect_root(() => {
		render_effect(() => {
			log.push(date.toLocaleString(undefined, { month: 'long', year: 'numeric' }));
		});
		render_effect(() => {
			log.push(date.toLocaleString(undefined, { month: 'long' }));
		});
	});

	flushSync();

	assert.deepEqual(log, [
		initial_date.toLocaleString(undefined, { month: 'long', year: 'numeric' }),
		initial_date.toLocaleString(undefined, { month: 'long' })
	]);

	cleanup();
});

test('Date.instanceOf', () => {
	assert.equal(new SvelteDate() instanceof Date, true);
Repository: sveltejs/svelte
File: packages/svelte/src/internal/client/runtime.js (JavaScript)

Code before:

export function increment_version() {
	return current_version++;
}

/** @returns {boolean} */
export function is_runes() {
	return current_component_context !== null && current_component_context.l === null;
}

/**
 * Determines whether a derived or effect is dirty.
 * If it is MAYBE_DIRTY, will set the status to CLEAN
 * @param {Reaction} reaction
 * @returns {boolean}
 */
export function check_dirtiness(reaction) {
	var flags = reaction.f;

	if ((flags & DIRTY) !== 0) {
		return true;
	}

	if ((flags & MAYBE_DIRTY) !== 0) {
		var dependencies = reaction.deps;

		if (dependencies !== null) {
			var is_unowned = (flags & UNOWNED) !== 0;
			var i;

			if ((flags & DISCONNECTED) !== 0) {
				for (i = 0; i < dependencies.length; i++) {
					(dependencies[i].reactions ??= []).push(reaction);
				}

				reaction.f ^= DISCONNECTED;
			}

			for (i = 0; i < dependencies.length; i++) {
				var dependency = dependencies[i];

				if (check_dirtiness(/** @type {Derived} */ (dependency))) {
					update_derived(/** @type {Derived} */ (dependency));
				}

				if (dependency.version > reaction.version) {
					return true;
				}

				if (is_unowned) {
					// TODO is there a more logical place to do this work?

Review comment (suggestion):
no need to create a single-use variable

```suggestion
```

Code after:

export function increment_version() {
	return current_version++;
}

/** @returns {boolean} */
export function is_runes() {
	return current_component_context !== null && current_component_context.l === null;
}

/**
 * Determines whether a derived or effect is dirty.
 * If it is MAYBE_DIRTY, will set the status to CLEAN
 * @param {Reaction} reaction
 * @returns {boolean}
 */
export function check_dirtiness(reaction) {
	var flags = reaction.f;

	if ((flags & DIRTY) !== 0) {
		return true;
	}

	if ((flags & MAYBE_DIRTY) !== 0) {
		var dependencies = reaction.deps;
		var is_unowned = (flags & UNOWNED) !== 0;

		if (dependencies !== null) {
			var i;

			if ((flags & DISCONNECTED) !== 0) {
				for (i = 0; i < dependencies.length; i++) {
					(dependencies[i].reactions ??= []).push(reaction);
				}

				reaction.f ^= DISCONNECTED;
			}

			for (i = 0; i < dependencies.length; i++) {
				var dependency = dependencies[i];

				if (check_dirtiness(/** @type {Derived} */ (dependency))) {
					update_derived(/** @type {Derived} */ (dependency));
				}

				if (dependency.version > reaction.version) {
					return true;
				}

				if (is_unowned) {
					// TODO is there a more logical place to do this work?
Repository: sveltejs/svelte
File: packages/svelte/src/internal/client/runtime.js (JavaScript)

Code before:

			for (i = 0; i < dependencies.length; i++) {
				var dependency = dependencies[i];

				if (check_dirtiness(/** @type {Derived} */ (dependency))) {
					update_derived(/** @type {Derived} */ (dependency));
				}

				if (dependency.version > reaction.version) {
					return true;
				}

				if (is_unowned) {
					// TODO is there a more logical place to do this work?
					if (!current_skip_reaction && !dependency?.reactions?.includes(reaction)) {
						// If we are working with an unowned signal as part of an effect (due to !current_skip_reaction)
						// and the version hasn't changed, we still need to check that this reaction
						// if linked to the dependency source – otherwise future updates will not be caught.
						(dependency.reactions ??= []).push(reaction);
					}
				}
			}
		}

		set_signal_status(reaction, CLEAN);
	}

	return false;
}

/**
 * @param {Error} error
 * @param {Effect} effect
 * @param {ComponentContext | null} component_context
 */
function handle_error(error, effect, component_context) {
	// Given we don't yet have error boundaries, we will just always throw.
	if (!DEV || handled_errors.has(error) || component_context === null) {
		throw error;
	}

	const component_stack = [];

	const effect_name = effect.fn?.name;

	if (effect_name) {
		component_stack.push(effect_name);
	}

	/** @type {ComponentContext | null} */
	let current_context = component_context;

Review comment (suggestion):
```suggestion
		if ((flags & UNOWNED) === 0) {
```

Code after:

			for (i = 0; i < dependencies.length; i++) {
				var dependency = dependencies[i];

				if (check_dirtiness(/** @type {Derived} */ (dependency))) {
					update_derived(/** @type {Derived} */ (dependency));
				}

				if (dependency.version > reaction.version) {
					return true;
				}

				if (is_unowned) {
					// TODO is there a more logical place to do this work?
					if (!current_skip_reaction && !dependency?.reactions?.includes(reaction)) {
						// If we are working with an unowned signal as part of an effect (due to !current_skip_reaction)
						// and the version hasn't changed, we still need to check that this reaction
						// if linked to the dependency source – otherwise future updates will not be caught.
						(dependency.reactions ??= []).push(reaction);
					}
				}
			}
		}

		// Unowned signals should never be marked as clean.
		if (!is_unowned) {
			set_signal_status(reaction, CLEAN);
		}
	}

	return false;
}

/**
 * @param {Error} error
 * @param {Effect} effect
 * @param {ComponentContext | null} component_context
 */
function handle_error(error, effect, component_context) {
	// Given we don't yet have error boundaries, we will just always throw.
	if (!DEV || handled_errors.has(error) || component_context === null) {
		throw error;
	}

	const component_stack = [];

	const effect_name = effect.fn?.name;

	if (effect_name) {
		component_stack.push(effect_name);
	}
Repository: sveltejs/svelte
File: packages/svelte/src/internal/client/dom/elements/transitions.js (JavaScript)

Code before:
					keyframes.push(keyframe);
				}
			}

			for (var i = 0; i <= n; i += 1) {
				var t = t1 + delta * easing(i / n);
				var styles = css(t, 1 - t);
				keyframes.push(css_to_keyframe(styles));
			}

			animation = element.animate(keyframes, {
				delay: is_intro ? 0 : delay,
				duration: duration + (is_intro ? delay : 0),
				easing: 'linear',
				fill: 'forwards'
			});

			animation.finished.then(() => {
				on_finish?.();

				if (t2 === 1) {
					animation.cancel();
				}
			});
		});
	} else {
		// Timer
		if (t1 === 0) {
			tick?.(0, 1); // TODO put in nested effect, to avoid interleaved reads/writes?
		}

		task = loop((now) => {
			if (now >= end) {
				tick?.(t2, 1 - t2);
				on_finish?.();
				return false;
			}

			if (now >= start) {
				var p = t1 + delta * easing((now - start) / duration);
				tick?.(p, 1 - p);
			}

			return true;
		});
	}

	return {
		abort: () => {
			if (animation) {
				animation.cancel();

Review comment (suggestion):
The `catch` is necessary to prevent an unhandled rejection [when a transition is aborted](https://svelte-5-preview-52vj098wn-svelte.vercel.app/#H4sIAAAAAAAAE0WQ0W7DIAxFf8Vjk9pKk5K9ZkmlfceyBwamQSWQgelUIf59QCb1AcG1fY-uSUxpg4ENn4lZviIb2Me2sVdG962KcENDWHRw0YtaGYPweqPzbGfS6-Y8QQLFJUIG5d0Kh93Tkec2aNLOHt7rcD0GCcLifmGCl0Cc8Ki4CXiqA6WtohXVAOQuF4PHE6TmpH_PU70bLM927B5J7PgdiYrRWWG0uE5pJ-QWc3_DivATS9PcgVsJYkFxBVoQhLPBGazIHdOQ6VmrFjZXxij1DR4rDXXjKSUZPW_6re_7nM8LGuPGrgwXRuq0yuXvVie10ijZQD5i_sp_rtbO43YBAAA=):

<img width="624" alt="image" src="https://github.com/user-attachments/assets/06dd67f1-14c4-4300-bdfb-f30ee628281b">


Code after:
					keyframes.push(keyframe);
				}
			}

			for (var i = 0; i <= n; i += 1) {
				var t = t1 + delta * easing(i / n);
				var styles = css(t, 1 - t);
				keyframes.push(css_to_keyframe(styles));
			}

			animation = element.animate(keyframes, {
				delay: is_intro ? 0 : delay,
				duration: duration + (is_intro ? delay : 0),
				easing: 'linear',
				fill: 'forwards'
			});

			animation.finished
				.then(() => {
					on_finish?.();

					if (t2 === 1) {
						animation.cancel();
					}
				})
				.catch((e) => {
					// Error for DOMException: The user aborted a request. This results in two things:
					// - startTime is `null`
					// - currentTime is `null`
					// We can't use the existence of an AbortError as this error and error code is shared
					// with other Web APIs such as fetch().

					if (animation.startTime !== null && animation.currentTime !== null) {
						throw e;
					}
				});
		});
	} else {
		// Timer
		if (t1 === 0) {
			tick?.(0, 1); // TODO put in nested effect, to avoid interleaved reads/writes?
		}

		task = loop((now) => {
			if (now >= end) {
				tick?.(t2, 1 - t2);
				on_finish?.();
				return false;
			}

			if (now >= start) {
Repository: sveltejs/svelte
File: packages/svelte/src/compiler/phases/1-parse/state/element.js (JavaScript)

Code before:
		if (type === 'SvelteHead') return true;
		if (type === 'RegularElement' || type === 'Component') return false;
	}
	return false;
}

/** @param {Compiler.TemplateNode[]} stack */
function parent_is_shadowroot_template(stack) {
	// https://developer.chrome.com/docs/css-ui/declarative-shadow-dom#building_a_declarative_shadow_root
	let i = stack.length;
	while (i--) {
		if (
			stack[i].type === 'RegularElement' &&
			/** @type {Compiler.RegularElement} */ (stack[i]).attributes.some(
				(a) => a.type === 'Attribute' && a.name === 'shadowrootmode'
			)
		) {
			return true;
		}
	}
	return false;
}

const regex_closing_textarea_tag = /^<\/textarea(\s[^>]*)?>/i;
const regex_closing_comment = /-->/;
const regex_component_name = /^(?:[A-Z]|[A-Za-z][A-Za-z0-9_$]*(?:\.|\[))/;

/** @param {Parser} parser */
export default function element(parser) {
	const start = parser.index++;

	let parent = parser.current();

	if (parser.eat('!--')) {
		const data = parser.read_until(regex_closing_comment);
		parser.eat('-->', true);

		/** @type {ReturnType<typeof parser.append<Compiler.Comment>>} */
		parser.append({
			type: 'Comment',
			start,
			end: parser.index,
			data
		});

		return;
	}

	const is_closing_tag = parser.eat('/');

	const name = read_tag_name(parser);

Review comment (suggestion):
```suggestion
const regex_component_name = /^(?:[A-Z]|[A-Za-z][A-Za-z0-9_$]*[.[])/;
```

Code after:
		if (type === 'SvelteHead') return true;
		if (type === 'RegularElement' || type === 'Component') return false;
	}
	return false;
}

/** @param {Compiler.TemplateNode[]} stack */
function parent_is_shadowroot_template(stack) {
	// https://developer.chrome.com/docs/css-ui/declarative-shadow-dom#building_a_declarative_shadow_root
	let i = stack.length;
	while (i--) {
		if (
			stack[i].type === 'RegularElement' &&
			/** @type {Compiler.RegularElement} */ (stack[i]).attributes.some(
				(a) => a.type === 'Attribute' && a.name === 'shadowrootmode'
			)
		) {
			return true;
		}
	}
	return false;
}

const regex_closing_textarea_tag = /^<\/textarea(\s[^>]*)?>/i;
const regex_closing_comment = /-->/;
const regex_component_name = /^(?:[A-Z]|[A-Za-z][A-Za-z0-9_$]*\.)/;
const regex_valid_component_name =
	/^(?:[A-Z][A-Za-z0-9_$.]*|[a-z][A-Za-z0-9_$]*\.[A-Za-z0-9_$])[A-Za-z0-9_$.]*$/;

/** @param {Parser} parser */
export default function element(parser) {
	const start = parser.index++;

	let parent = parser.current();

	if (parser.eat('!--')) {
		const data = parser.read_until(regex_closing_comment);
		parser.eat('-->', true);

		/** @type {ReturnType<typeof parser.append<Compiler.Comment>>} */
		parser.append({
			type: 'Comment',
			start,
			end: parser.index,
			data
		});

		return;
	}

	const is_closing_tag = parser.eat('/');
Repository: sveltejs/svelte
File: packages/svelte/src/internal/client/runtime.js (JavaScript)

Code before:
				// TODO: evaluate if we should always just use a Set or not here?
				var set = array.length > 16 ? new Set(array) : null;

				// Remove dependencies that should no longer be tracked
				for (i = skipped_deps; i < deps.length; i++) {
					dependency = deps[i];

					if (set !== null ? !set.has(dependency) : !array.includes(dependency)) {
						remove_reaction(reaction, dependency);
					}
				}
			}

			if (deps !== null && skipped_deps > 0) {
				deps.length = skipped_deps + new_deps.length;
				for (i = 0; i < new_deps.length; i++) {
					deps[skipped_deps + i] = new_deps[i];
				}
			} else {
				reaction.deps = deps = new_deps;
			}

			if (!current_skip_reaction) {
				for (i = skipped_deps; i < deps.length; i++) {
					dependency = deps[i];
					var reactions = dependency.reactions;

					if (reactions === null) {
						reactions = dependency.reactions = new Set();
					}
					reactions.add(reaction);
				}
			}
		} else if (deps !== null && skipped_deps < deps.length) {
			remove_reactions(reaction, skipped_deps);
			deps.length = skipped_deps;
		}

		return result;
	} finally {
		new_deps = previous_deps;
		skipped_deps = previous_skipped_deps;
		current_untracked_writes = previous_untracked_writes;
		current_reaction = previous_reaction;
		current_skip_reaction = previous_skip_reaction;
	}
}

/**
 * @template V
 * @param {Reaction} signal

Review comment (suggestion):
I think this whole block could become a one-liner?

```js
(dependency.reactions ??= new Set()).add(reaction);
```

Code after:
				// TODO: evaluate if we should always just use a Set or not here?
				var set = array.length > 16 ? new Set(array) : null;

				// Remove dependencies that should no longer be tracked
				for (i = skipped_deps; i < deps.length; i++) {
					dependency = deps[i];

					if (set !== null ? !set.has(dependency) : !array.includes(dependency)) {
						remove_reaction(reaction, dependency);
					}
				}
			}

			if (deps !== null && skipped_deps > 0) {
				deps.length = skipped_deps + new_deps.length;
				for (i = 0; i < new_deps.length; i++) {
					deps[skipped_deps + i] = new_deps[i];
				}
			} else {
				reaction.deps = deps = new_deps;
			}

			if (!current_skip_reaction) {
				for (i = skipped_deps; i < deps.length; i++) {
					(deps[i].reactions ??= new Set()).add(reaction);
				}
			}
		} else if (deps !== null && skipped_deps < deps.length) {
			remove_reactions(reaction, skipped_deps);
			deps.length = skipped_deps;
		}

		return result;
	} finally {
		new_deps = previous_deps;
		skipped_deps = previous_skipped_deps;
		current_untracked_writes = previous_untracked_writes;
		current_reaction = previous_reaction;
		current_skip_reaction = previous_skip_reaction;
	}
}

/**
 * @template V
 * @param {Reaction} signal
 * @param {Value<V>} dependency
 * @returns {void}
 */
function remove_reaction(signal, dependency) {
	let reactions = dependency.reactions;
	if (reactions !== null) {