Skip to content

Commit d6415f6

Browse files
panagosg7facebook-github-bot
authored andcommitted
pre-suppress errors before enabling experimental.object_freeze_fix
Summary: X-link: facebook/react-native#47141 D64152004 fixed a soundness hole in Flow's checking of frozen object types (e.g. try-Flow https://fburl.com/rmct2mf6). This diff suppresses Flow errors that appear when this fix is enabled (`experimental.object_freeze_fix` flag is set). For most of these cases the result of `Object.freeze()` is assigned to some variable typed as a mutable type. The variable is then passed to a context where its fields can be written to. Thus changing the annotation type to a readonly version would only cause more errors downstream. So, instead, these assignments are suppressed so that the choice of using Object.freeze can be revisited. Changelog: [internal] Reviewed By: SamChou19815 Differential Revision: D64699992 fbshipit-source-id: 48e4376d4ed3dbda21d32cabe512e6457384994f
1 parent add4c76 commit d6415f6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/metro/src/index.flow.js

+1
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ exports.runBuild = async (
377377
onComplete,
378378
onProgress,
379379
minify = true,
380+
// $FlowFixMe[incompatible-variance] frozen objects are readonly
380381
output = outputBundle,
381382
out,
382383
platform = 'web',

0 commit comments

Comments
 (0)