File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -220,10 +220,10 @@ export class IncludeFragmentElement extends HTMLElement {
220220 }
221221
222222 // Functional stand in for the W3 spec "queue a task" paradigm
223- async #task( eventsToDispatch : string [ ] ) : Promise < void > {
223+ async #task( eventsToDispatch : string [ ] , error ?: Error ) : Promise < void > {
224224 await new Promise ( resolve => setTimeout ( resolve , 0 ) )
225225 for ( const eventType of eventsToDispatch ) {
226- this . dispatchEvent ( new Event ( eventType ) )
226+ this . dispatchEvent ( error ? new CustomEvent ( eventType , { detail : { error } } ) : new Event ( eventType ) )
227227 }
228228 }
229229
@@ -258,7 +258,7 @@ export class IncludeFragmentElement extends HTMLElement {
258258 // Dispatch `error` and `loadend` async to allow
259259 // the `load()` promise to resolve _before_ these
260260 // events are fired.
261- this . #task( [ 'error' , 'loadend' ] )
261+ this . #task( [ 'error' , 'loadend' ] , error )
262262 throw error
263263 }
264264 }
You can’t perform that action at this time.
0 commit comments