Skip to content

Commit 06811f0

Browse files
committed
WIP
1 parent 0c9f898 commit 06811f0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/svelte/src/internal/client/dev/tracing.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ export function log_trace(fn, label) {
8383
* @param {string} label
8484
*/
8585
export function trace(fn, label, computed) {
86+
// If we aren't capturing the trace, just return the value
87+
if (tracing_expressions === null) {
88+
return fn();
89+
}
8690
var previously_tracing_expressions = tracing_expressions;
8791
var previously_tracing_expression_reactive = tracing_expression_reactive;
8892

@@ -120,7 +124,6 @@ export function trace(fn, label, computed) {
120124
previously_tracing_expressions.push(...tracing_expressions);
121125
}
122126
} else if (
123-
previously_tracing_expressions !== null &&
124127
previously_tracing_expressions.length !== 0
125128
) {
126129
previously_tracing_expressions.push({

0 commit comments

Comments
 (0)