File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
packages/svelte/src/internal/client/dev Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' svelte ' : patch
3
+ ---
4
+
5
+ fix: try catch ` strict_equals ` to avoid error accessing ` STATE_SYMBOL `
Original file line number Diff line number Diff line change @@ -78,9 +78,13 @@ export function init_array_prototype_warnings() {
78
78
* @returns {boolean }
79
79
*/
80
80
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-catch needed because this tries to read properties of `a` and `b`,
82
+ // which could be disallowed for example in a secure context
83
+ try {
84
+ if ( ( a === b ) !== ( get_proxied_value ( a ) === get_proxied_value ( b ) ) ) {
85
+ w . state_proxy_equality_mismatch ( equal ? '===' : '!==' ) ;
86
+ }
87
+ } catch { }
84
88
85
89
return ( a === b ) === equal ;
86
90
}
You can’t perform that action at this time.
0 commit comments