Skip to content

Commit

Permalink
generated JS: add space before while loop condition (#1297)
Browse files Browse the repository at this point in the history
* generated JS: add space before while loop condition

* snapshot runtime tests

* fix blackbox tests

* chore: add changelog entry
  • Loading branch information
anmonteiro authored Jan 14, 2025
1 parent 8ec534d commit b52efa7
Show file tree
Hide file tree
Showing 92 changed files with 976 additions and 972 deletions.
2 changes: 2 additions & 0 deletions Changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ Unreleased
([#1295](https://github.com/melange-re/melange/pull/1295))
- JS generation: move space before comma inside `for` definition
([#1296](https://github.com/melange-re/melange/pull/1296))
- JS generation: add space before while loop condition
([#1297](https://github.com/melange-re/melange/pull/1297))

4.0.1 2024-06-07
---------------
Expand Down
2 changes: 2 additions & 0 deletions jscomp/core/js_dump.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1071,13 +1071,15 @@ and statement_desc top cxt (s : J.statement_desc) : cxt =
match e.expression_desc with
| Number (Int { i = 1l; _ }) ->
string cxt L.while_;
space cxt;
string cxt L.lparen;
string cxt L.true_;
string cxt L.rparen;
space cxt;
cxt
| _ ->
string cxt L.while_;
space cxt;
let cxt = paren_group cxt 1 (fun () -> expression ~level:0 cxt e) in
space cxt;
cxt
Expand Down
2 changes: 1 addition & 1 deletion jscomp/test/dist/jscomp/test/a_scope_bug.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions jscomp/test/dist/jscomp/test/and_or_tailcall_test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jscomp/test/dist/jscomp/test/app_root_finder.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jscomp/test/dist/jscomp/test/arith_lexer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jscomp/test/dist/jscomp/test/array_subtle_test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jscomp/test/dist/jscomp/test/array_test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jscomp/test/dist/jscomp/test/ast_js_mapper_test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions jscomp/test/dist/jscomp/test/bal_set_mini.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions jscomp/test/dist/jscomp/test/bdd.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions jscomp/test/dist/jscomp/test/bs_stack_test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jscomp/test/dist/jscomp/test/class6_test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jscomp/test/dist/jscomp/test/class7_test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions jscomp/test/dist/jscomp/test/complex_while_loop.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jscomp/test/dist/jscomp/test/cps_test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jscomp/test/dist/jscomp/test/demo_int_map.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jscomp/test/dist/jscomp/test/exception_raise_test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 9 additions & 9 deletions jscomp/test/dist/jscomp/test/ext_array_test.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b52efa7

Please sign in to comment.