File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
sites/svelte-5-preview/src/lib/Output Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 140
140
// can get deeply read and tracked by accident when using the console. We can avoid this by
141
141
// ensuring we untrack the main console methods.
142
142
143
+ const original = {};
144
+
143
145
for (const method of console_methods) {
144
- const original = console [method];
146
+ original[method] = console [method];
145
147
console [method] = function (... v ) {
146
- return untrack (() => original .apply (this , v));
148
+ return untrack (() => original[method] .apply (this , v));
147
149
}
148
150
}
149
151
const component = mount (App, { target: document .body });
150
- window .__unmount_previous = () => unmount (component);
152
+ window .__unmount_previous = () => {
153
+ for (const method of console_methods) {
154
+ console [method] = original[method];
155
+ }
156
+ unmount (component);
157
+ }
151
158
}
152
159
// # sourceURL=playground:output
153
160
` );
You can’t perform that action at this time.
0 commit comments