Skip to content

Commit

Permalink
add another test
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomocavalieri authored and lpil committed Jan 6, 2025
1 parent a96c5db commit 6f04609
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
14 changes: 14 additions & 0 deletions compiler-core/src/javascript/tests/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,17 @@ fn b() {
"#
);
}

#[test]
fn block_in_tail_position_with_just_an_assignment() {
assert_js!(
r#"
fn b() {
let x = 1
{
let x = x
}
}
"#
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
source: compiler-core/src/javascript/tests/blocks.rs
assertion_line: 251
expression: "\nfn b() {\n let x = 1\n {\n let x = x\n }\n}\n"
---
----- SOURCE CODE

fn b() {
let x = 1
{
let x = x
}
}


----- COMPILED JAVASCRIPT
function b() {
let x = 1;
let x$1 = x;
return x$1;
}

0 comments on commit 6f04609

Please sign in to comment.