Browse Source

Fix XMLHttpRequest static property

Ben Hsieh 8 years ago
parent
commit
9c3d947d01
1 changed files with 4 additions and 3 deletions
  1. 4
    3
      src/polyfill/XMLHttpRequest.js

+ 4
- 3
src/polyfill/XMLHttpRequest.js View File

7
 import Log from '../utils/log.js'
7
 import Log from '../utils/log.js'
8
 import Blob from './Blob.js'
8
 import Blob from './Blob.js'
9
 import ProgressEvent from './ProgressEvent.js'
9
 import ProgressEvent from './ProgressEvent.js'
10
+import URIUtil from '../utils/uri'
10
 
11
 
11
 const log = new Log('XMLHttpRequest')
12
 const log = new Log('XMLHttpRequest')
12
 
13
 
124
     this._method = method
125
     this._method = method
125
     this._url = url
126
     this._url = url
126
     this._headers = {}
127
     this._headers = {}
127
-    this._increment = /^JSONStream\:\/\//.test(this._url)
128
+    this._increment = URIUtil.isJSONStreamURI(this._url)
128
     this._url = this._url.replace(/^JSONStream\:\/\//, '')
129
     this._url = this._url.replace(/^JSONStream\:\/\//, '')
129
     this._dispatchReadStateChange(XMLHttpRequest.OPENED)
130
     this._dispatchReadStateChange(XMLHttpRequest.OPENED)
130
-    
131
   }
131
   }
132
 
132
 
133
   /**
133
   /**
186
           .progress(this._progressEvent.bind(this))
186
           .progress(this._progressEvent.bind(this))
187
           .catch(this._onError.bind(this))
187
           .catch(this._onError.bind(this))
188
           .then(this._onDone.bind(this))
188
           .then(this._onDone.bind(this))
189
+
189
     })
190
     })
190
   }
191
   }
191
 
192
 
424
     return this._responseType
425
     return this._responseType
425
   }
426
   }
426
 
427
 
427
-  get isRNFBPolyfill() {
428
+  static get isRNFBPolyfill() {
428
     return true
429
     return true
429
   }
430
   }
430
 
431