Skip to content

Commit

Permalink
use define_property
Browse files Browse the repository at this point in the history
  • Loading branch information
dummdidumm committed Sep 13, 2024
1 parent 06f1b42 commit c046928
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/svelte/src/internal/client/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,17 +468,18 @@ function infinite_loop_guard() {
if (DEV) {
try {
e.effect_update_depth_exceeded();
} catch (e) {
} catch (error) {
// stack is garbage, ignore. Instead add a console.error message.
define_property(error, 'stack', {
value: ''
});
// eslint-disable-next-line no-console
console.error(
'Last ten effects were: ',
dev_effect_stack.slice(-10).map((d) => d.fn)
);
dev_effect_stack = [];
// @ts-expect-error
e.stack = '';
throw e;
throw error;
}
} else {
e.effect_update_depth_exceeded();
Expand Down

0 comments on commit c046928

Please sign in to comment.