Skip to content

Commit 7bcf3b0

Browse files
gkzmeta-codesync[bot]
authored andcommitted
[flow][refactor] Change wildcard pattern in hoister.ml into explicit listing of cases
Summary: Change wildcard pattern in hoister.ml into explicit listing of cases. This will make it easy to see when adding a new node type that this needs to be updated here. Changelog: [internal] Reviewed By: marcoww6 Differential Revision: D87486645 fbshipit-source-id: ee37f1f9144889250fe91dc9dad05f92fc39af8a
1 parent 6c6e247 commit 7bcf3b0

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

src/analysis/hoister.ml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,34 @@ class ['loc] lexical_hoister ~flowmin_compatibility ~enable_enums =
8686
| (_, DeclareFunction _)
8787
| (_, DeclareComponent _) ->
8888
this#flowmin_compatibility_statement stmt
89-
| _ -> this#nonlexical_statement stmt
89+
| (_, Block _)
90+
| (_, Break _)
91+
| (_, Continue _)
92+
| (_, Debugger _)
93+
| (_, DeclareEnum _)
94+
| (_, DeclareInterface _)
95+
| (_, DeclareModuleExports _)
96+
| (_, DeclareNamespace _)
97+
| (_, DeclareTypeAlias _)
98+
| (_, DeclareOpaqueType _)
99+
| (_, DoWhile _)
100+
| (_, Empty _)
101+
| (_, Expression _)
102+
| (_, For _)
103+
| (_, ForIn _)
104+
| (_, ForOf _)
105+
| (_, If _)
106+
| (_, InterfaceDeclaration _)
107+
| (_, Match _)
108+
| (_, Return _)
109+
| (_, Switch _)
110+
| (_, Throw _)
111+
| (_, Try _)
112+
| (_, TypeAlias _)
113+
| (_, OpaqueType _)
114+
| (_, While _)
115+
| (_, With _) ->
116+
this#nonlexical_statement stmt
90117

91118
method flowmin_compatibility_statement stmt =
92119
(* Flowmin treats function declarations as vars, even though

0 commit comments

Comments
 (0)