mirror of
https://github.com/status-im/react-native.git
synced 2025-01-14 11:34:23 +00:00
fix new flow errors after D3561327
Reviewed By: bestander Differential Revision: D3561376 fbshipit-source-id: 226f0d1c6a771a987f9e04f114dc3ba1cca531b1
This commit is contained in:
parent
f5ba1693fe
commit
9bfa393a79
@ -27,7 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var invariant = require('fbjs/lib/invariant');
|
const invariant = require('fbjs/lib/invariant');
|
||||||
|
|
||||||
class NavigationEventPool {
|
class NavigationEventPool {
|
||||||
_list: Array<any>;
|
_list: Array<any>;
|
||||||
@ -37,7 +37,7 @@ class NavigationEventPool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get(type: string, currentTarget: Object, data: any): NavigationEvent {
|
get(type: string, currentTarget: Object, data: any): NavigationEvent {
|
||||||
var event;
|
let event;
|
||||||
if (this._list.length > 0) {
|
if (this._list.length > 0) {
|
||||||
event = this._list.pop();
|
event = this._list.pop();
|
||||||
event.constructor.call(event, type, currentTarget, data);
|
event.constructor.call(event, type, currentTarget, data);
|
||||||
@ -52,7 +52,7 @@ class NavigationEventPool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var _navigationEventPool = new NavigationEventPool();
|
const _navigationEventPool = new NavigationEventPool();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The NavigationEvent interface represents any event of the navigation.
|
* The NavigationEvent interface represents any event of the navigation.
|
||||||
@ -87,7 +87,7 @@ class NavigationEvent {
|
|||||||
_defaultPrevented: boolean;
|
_defaultPrevented: boolean;
|
||||||
_disposed: boolean;
|
_disposed: boolean;
|
||||||
_propagationStopped: boolean;
|
_propagationStopped: boolean;
|
||||||
_type: ?string;
|
_type: string;
|
||||||
|
|
||||||
target: ?Object;
|
target: ?Object;
|
||||||
|
|
||||||
@ -111,22 +111,18 @@ class NavigationEvent {
|
|||||||
this._propagationStopped = false;
|
this._propagationStopped = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* $FlowFixMe - get/set properties not yet supported */
|
|
||||||
get type(): string {
|
get type(): string {
|
||||||
return this._type;
|
return this._type;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* $FlowFixMe - get/set properties not yet supported */
|
get currentTarget(): ?Object {
|
||||||
get currentTarget(): Object {
|
|
||||||
return this._currentTarget;
|
return this._currentTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* $FlowFixMe - get/set properties not yet supported */
|
|
||||||
get data(): any {
|
get data(): any {
|
||||||
return this._data;
|
return this._data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* $FlowFixMe - get/set properties not yet supported */
|
|
||||||
get defaultPrevented(): boolean {
|
get defaultPrevented(): boolean {
|
||||||
return this._defaultPrevented;
|
return this._defaultPrevented;
|
||||||
}
|
}
|
||||||
@ -160,7 +156,7 @@ class NavigationEvent {
|
|||||||
// Clean up.
|
// Clean up.
|
||||||
this.target = null;
|
this.target = null;
|
||||||
this.eventPhase = NavigationEvent.NONE;
|
this.eventPhase = NavigationEvent.NONE;
|
||||||
this._type = null;
|
this._type = '';
|
||||||
this._currentTarget = null;
|
this._currentTarget = null;
|
||||||
this._data = null;
|
this._data = null;
|
||||||
this._defaultPrevented = false;
|
this._defaultPrevented = false;
|
||||||
|
@ -61,12 +61,10 @@ class RouteStack {
|
|||||||
this._index = index;
|
this._index = index;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* $FlowFixMe - get/set properties not yet supported */
|
|
||||||
get size(): number {
|
get size(): number {
|
||||||
return this._routeNodes.size;
|
return this._routeNodes.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* $FlowFixMe - get/set properties not yet supported */
|
|
||||||
get index(): number {
|
get index(): number {
|
||||||
return this._index;
|
return this._index;
|
||||||
}
|
}
|
||||||
|
@ -134,12 +134,10 @@ class XMLHttpRequest extends EventTarget(...XHR_EVENTS) {
|
|||||||
this._timedOut = false;
|
this._timedOut = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// $FlowIssue #10784535
|
|
||||||
get responseType(): ResponseType {
|
get responseType(): ResponseType {
|
||||||
return this._responseType;
|
return this._responseType;
|
||||||
}
|
}
|
||||||
|
|
||||||
// $FlowIssue #10784535
|
|
||||||
set responseType(responseType: ResponseType): void {
|
set responseType(responseType: ResponseType): void {
|
||||||
if (this._sent) {
|
if (this._sent) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
@ -163,11 +161,10 @@ class XMLHttpRequest extends EventTarget(...XHR_EVENTS) {
|
|||||||
this._responseType = responseType;
|
this._responseType = responseType;
|
||||||
}
|
}
|
||||||
|
|
||||||
// $FlowIssue #10784535
|
|
||||||
get responseText(): string {
|
get responseText(): string {
|
||||||
if (this._responseType !== '' && this._responseType !== 'text') {
|
if (this._responseType !== '' && this._responseType !== 'text') {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`The 'responseText' property is only available if 'responseType' ` +
|
"The 'responseText' property is only available if 'responseType' " +
|
||||||
`is set to '' or 'text', but it is '${this._responseType}'.`
|
`is set to '' or 'text', but it is '${this._responseType}'.`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -177,7 +174,6 @@ class XMLHttpRequest extends EventTarget(...XHR_EVENTS) {
|
|||||||
return this._response;
|
return this._response;
|
||||||
}
|
}
|
||||||
|
|
||||||
// $FlowIssue #10784535
|
|
||||||
get response(): Response {
|
get response(): Response {
|
||||||
const {responseType} = this;
|
const {responseType} = this;
|
||||||
if (responseType === '' || responseType === 'text') {
|
if (responseType === '' || responseType === 'text') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user