diff --git a/Libraries/CustomComponents/Navigator/Navigation/NavigationEvent.js b/Libraries/CustomComponents/Navigator/Navigation/NavigationEvent.js index 5307e1f86..797097cac 100644 --- a/Libraries/CustomComponents/Navigator/Navigation/NavigationEvent.js +++ b/Libraries/CustomComponents/Navigator/Navigation/NavigationEvent.js @@ -27,7 +27,7 @@ */ 'use strict'; -var invariant = require('fbjs/lib/invariant'); +const invariant = require('fbjs/lib/invariant'); class NavigationEventPool { _list: Array; @@ -37,7 +37,7 @@ class NavigationEventPool { } get(type: string, currentTarget: Object, data: any): NavigationEvent { - var event; + let event; if (this._list.length > 0) { event = this._list.pop(); 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. @@ -87,7 +87,7 @@ class NavigationEvent { _defaultPrevented: boolean; _disposed: boolean; _propagationStopped: boolean; - _type: ?string; + _type: string; target: ?Object; @@ -111,22 +111,18 @@ class NavigationEvent { this._propagationStopped = false; } - /* $FlowFixMe - get/set properties not yet supported */ get type(): string { return this._type; } - /* $FlowFixMe - get/set properties not yet supported */ - get currentTarget(): Object { + get currentTarget(): ?Object { return this._currentTarget; } - /* $FlowFixMe - get/set properties not yet supported */ get data(): any { return this._data; } - /* $FlowFixMe - get/set properties not yet supported */ get defaultPrevented(): boolean { return this._defaultPrevented; } @@ -160,7 +156,7 @@ class NavigationEvent { // Clean up. this.target = null; this.eventPhase = NavigationEvent.NONE; - this._type = null; + this._type = ''; this._currentTarget = null; this._data = null; this._defaultPrevented = false; diff --git a/Libraries/CustomComponents/Navigator/Navigation/NavigationRouteStack.js b/Libraries/CustomComponents/Navigator/Navigation/NavigationRouteStack.js index f73ab10f0..3290ba462 100644 --- a/Libraries/CustomComponents/Navigator/Navigation/NavigationRouteStack.js +++ b/Libraries/CustomComponents/Navigator/Navigation/NavigationRouteStack.js @@ -61,12 +61,10 @@ class RouteStack { this._index = index; } - /* $FlowFixMe - get/set properties not yet supported */ get size(): number { return this._routeNodes.size; } - /* $FlowFixMe - get/set properties not yet supported */ get index(): number { return this._index; } diff --git a/Libraries/Network/XMLHttpRequest.js b/Libraries/Network/XMLHttpRequest.js index 529c2af64..793a9c13c 100644 --- a/Libraries/Network/XMLHttpRequest.js +++ b/Libraries/Network/XMLHttpRequest.js @@ -134,12 +134,10 @@ class XMLHttpRequest extends EventTarget(...XHR_EVENTS) { this._timedOut = false; } - // $FlowIssue #10784535 get responseType(): ResponseType { return this._responseType; } - // $FlowIssue #10784535 set responseType(responseType: ResponseType): void { if (this._sent) { throw new Error( @@ -163,11 +161,10 @@ class XMLHttpRequest extends EventTarget(...XHR_EVENTS) { this._responseType = responseType; } - // $FlowIssue #10784535 get responseText(): string { if (this._responseType !== '' && this._responseType !== 'text') { 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}'.` ); } @@ -177,7 +174,6 @@ class XMLHttpRequest extends EventTarget(...XHR_EVENTS) { return this._response; } - // $FlowIssue #10784535 get response(): Response { const {responseType} = this; if (responseType === '' || responseType === 'text') {