This repository was archived by the owner on Feb 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,13 @@ function patchClass(className) {
146
146
} ) ;
147
147
}
148
148
} ( prop ) ) ;
149
- } ;
149
+ }
150
+
151
+ for ( prop in OriginalClass ) {
152
+ if ( prop !== 'prototype' && OriginalClass . hasOwnProperty ( prop ) ) {
153
+ global [ className ] [ prop ] = OriginalClass [ prop ] ;
154
+ }
155
+ }
150
156
} ;
151
157
152
158
module . exports = {
Original file line number Diff line number Diff line change @@ -21,11 +21,11 @@ describe('XMLHttpRequest', function () {
21
21
req . send ( ) ;
22
22
} ) ;
23
23
24
- var supportsOnProgress = function ( ) {
24
+ var supportsOnProgress = function ( ) {
25
25
return 'onprogress' in new XMLHttpRequest ( ) ;
26
26
}
27
27
supportsOnProgress . message = "XMLHttpRequest.onprogress" ;
28
-
28
+
29
29
describe ( 'onprogress' , ifEnvSupports ( supportsOnProgress , function ( ) {
30
30
it ( 'should work with onprogress' , function ( done ) {
31
31
var req ;
@@ -52,5 +52,12 @@ describe('XMLHttpRequest', function () {
52
52
expect ( req . responseType ) . toBe ( 'document' ) ;
53
53
} ) ;
54
54
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
+ } ) ;
55
62
} ) ;
56
63
You can’t perform that action at this time.
0 commit comments