File tree 2 files changed +16
-24
lines changed
packages/svelte/src/internal/client/dom/elements 2 files changed +16
-24
lines changed Original file line number Diff line number Diff line change @@ -193,18 +193,14 @@ if (typeof HTMLElement === 'function') {
193
193
disconnectedCallback ( ) {
194
194
this . $$cn = false ;
195
195
// In a microtask, because this could be a move within the DOM
196
- Promise . resolve ( )
197
- . then ( ( ) => {
198
- if ( ! this . $$cn && this . $$c ) {
199
- this . $$c . $destroy ( ) ;
200
- destroy_effect ( this . $$me ) ;
201
- this . $$c = undefined ;
202
- }
203
- } )
204
- . catch ( ( err ) => {
205
- // eslint-disable-next-line no-console
206
- console . error ( err ) ;
207
- } ) ;
196
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
197
+ Promise . resolve ( ) . then ( ( ) => {
198
+ if ( ! this . $$cn && this . $$c ) {
199
+ this . $$c . $destroy ( ) ;
200
+ destroy_effect ( this . $$me ) ;
201
+ this . $$c = undefined ;
202
+ }
203
+ } ) ;
208
204
}
209
205
210
206
/**
Original file line number Diff line number Diff line change @@ -42,19 +42,15 @@ export function add_form_reset_listener() {
42
42
( evt ) => {
43
43
// Needs to happen one tick later or else the dom properties of the form
44
44
// elements have not updated to their reset values yet
45
- Promise . resolve ( )
46
- . then ( ( ) => {
47
- if ( ! evt . defaultPrevented ) {
48
- for ( const e of /**@type {HTMLFormElement } */ ( evt . target ) . elements ) {
49
- // @ts -expect-error
50
- e . __on_r ?. ( ) ;
51
- }
45
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
46
+ Promise . resolve ( ) . then ( ( ) => {
47
+ if ( ! evt . defaultPrevented ) {
48
+ for ( const e of /**@type {HTMLFormElement } */ ( evt . target ) . elements ) {
49
+ // @ts -expect-error
50
+ e . __on_r ?. ( ) ;
52
51
}
53
- } )
54
- . catch ( ( err ) => {
55
- // eslint-disable-next-line no-console
56
- console . error ( err ) ;
57
- } ) ;
52
+ }
53
+ } ) ;
58
54
} ,
59
55
// In the capture phase to guarantee we get noticed of it (no possiblity of stopPropagation)
60
56
{ capture : true }
You can’t perform that action at this time.
0 commit comments