Skip to content

Commit 99ca7a4

Browse files
authored
chore: create stack lazily when proxying value (#15547)
1 parent 701f085 commit 99ca7a4

File tree

1 file changed

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

1 file changed

+2
-5
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ import { tracing_mode_flag } from '../flags/index.js';
2525
* @returns {T}
2626
*/
2727
export function proxy(value, parent = null, prev) {
28-
/** @type {Error | null} */
29-
var stack = null;
30-
if (DEV && tracing_mode_flag) {
31-
stack = get_stack('CreatedAt');
32-
}
3328
// if non-proxyable, or is already a proxy, return `value`
3429
if (typeof value !== 'object' || value === null || STATE_SYMBOL in value) {
3530
return value;
@@ -46,6 +41,8 @@ export function proxy(value, parent = null, prev) {
4641
var is_proxied_array = is_array(value);
4742
var version = source(0);
4843

44+
var stack = DEV && tracing_mode_flag ? get_stack('CreatedAt') : null;
45+
4946
if (is_proxied_array) {
5047
// We need to create the length source eagerly to ensure that
5148
// mutations to the array are properly synced with our proxy

0 commit comments

Comments
 (0)