mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-29 04:35:36 +08:00
new XMLHttpRequest().status is a number, not a string
Summary: See http://www.w3.org/TR/XMLHttpRequest/#interface-xmlhttprequest Closes https://github.com/facebook/react-native/pull/1356 Github Author: Philipp von Weitershausen <philikon@fb.com> Test Plan: Imported from GitHub, without a `Test Plan:` line.
This commit is contained in:
@@ -23,7 +23,7 @@ class XMLHttpRequestBase {
|
|||||||
readyState: number;
|
readyState: number;
|
||||||
responseHeaders: ?Object;
|
responseHeaders: ?Object;
|
||||||
responseText: ?string;
|
responseText: ?string;
|
||||||
status: ?string;
|
status: number;
|
||||||
|
|
||||||
_method: ?string;
|
_method: ?string;
|
||||||
_url: ?string;
|
_url: ?string;
|
||||||
@@ -43,7 +43,7 @@ class XMLHttpRequestBase {
|
|||||||
this.readyState = this.UNSENT;
|
this.readyState = this.UNSENT;
|
||||||
this.responseHeaders = undefined;
|
this.responseHeaders = undefined;
|
||||||
this.responseText = undefined;
|
this.responseText = undefined;
|
||||||
this.status = undefined;
|
this.status = 0;
|
||||||
|
|
||||||
this._method = null;
|
this._method = null;
|
||||||
this._url = null;
|
this._url = null;
|
||||||
@@ -127,7 +127,7 @@ class XMLHttpRequestBase {
|
|||||||
this._aborted = true;
|
this._aborted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
callback(status: string, responseHeaders: ?Object, responseText: string): void {
|
callback(status: number, responseHeaders: ?Object, responseText: string): void {
|
||||||
if (this._aborted) {
|
if (this._aborted) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user