Skip to content

Commit

Permalink
Test emitting let instead of var.
Browse files Browse the repository at this point in the history
Fixes #856
  • Loading branch information
cristianoc committed Apr 28, 2024
1 parent 17804a4 commit 698fbf5
Show file tree
Hide file tree
Showing 832 changed files with 21,319 additions and 21,319 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- Remove redundant space for empty return in generated js code. https://github.com/rescript-lang/rescript-compiler/pull/6745
- Remove redundant space for export in generated js code. https://github.com/rescript-lang/rescript-compiler/pull/6560
- Remove empty export blocks in generated js code. https://github.com/rescript-lang/rescript-compiler/pull/6744
- In generated code, use `let` instead of `var`.

# 11.1.0

Expand Down
2 changes: 1 addition & 1 deletion jscomp/build_tests/custom_namespace/src/demo.bs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';


var v = 42;
let v = 42;

exports.v = v;
/* No side effect */
2 changes: 1 addition & 1 deletion jscomp/build_tests/devonly/src/demo.bs.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/build_tests/devonly/src/depdemo.bs.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/build_tests/devonly/src2/hello.bs.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/build_tests/devonly/src2/hellodep.bs.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/build_tests/ns/src/demo.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/build_tests/ns/src/hello.js

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

10 changes: 5 additions & 5 deletions jscomp/build_tests/react_ppx/src/React.bs.js

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

8 changes: 4 additions & 4 deletions jscomp/build_tests/react_ppx/src/gpr_3695_test.bs.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/build_tests/react_ppx/src/gpr_3987_test.bs.js

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

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

4 changes: 2 additions & 2 deletions jscomp/core/js_dump.ml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ let pp_paren_params (inner_cxt : cxt) (f : Ext_pp.t) (lexical : Ident.t list) :
id) *)

let pp_var_assign cxt f id =
P.string f L.var;
P.string f L.let_;
P.space f;
let acxt = Ext_pp_scope.ident cxt f id in
P.space f;
Expand All @@ -202,7 +202,7 @@ let pp_var_assign_this cxt f id =
cxt

let pp_var_declare cxt f id =
P.string f L.var;
P.string f L.let_;
P.space f;
let acxt = Ext_pp_scope.ident cxt f id in
semi f;
Expand Down
2 changes: 1 addition & 1 deletion jscomp/core/js_dump_import_export.ml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ let requires require_lit cxt f (modules : (Ident.t * string * bool) list) =
in
P.at_least_two_lines f;
Ext_list.rev_iter reversed_list (fun (s, file, default) ->
P.string f L.var;
P.string f L.let_;
P.space f;
P.string f s;
P.space f;
Expand Down
2 changes: 1 addition & 1 deletion jscomp/core/js_dump_lit.ml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let function_ = "function"

let function_async ~async = if async then "async function" else "function"

let var = "var" (* should be able to switch to [let] easily*)
let let_ = "let"

let return = "return"

Expand Down

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

22 changes: 11 additions & 11 deletions jscomp/test/406_primitive_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/AsInUncurriedExternals.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/Coercion.js

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

16 changes: 8 additions & 8 deletions jscomp/test/DerivingAccessorsCurried.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/DerivingAccessorsUncurried.js

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

Loading

0 comments on commit 698fbf5

Please sign in to comment.