File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export function createMicroFetch (url: string, target?: Window['fetch']): Window
4747export function createMicroXMLHttpRequest ( url : string , target ?: XMLHttpRequest ) : any {
4848 const rawXMLHttpRequest = ! isUndefined ( target ) ? target : globalEnv . rawWindow . XMLHttpRequest
4949 if ( ! isConstructor ( rawXMLHttpRequest ) ) return rawXMLHttpRequest
50- return class MicroXMLHttpRequest extends rawXMLHttpRequest {
50+ class MicroXMLHttpRequest extends rawXMLHttpRequest {
5151 open ( method : string , reqUrl : string , ...rests : unknown [ ] ) : void {
5252 if ( ( isString ( reqUrl ) && ! / ^ f ( i l e | t p ) : \/ \/ / . test ( reqUrl ) ) || isURL ( reqUrl ) ) {
5353 reqUrl = createURL ( reqUrl , url ) . toString ( )
@@ -56,6 +56,9 @@ export function createMicroXMLHttpRequest (url: string, target?: XMLHttpRequest)
5656 super . open ( method , reqUrl , ...rests )
5757 }
5858 }
59+ // The methods defined by class are hung on the prototype, and enumerable is false by default
60+ MicroXMLHttpRequest . prototype && Object . defineProperty ( MicroXMLHttpRequest . prototype , 'open' , { enumerable : true } )
61+ return MicroXMLHttpRequest
5962}
6063
6164export interface EventSourceInstance {
You can’t perform that action at this time.
0 commit comments