From 5193f2c28922ce56ff89a73910fea22e269fad4f Mon Sep 17 00:00:00 2001 From: ComputerGuy <63362464+Ocean-OS@users.noreply.github.com> Date: Sun, 4 May 2025 12:37:26 -0700 Subject: [PATCH] fix, only warn in dev --- packages/svelte/src/internal/client/proxy.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/svelte/src/internal/client/proxy.js b/packages/svelte/src/internal/client/proxy.js index f9afaef3aa..9499e7f9dd 100644 --- a/packages/svelte/src/internal/client/proxy.js +++ b/packages/svelte/src/internal/client/proxy.js @@ -298,14 +298,13 @@ export function proxy(value) { * @returns {T | void} */ export function return_proxy(value) { - if ( - !should_proxy(value) && - !(typeof value === 'object' && value !== null && STATE_SYMBOL in value) - ) { - // if the argument passed was already a proxy, we don't warn + if (should_proxy(value)) { return proxy(value); + } else if (DEV && !(typeof value === 'object' && value !== null && STATE_SYMBOL in value)) { + // if the argument passed was already a proxy, we don't warn + w.state_return_not_proxyable(); } - w.state_return_not_proxyable(); + return value; } /**