File tree Expand file tree Collapse file tree 2 files changed +16
-24
lines changed
packages/svelte/src/internal/client/dom/elements Expand file tree Collapse file tree 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') {
193193 disconnectedCallback ( ) {
194194 this . $$cn = false ;
195195 // 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+ } ) ;
208204 }
209205
210206 /**
Original file line number Diff line number Diff line change @@ -42,19 +42,15 @@ export function add_form_reset_listener() {
4242 ( evt ) => {
4343 // Needs to happen one tick later or else the dom properties of the form
4444 // 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 ?. ( ) ;
5251 }
53- } )
54- . catch ( ( err ) => {
55- // eslint-disable-next-line no-console
56- console . error ( err ) ;
57- } ) ;
52+ }
53+ } ) ;
5854 } ,
5955 // In the capture phase to guarantee we get noticed of it (no possiblity of stopPropagation)
6056 { capture : true }
You can’t perform that action at this time.
0 commit comments