File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ export default class IncludeFragmentElement extends HTMLElement {
6666 // We will return string or error for API backwards compatibility. We can consider
6767 // returning TrustedHTML in the future.
6868 get data ( ) : Promise < string > {
69- return this . #getStringOrErrorData ( )
69+ return this . #getStringData ( )
7070 }
7171
7272 #busy = false
@@ -118,7 +118,7 @@ export default class IncludeFragmentElement extends HTMLElement {
118118 }
119119
120120 load ( ) : Promise < string > {
121- return this . #getStringOrErrorData ( )
121+ return this . #getStringData ( )
122122 }
123123
124124 fetch ( request : RequestInfo ) : Promise < Response > {
@@ -194,12 +194,8 @@ export default class IncludeFragmentElement extends HTMLElement {
194194 }
195195 }
196196
197- async #getStringOrErrorData( ) : Promise < string > {
198- const data = await this . #getData( )
199- if ( data instanceof Error ) {
200- throw data
201- }
202- return data . toString ( )
197+ async #getStringData( ) : Promise < string > {
198+ return ( await this . #getData( ) ) . toString ( )
203199 }
204200
205201 // Functional stand in for the W3 spec "queue a task" paradigm
You can’t perform that action at this time.
0 commit comments