Skip to content

Commit

Permalink
Avoid semicolons in EnumDeclaration
Browse files Browse the repository at this point in the history
Summary: Skip `;` in EnumDeclaration

Reviewed By: tmikov

Differential Revision: D32933354

fbshipit-source-id: e6ab792b3206470b1cfb767ec1a745cc88a46548
  • Loading branch information
avp authored and facebook-github-bot committed Jan 7, 2022
1 parent 488808c commit 83ac2e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions unsupported/juno/crates/juno/src/gen_js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3853,6 +3853,7 @@ fn stmt_skip_semi<'gc>(ctx: &'gc GCLock, node: Option<&'gc Node<'gc>>) -> bool {
declaration,
..
}) => stmt_skip_semi(ctx, *declaration),
Node::EnumDeclaration(_) => true,
_ => false,
},
None => false,
Expand Down
6 changes: 6 additions & 0 deletions unsupported/juno/crates/juno/tests/gen_js/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,12 @@ fn test_types() {
test_roundtrip_flow("type A = (number, string) => number");
}

#[test]
fn test_enum() {
test_roundtrip_flow("enum Foo {}");
test_roundtrip_flow("enum Foo : string {A = 'A', B = 'B'}");
}

#[test]
fn test_typecast() {
test_roundtrip_flow("async function foo() { return (x: any); }");
Expand Down

0 comments on commit 83ac2e7

Please sign in to comment.