This repository was archived by the owner on Feb 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -146,7 +146,13 @@ function patchClass(className) {
146146 } ) ;
147147 }
148148 } ( prop ) ) ;
149- } ;
149+ }
150+
151+ for ( prop in OriginalClass ) {
152+ if ( prop !== 'prototype' && OriginalClass . hasOwnProperty ( prop ) ) {
153+ global [ className ] [ prop ] = OriginalClass [ prop ] ;
154+ }
155+ }
150156} ;
151157
152158module . exports = {
Original file line number Diff line number Diff line change @@ -21,11 +21,11 @@ describe('XMLHttpRequest', function () {
2121 req . send ( ) ;
2222 } ) ;
2323
24- var supportsOnProgress = function ( ) {
24+ var supportsOnProgress = function ( ) {
2525 return 'onprogress' in new XMLHttpRequest ( ) ;
2626 }
2727 supportsOnProgress . message = "XMLHttpRequest.onprogress" ;
28-
28+
2929 describe ( 'onprogress' , ifEnvSupports ( supportsOnProgress , function ( ) {
3030 it ( 'should work with onprogress' , function ( done ) {
3131 var req ;
@@ -52,5 +52,12 @@ describe('XMLHttpRequest', function () {
5252 expect ( req . responseType ) . toBe ( 'document' ) ;
5353 } ) ;
5454
55+ it ( 'should preserve static constants' , function ( ) {
56+ expect ( XMLHttpRequest . UNSENT ) . toEqual ( 0 ) ;
57+ expect ( XMLHttpRequest . OPENED ) . toEqual ( 1 ) ;
58+ expect ( XMLHttpRequest . HEADERS_RECEIVED ) . toEqual ( 2 ) ;
59+ expect ( XMLHttpRequest . LOADING ) . toEqual ( 3 ) ;
60+ expect ( XMLHttpRequest . DONE ) . toEqual ( 4 ) ;
61+ } ) ;
5562} ) ;
5663
You can’t perform that action at this time.
0 commit comments