Skip to content

Commit 670a680

Browse files
committed
fix: try catch strict_equals to avoid error accessing STATE_SYMBOL
1 parent e9dc118 commit 670a680

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.changeset/late-geckos-draw.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: try catch `strict_equals` to avoid error accessing `STATE_SYMBOL`

packages/svelte/src/internal/client/dev/equality.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,11 @@ export function init_array_prototype_warnings() {
7878
* @returns {boolean}
7979
*/
8080
export function strict_equals(a, b, equal = true) {
81-
if ((a === b) !== (get_proxied_value(a) === get_proxied_value(b))) {
82-
w.state_proxy_equality_mismatch(equal ? '===' : '!==');
83-
}
81+
try {
82+
if ((a === b) !== (get_proxied_value(a) === get_proxied_value(b))) {
83+
w.state_proxy_equality_mismatch(equal ? '===' : '!==');
84+
}
85+
} catch {}
8486

8587
return (a === b) === equal;
8688
}

0 commit comments

Comments
 (0)