Skip to content

Commit c381358

Browse files
cometkimcknitt
andcommitted
Fix classify_function
Co-authored-by: Christoph Knittel <[email protected]>
1 parent e3c8c62 commit c381358

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/ml/classify_function.ml

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@
2424

2525
let rec is_obj_literal (x : _ Flow_ast.Expression.t) : bool =
2626
match snd x with
27-
| Identifier (_, {name = "undefined"}) | RegExpLiteral _ -> true
27+
| Identifier (_, {name = "undefined"})
28+
| StringLiteral _ | BooleanLiteral _ | NullLiteral _ | NumberLiteral _
29+
| BigIntLiteral _ | RegExpLiteral _ | ModuleRefLiteral _ ->
30+
true
2831
| Unary {operator = Minus; argument} -> is_obj_literal argument
2932
| Object {properties} -> Ext_list.for_all properties is_literal_kv
3033
| Array {elements} ->

0 commit comments

Comments
 (0)