fix: correct context applied to batch_inspect (#10569)

pull/10568/head
Dominic Gannaway 7 months ago committed by GitHub
parent 02c6176622
commit f1550b2ea3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
"svelte": patch
---
fix: correct context applied to batch_inspect

@ -126,11 +126,14 @@ function is_runes(context) {
*/
export function batch_inspect(target, prop, receiver) {
const value = Reflect.get(target, prop, receiver);
/**
* @this {any}
*/
return function () {
const previously_batching_effect = is_batching_effect;
is_batching_effect = true;
try {
return Reflect.apply(value, receiver, arguments);
return Reflect.apply(value, this, arguments);
} finally {
is_batching_effect = previously_batching_effect;
if (last_inspected_signal !== null) {

Loading…
Cancel
Save