Skip to content

Commit 5193f2c

Browse files
committed
fix, only warn in dev
1 parent b64fb09 commit 5193f2c

File tree

1 file changed

+5
-6
lines changed
  • packages/svelte/src/internal/client

1 file changed

+5
-6
lines changed

packages/svelte/src/internal/client/proxy.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -298,14 +298,13 @@ export function proxy(value) {
298298
* @returns {T | void}
299299
*/
300300
export function return_proxy(value) {
301-
if (
302-
!should_proxy(value) &&
303-
!(typeof value === 'object' && value !== null && STATE_SYMBOL in value)
304-
) {
305-
// if the argument passed was already a proxy, we don't warn
301+
if (should_proxy(value)) {
306302
return proxy(value);
303+
} else if (DEV && !(typeof value === 'object' && value !== null && STATE_SYMBOL in value)) {
304+
// if the argument passed was already a proxy, we don't warn
305+
w.state_return_not_proxyable();
307306
}
308-
w.state_return_not_proxyable();
307+
return value;
309308
}
310309

311310
/**

0 commit comments

Comments
 (0)