File tree 1 file changed +3
-3
lines changed
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 {
220
220
}
221
221
222
222
// 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 > {
224
224
await new Promise ( resolve => setTimeout ( resolve , 0 ) )
225
225
for ( const eventType of eventsToDispatch ) {
226
- this . dispatchEvent ( new Event ( eventType ) )
226
+ this . dispatchEvent ( error ? new CustomEvent ( eventType , { detail : { error } } ) : new Event ( eventType ) )
227
227
}
228
228
}
229
229
@@ -258,7 +258,7 @@ export class IncludeFragmentElement extends HTMLElement {
258
258
// Dispatch `error` and `loadend` async to allow
259
259
// the `load()` promise to resolve _before_ these
260
260
// events are fired.
261
- this . #task( [ 'error' , 'loadend' ] )
261
+ this . #task( [ 'error' , 'loadend' ] , error )
262
262
throw error
263
263
}
264
264
}
You can’t perform that action at this time.
0 commit comments