Skip to content

Commit fdcce4f

Browse files
SamChou19815meta-codesync[bot]
authored andcommitted
Turn on experimental.new_this_typing in xplat (#58293)
Summary: Pull Request resolved: #58293 Changelog: [Internal] Reviewed By: vzaidman Differential Revision: D118513884 fbshipit-source-id: a33a81eab930ac29663410cf04163aebb87062ad
1 parent c148be6 commit fdcce4f

16 files changed

Lines changed: 82 additions & 0 deletions

File tree

packages/dev-middleware/src/inspector-proxy/Device.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,8 @@ export default class Device {
500500
// $FlowFixMe[cannot-write]
501501
socket.send = function (message: string) {
502502
cdpDebugLogging.log('ProxyToDebugger', message);
503+
/* $FlowFixMe[invalid-this-arg] Error exposed after fixing this typing
504+
* unsoundness in flow */
503505
return sendFunc.call(socket, message);
504506
};
505507
}

packages/react-native/Libraries/Animated/__tests__/AnimatedValue-itest.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,8 @@ describe('AnimatedValue', () => {
237237
// $FlowFixMe[method-unbinding]
238238
const original = node.__onAnimatedValueUpdateReceived;
239239
const spy = jest.fn((...args: Array<unknown>) =>
240+
/* $FlowFixMe[invalid-this-arg] Error exposed after fixing this typing
241+
* unsoundness in flow */
240242
original.apply(node, args),
241243
);
242244
// $FlowFixMe[cannot-write]

packages/react-native/Libraries/Animated/nodes/AnimatedProps.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,4 +384,6 @@ export default class AnimatedProps extends AnimatedNode {
384384
const _hasOwnProp = Object.prototype.hasOwnProperty;
385385
const hasOwn: (obj: Readonly<{...}>, prop: string) => boolean =
386386
// $FlowFixMe[method-unbinding]
387+
/* $FlowFixMe[invalid-this-arg] Error exposed after fixing this typing
388+
* unsoundness in flow */
387389
Object.hasOwn ?? ((obj, prop) => _hasOwnProp.call(obj, prop));

packages/react-native/Libraries/Animated/nodes/AnimatedStyle.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,4 +255,6 @@ export default class AnimatedStyle extends AnimatedWithChildren {
255255
const _hasOwnProp = Object.prototype.hasOwnProperty;
256256
const hasOwn: (obj: Readonly<{...}>, prop: string) => boolean =
257257
// $FlowFixMe[method-unbinding]
258+
/* $FlowFixMe[invalid-this-arg] Error exposed after fixing this typing
259+
* unsoundness in flow */
258260
Object.hasOwn ?? ((obj, prop) => _hasOwnProp.call(obj, prop));

packages/react-native/Libraries/Components/ScrollView/ScrollView.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,6 +1069,8 @@ class ScrollView extends React.Component<ScrollViewProps, ScrollViewState> {
10691069
nodeHandle,
10701070
nullthrows(findNodeHandle<$FlowFixMe>(this)),
10711071
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
1072+
/* $FlowFixMe[incompatible-type] Error exposed after fixing this
1073+
* typing unsoundness in flow */
10721074
this._textInputFocusError,
10731075
this._inputMeasureAndScrollToKeyboard,
10741076
);
@@ -1077,6 +1079,8 @@ class ScrollView extends React.Component<ScrollViewProps, ScrollViewState> {
10771079
this._innerView.nativeInstance,
10781080
this._inputMeasureAndScrollToKeyboard,
10791081
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
1082+
/* $FlowFixMe[incompatible-type] Error exposed after fixing this
1083+
* typing unsoundness in flow */
10801084
this._textInputFocusError,
10811085
);
10821086
}

packages/react-native/Libraries/Modal/Modal.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,8 @@ class Modal extends React.Component<ModalProps, ModalState> {
339339
identifier={this._identifier}
340340
style={styles.modal}
341341
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
342+
/* $FlowFixMe[incompatible-type] Error exposed after fixing this typing
343+
* unsoundness in flow */
342344
onStartShouldSetResponder={this._shouldSetResponder}
343345
supportedOrientations={this.props.supportedOrientations}
344346
onOrientationChange={this.props.onOrientationChange}

packages/react-native/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ function deepFreezeAndThrowOnMutationInDev<T extends {...} | Array<unknown>>(
4949

5050
for (let i = 0; i < keys.length; i++) {
5151
const key = keys[i];
52+
/* $FlowFixMe[invalid-this-arg] Error exposed after fixing this typing
53+
* unsoundness in flow */
5254
if (hasOwnProperty.call(object, key)) {
5355
Object.defineProperty(object, key, {
5456
get: identity.bind(null, object[key]),
@@ -64,6 +66,8 @@ function deepFreezeAndThrowOnMutationInDev<T extends {...} | Array<unknown>>(
6466

6567
for (let i = 0; i < keys.length; i++) {
6668
const key = keys[i];
69+
/* $FlowFixMe[invalid-this-arg] Error exposed after fixing this typing
70+
* unsoundness in flow */
6771
if (hasOwnProperty.call(object, key)) {
6872
deepFreezeAndThrowOnMutationInDev(object[key]);
6973
}

packages/react-native/Libraries/promiseRejectionTrackingOptions.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ const rejectionTrackingOptions: NonNullable<Parameters<enable>[0]> = {
2828
message = '';
2929
} else if (
3030
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
31+
/* $FlowFixMe[invalid-this-arg] Error exposed after fixing this typing
32+
* unsoundness in flow */
3133
Object.prototype.toString.call(rejection) === '[object Error]'
3234
) {
3335
// $FlowFixMe[method-unbinding] added when improving typing for this parameters
36+
/* $FlowFixMe[invalid-this-arg] Error exposed after fixing this typing
37+
* unsoundness in flow */
3438
message = Error.prototype.toString.call(rejection);
3539
} else {
3640
try {

packages/react-native/src/private/animated/createAnimatedPropsMemoHook.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,4 +357,6 @@ function areCompositeKeyComponentsEqual(
357357
const _hasOwnProp = Object.prototype.hasOwnProperty;
358358
const hasOwn: (obj: Readonly<{...}>, prop: string) => boolean =
359359
// $FlowFixMe[method-unbinding]
360+
/* $FlowFixMe[invalid-this-arg] Error exposed after fixing this typing
361+
* unsoundness in flow */
360362
Object.hasOwn ?? ((obj, prop) => _hasOwnProp.call(obj, prop));

packages/react-native/src/private/devsupport/devmenu/elementinspector/XHRInterceptor.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ const XHRInterceptor = {
122122
if (openCallback) {
123123
openCallback(method, url, this);
124124
}
125+
/* $FlowFixMe[invalid-this-arg] Error exposed after fixing this typing
126+
* unsoundness in flow */
125127
originalXHROpen.apply(this, arguments);
126128
};
127129

@@ -136,6 +138,8 @@ const XHRInterceptor = {
136138
if (requestHeaderCallback) {
137139
requestHeaderCallback(header, value, this);
138140
}
141+
/* $FlowFixMe[invalid-this-arg] Error exposed after fixing this typing
142+
* unsoundness in flow */
139143
originalXHRSetRequestHeader.apply(this, arguments);
140144
};
141145

@@ -190,6 +194,8 @@ const XHRInterceptor = {
190194
false,
191195
);
192196
}
197+
/* $FlowFixMe[invalid-this-arg] Error exposed after fixing this typing
198+
* unsoundness in flow */
193199
originalXHRSend.apply(this, arguments);
194200
};
195201
isInterceptorEnabled = true;

0 commit comments

Comments
 (0)