Skip to content

Commit 9abb98f

Browse files
committed
chore: tweak Map/Set for better inspect output
1 parent b597997 commit 9abb98f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

packages/svelte/src/reactivity/map.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ export class ReactiveMap extends Map {
123123

124124
clear() {
125125
var size = super.size;
126+
// Clear first, so we get nice console.log outputs with $inspect
126127
super.clear();
127128

128129
if (size !== 0) {

packages/svelte/src/reactivity/set.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ export class ReactiveSet extends Set {
118118

119119
clear() {
120120
var size = super.size;
121+
// Clear first, so we get nice console.log outputs with $inspect
121122
super.clear();
122123

123124
if (size !== 0) {

0 commit comments

Comments
 (0)