Skip to content

Commit 6c563a5

Browse files
pietervfacebook-github-bot
authored andcommitted
Suppress missing 'this' annotations in xplat/js
Reviewed By: samwgoldman Differential Revision: D37701888 fbshipit-source-id: 80cf21e4c942f00695c08ea8671efba0109aad32
1 parent 08f6b85 commit 6c563a5

File tree

8 files changed

+62
-0
lines changed

8 files changed

+62
-0
lines changed

Libraries/Components/Touchable/PooledClass.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import invariant from 'invariant';
1818
* the Class itself, not an instance. If any others are needed, simply add them
1919
* here, or in their own files.
2020
*/
21+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
22+
* Flow's LTI update could not be added via codemod */
2123
const oneArgumentPooler = function (copyFieldsFrom: any) {
2224
const Klass = this; // eslint-disable-line consistent-this
2325
if (Klass.instancePool.length) {
@@ -29,6 +31,8 @@ const oneArgumentPooler = function (copyFieldsFrom: any) {
2931
}
3032
};
3133

34+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
35+
* Flow's LTI update could not be added via codemod */
3236
const twoArgumentPooler = function (a1: any, a2: any) {
3337
const Klass = this; // eslint-disable-line consistent-this
3438
if (Klass.instancePool.length) {
@@ -40,6 +44,8 @@ const twoArgumentPooler = function (a1: any, a2: any) {
4044
}
4145
};
4246

47+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
48+
* Flow's LTI update could not be added via codemod */
4349
const threeArgumentPooler = function (a1: any, a2: any, a3: any) {
4450
const Klass = this; // eslint-disable-line consistent-this
4551
if (Klass.instancePool.length) {
@@ -51,6 +57,8 @@ const threeArgumentPooler = function (a1: any, a2: any, a3: any) {
5157
}
5258
};
5359

60+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
61+
* Flow's LTI update could not be added via codemod */
5462
const fourArgumentPooler = function (a1: any, a2: any, a3: any, a4: any) {
5563
const Klass = this; // eslint-disable-line consistent-this
5664
if (Klass.instancePool.length) {
@@ -64,6 +72,8 @@ const fourArgumentPooler = function (a1: any, a2: any, a3: any, a4: any) {
6472

6573
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's
6674
* LTI update could not be added via codemod */
75+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
76+
* Flow's LTI update could not be added via codemod */
6777
const standardReleaser = function (instance) {
6878
const Klass = this; // eslint-disable-line consistent-this
6979
invariant(

Libraries/Components/Touchable/Touchable.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,8 @@ const TouchableMixin = {
381381
/**
382382
* Clear all timeouts on unmount
383383
*/
384+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
385+
* Flow's LTI update could not be added via codemod */
384386
componentWillUnmount: function () {
385387
this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout);
386388
this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout);
@@ -406,13 +408,17 @@ const TouchableMixin = {
406408
/**
407409
* Must return true if embedded in a native platform scroll view.
408410
*/
411+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
412+
* Flow's LTI update could not be added via codemod */
409413
touchableHandleResponderTerminationRequest: function (): any {
410414
return !this.props.rejectResponderTermination;
411415
},
412416

413417
/**
414418
* Must return true to start the process of `Touchable`.
415419
*/
420+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
421+
* Flow's LTI update could not be added via codemod */
416422
touchableHandleStartShouldSetResponder: function (): any {
417423
return !this.props.disabled;
418424
},
@@ -429,6 +435,8 @@ const TouchableMixin = {
429435
* @param {SyntheticEvent} e Synthetic event from event system.
430436
*
431437
*/
438+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
439+
* Flow's LTI update could not be added via codemod */
432440
touchableHandleResponderGrant: function (e: PressEvent) {
433441
const dispatchID = e.currentTarget;
434442
// Since e is used in a callback invoked on another event loop
@@ -470,6 +478,8 @@ const TouchableMixin = {
470478
/**
471479
* Place as callback for a DOM element's `onResponderRelease` event.
472480
*/
481+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
482+
* Flow's LTI update could not be added via codemod */
473483
touchableHandleResponderRelease: function (e: PressEvent) {
474484
this.pressInLocation = null;
475485
this._receiveSignal(Signals.RESPONDER_RELEASE, e);
@@ -478,6 +488,8 @@ const TouchableMixin = {
478488
/**
479489
* Place as callback for a DOM element's `onResponderTerminate` event.
480490
*/
491+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
492+
* Flow's LTI update could not be added via codemod */
481493
touchableHandleResponderTerminate: function (e: PressEvent) {
482494
this.pressInLocation = null;
483495
this._receiveSignal(Signals.RESPONDER_TERMINATED, e);
@@ -486,6 +498,8 @@ const TouchableMixin = {
486498
/**
487499
* Place as callback for a DOM element's `onResponderMove` event.
488500
*/
501+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
502+
* Flow's LTI update could not be added via codemod */
489503
touchableHandleResponderMove: function (e: PressEvent) {
490504
// Measurement may not have returned yet.
491505
if (!this.state.touchable.positionOnActivate) {
@@ -571,6 +585,8 @@ const TouchableMixin = {
571585
* element that was blurred just prior to this. This can be overridden when
572586
* using `Touchable.Mixin.withoutDefaultFocusAndBlur`.
573587
*/
588+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
589+
* Flow's LTI update could not be added via codemod */
574590
touchableHandleFocus: function (e: Event) {
575591
this.props.onFocus && this.props.onFocus(e);
576592
},
@@ -583,6 +599,8 @@ const TouchableMixin = {
583599
* This can be overridden when using
584600
* `Touchable.Mixin.withoutDefaultFocusAndBlur`.
585601
*/
602+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
603+
* Flow's LTI update could not be added via codemod */
586604
touchableHandleBlur: function (e: Event) {
587605
this.props.onBlur && this.props.onBlur(e);
588606
},
@@ -663,6 +681,8 @@ const TouchableMixin = {
663681
* @sideeffects
664682
* @private
665683
*/
684+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
685+
* Flow's LTI update could not be added via codemod */
666686
_remeasureMetricsOnActivation: function () {
667687
const responderID = this.state.touchable.responderID;
668688
if (responderID == null) {
@@ -676,6 +696,8 @@ const TouchableMixin = {
676696
}
677697
},
678698

699+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
700+
* Flow's LTI update could not be added via codemod */
679701
_handleQueryLayout: function (
680702
l: number,
681703
t: number,
@@ -702,11 +724,15 @@ const TouchableMixin = {
702724
);
703725
},
704726

727+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
728+
* Flow's LTI update could not be added via codemod */
705729
_handleDelay: function (e: PressEvent) {
706730
this.touchableDelayTimeout = null;
707731
this._receiveSignal(Signals.DELAY, e);
708732
},
709733

734+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
735+
* Flow's LTI update could not be added via codemod */
710736
_handleLongDelay: function (e: PressEvent) {
711737
this.longPressDelayTimeout = null;
712738
const curState = this.state.touchable.touchState;
@@ -726,6 +752,8 @@ const TouchableMixin = {
726752
* @throws Error if invalid state transition or unrecognized signal.
727753
* @sideeffects
728754
*/
755+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
756+
* Flow's LTI update could not be added via codemod */
729757
_receiveSignal: function (signal: Signal, e: PressEvent) {
730758
const responderID = this.state.touchable.responderID;
731759
const curState = this.state.touchable.touchState;
@@ -765,6 +793,8 @@ const TouchableMixin = {
765793
}
766794
},
767795

796+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
797+
* Flow's LTI update could not be added via codemod */
768798
_cancelLongPressDelayTimeout: function () {
769799
this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout);
770800
this.longPressDelayTimeout = null;
@@ -777,6 +807,8 @@ const TouchableMixin = {
777807
);
778808
},
779809

810+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
811+
* Flow's LTI update could not be added via codemod */
780812
_savePressInLocation: function (e: PressEvent) {
781813
const touch = extractSingleTouch(e.nativeEvent);
782814
const pageX = touch && touch.pageX;
@@ -808,6 +840,8 @@ const TouchableMixin = {
808840
* @param {Event} e Native event.
809841
* @sideeffects
810842
*/
843+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
844+
* Flow's LTI update could not be added via codemod */
811845
_performSideEffectsForTransition: function (
812846
curState: State,
813847
nextState: State,
@@ -869,11 +903,15 @@ const TouchableMixin = {
869903
this.touchableDelayTimeout = null;
870904
},
871905

906+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
907+
* Flow's LTI update could not be added via codemod */
872908
_startHighlight: function (e: PressEvent) {
873909
this._savePressInLocation(e);
874910
this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e);
875911
},
876912

913+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
914+
* Flow's LTI update could not be added via codemod */
877915
_endHighlight: function (e: PressEvent) {
878916
if (this.touchableHandleActivePressOut) {
879917
if (

Libraries/Storage/AsyncStorage.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,8 @@ const AsyncStorage = {
198198
*
199199
* See https://reactnative.dev/docs/asyncstorage#flushgetrequests
200200
* */
201+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
202+
* Flow's LTI update could not be added via codemod */
201203
flushGetRequests: function (): void {
202204
const getRequests = this._getRequests;
203205
const getKeys = this._getKeys;
@@ -237,6 +239,8 @@ const AsyncStorage = {
237239
*
238240
* See https://reactnative.dev/docs/asyncstorage#multiget
239241
*/
242+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
243+
* Flow's LTI update could not be added via codemod */
240244
multiGet: function (
241245
keys: Array<string>,
242246
callback?: ?(errors: ?Array<Error>, result: ?Array<Array<string>>) => void,

Libraries/StyleSheet/processTransform.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ function processTransform(
116116
/**
117117
* Performs a destructive operation on a transform matrix.
118118
*/
119+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
120+
* Flow's LTI update could not be added via codemod */
119121
function _multiplyTransform(
120122
result: Array<number>,
121123
matrixMathFunction: Function,

Libraries/Utilities/stringifySafe.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ export function createStringifySafeWithLimits(limits: {|
2727
maxObjectKeysLimit = Number.POSITIVE_INFINITY,
2828
} = limits;
2929
const stack = [];
30+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
31+
* Flow's LTI update could not be added via codemod */
3032
function replacer(key: string, value: mixed): mixed {
3133
while (stack.length && this !== stack[0]) {
3234
stack.shift();

Libraries/vendor/emitter/__tests__/EventEmitter-test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ describe('arguments and context', () => {
118118

119119
const context = {};
120120
let result;
121+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
122+
* Flow's LTI update could not be added via codemod */
121123
const listener = jest.fn(function () {
122124
result = this;
123125
});

packages/polyfills/error-guard.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ const ErrorUtils = {
102102
return null;
103103
}
104104
const guardName = name ?? fun.name ?? '<generated guard>';
105+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s) required by
106+
* Flow's LTI update could not be added via codemod */
105107
function guarded(...args: TArgs): ?TOut {
106108
return ErrorUtils.applyWithGuard(
107109
fun,

packages/rn-tester/js/examples/AnimatedGratuitousApp/AnExApp.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ class AnExApp extends React.Component<any, any> {
237237
if (!this.state.restLayouts[idx]) {
238238
/* $FlowFixMe[missing-local-annot] The type annotation(s) required by
239239
* Flow's LTI update could not be added via codemod */
240+
/* $FlowFixMe[missing-this-annot] The 'this' type annotation(s)
241+
* required by Flow's LTI update could not be added via codemod */
240242
onLayout = function (index, e) {
241243
const layout = e.nativeEvent.layout;
242244
this.setState(state => {

0 commit comments

Comments
 (0)