Skip to content

Commit 9bfa393

Browse files
davidaurelioFacebook Github Bot 1
authored andcommitted
fix new flow errors after D3561327
Reviewed By: bestander Differential Revision: D3561376 fbshipit-source-id: 226f0d1c6a771a987f9e04f114dc3ba1cca531b1
1 parent f5ba169 commit 9bfa393

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

Libraries/CustomComponents/Navigator/Navigation/NavigationEvent.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
*/
2828
'use strict';
2929

30-
var invariant = require('fbjs/lib/invariant');
30+
const invariant = require('fbjs/lib/invariant');
3131

3232
class NavigationEventPool {
3333
_list: Array<any>;
@@ -37,7 +37,7 @@ class NavigationEventPool {
3737
}
3838

3939
get(type: string, currentTarget: Object, data: any): NavigationEvent {
40-
var event;
40+
let event;
4141
if (this._list.length > 0) {
4242
event = this._list.pop();
4343
event.constructor.call(event, type, currentTarget, data);
@@ -52,7 +52,7 @@ class NavigationEventPool {
5252
}
5353
}
5454

55-
var _navigationEventPool = new NavigationEventPool();
55+
const _navigationEventPool = new NavigationEventPool();
5656

5757
/**
5858
* The NavigationEvent interface represents any event of the navigation.
@@ -87,7 +87,7 @@ class NavigationEvent {
8787
_defaultPrevented: boolean;
8888
_disposed: boolean;
8989
_propagationStopped: boolean;
90-
_type: ?string;
90+
_type: string;
9191

9292
target: ?Object;
9393

@@ -111,22 +111,18 @@ class NavigationEvent {
111111
this._propagationStopped = false;
112112
}
113113

114-
/* $FlowFixMe - get/set properties not yet supported */
115114
get type(): string {
116115
return this._type;
117116
}
118117

119-
/* $FlowFixMe - get/set properties not yet supported */
120-
get currentTarget(): Object {
118+
get currentTarget(): ?Object {
121119
return this._currentTarget;
122120
}
123121

124-
/* $FlowFixMe - get/set properties not yet supported */
125122
get data(): any {
126123
return this._data;
127124
}
128125

129-
/* $FlowFixMe - get/set properties not yet supported */
130126
get defaultPrevented(): boolean {
131127
return this._defaultPrevented;
132128
}
@@ -160,7 +156,7 @@ class NavigationEvent {
160156
// Clean up.
161157
this.target = null;
162158
this.eventPhase = NavigationEvent.NONE;
163-
this._type = null;
159+
this._type = '';
164160
this._currentTarget = null;
165161
this._data = null;
166162
this._defaultPrevented = false;

Libraries/CustomComponents/Navigator/Navigation/NavigationRouteStack.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,10 @@ class RouteStack {
6161
this._index = index;
6262
}
6363

64-
/* $FlowFixMe - get/set properties not yet supported */
6564
get size(): number {
6665
return this._routeNodes.size;
6766
}
6867

69-
/* $FlowFixMe - get/set properties not yet supported */
7068
get index(): number {
7169
return this._index;
7270
}

Libraries/Network/XMLHttpRequest.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,10 @@ class XMLHttpRequest extends EventTarget(...XHR_EVENTS) {
134134
this._timedOut = false;
135135
}
136136

137-
// $FlowIssue #10784535
138137
get responseType(): ResponseType {
139138
return this._responseType;
140139
}
141140

142-
// $FlowIssue #10784535
143141
set responseType(responseType: ResponseType): void {
144142
if (this._sent) {
145143
throw new Error(
@@ -163,11 +161,10 @@ class XMLHttpRequest extends EventTarget(...XHR_EVENTS) {
163161
this._responseType = responseType;
164162
}
165163

166-
// $FlowIssue #10784535
167164
get responseText(): string {
168165
if (this._responseType !== '' && this._responseType !== 'text') {
169166
throw new Error(
170-
`The 'responseText' property is only available if 'responseType' ` +
167+
"The 'responseText' property is only available if 'responseType' " +
171168
`is set to '' or 'text', but it is '${this._responseType}'.`
172169
);
173170
}
@@ -177,7 +174,6 @@ class XMLHttpRequest extends EventTarget(...XHR_EVENTS) {
177174
return this._response;
178175
}
179176

180-
// $FlowIssue #10784535
181177
get response(): Response {
182178
const {responseType} = this;
183179
if (responseType === '' || responseType === 'text') {

0 commit comments

Comments
 (0)