Skip to content

Commit ebab40a

Browse files
committed
only patch global if it exists
1 parent f1cc932 commit ebab40a

File tree

1 file changed

+1
-1
lines changed
  • packages/svelte/src/internal/shared

1 file changed

+1
-1
lines changed

packages/svelte/src/internal/shared/clone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function clone(value, cloned, path, paths, original = null) {
132132
}
133133

134134
// Patches `structuredClone` to work with `$state` proxies
135-
if (DEV) {
135+
if (DEV && "structuredClone" in globalThis) {
136136
/**
137137
* Creates a deep clone of an object.
138138
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/structuredClone)

0 commit comments

Comments
 (0)