Skip to content

Commit 56d568a

Browse files
committed
Test emitting let instead of var.
Fixes #856
1 parent fae27f7 commit 56d568a

File tree

830 files changed

+23556
-23556
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

830 files changed

+23556
-23556
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33

4-
var v = 42;
4+
let v = 42;
55

66
exports.v = v;
77
/* No side effect */

jscomp/build_tests/devonly/src/demo.bs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/devonly/src/depdemo.bs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/devonly/src2/hello.bs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/devonly/src2/hellodep.bs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
'use strict';
22

3-
var Demo$Liba = require("liba/src/demo.bs.js");
4-
var Demo$Libb = require("libb/src/demo.bs.js");
3+
let Demo$Liba = require("liba/src/demo.bs.js");
4+
let Demo$Libb = require("libb/src/demo.bs.js");
55

6-
var v = Demo$Liba.v + Demo$Libb.v | 0;
6+
let v = Demo$Liba.v + Demo$Libb.v | 0;
77

88
exports.v = v;
99
/* No side effect */
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22

3-
var Demo$Namespace = require("./demo.bs.js");
3+
let Demo$Namespace = require("./demo.bs.js");
44

5-
var a = Demo$Namespace.v;
5+
let a = Demo$Namespace.v;
66

77
exports.a = a;
88
/* No side effect */

jscomp/build_tests/ns/src/demo.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/ns/src/hello.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/priv2/node_modules/liba/src/demo.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/priv2/node_modules/liba/src/priv.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/react_ppx/src/React.bs.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/react_ppx/src/gpr_3695_test.bs.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/react_ppx/src/gpr_3987_test.bs.js

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/build_tests/react_ppx/src/recursive_component_test.bs.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/core/js_dump_lit.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ let function_ = "function"
2626

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

29-
let var = "var" (* should be able to switch to [let] easily*)
29+
let var = "let" (* should be able to switch to [let] easily*)
3030

3131
let return = "return"
3232

jscomp/test/406_primitive_test.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
'use strict';
22

3-
var Mt = require("./mt.js");
4-
var Caml_exceptions = require("../../lib/js/caml_exceptions.js");
5-
var Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js");
3+
let Mt = require("./mt.js");
4+
let Caml_exceptions = require("../../lib/js/caml_exceptions.js");
5+
let Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js");
66

7-
var suites = {
7+
let suites = {
88
contents: /* [] */0
99
};
1010

11-
var test_id = {
11+
let test_id = {
1212
contents: 0
1313
};
1414

@@ -18,7 +18,7 @@ function eq(loc, x, y) {
1818

1919
eq("File \"406_primitive_test.ml\", line 18, characters 6-13", 32, 32);
2020

21-
var backend_type = {
21+
let backend_type = {
2222
TAG: "Other",
2323
_0: "BS"
2424
};
@@ -29,9 +29,9 @@ eq("File \"406_primitive_test.ml\", line 29, characters 6-13", backend_type, {
2929
});
3030

3131
function f(param) {
32-
var A = /* @__PURE__ */Caml_exceptions.create("A");
32+
let A = /* @__PURE__ */Caml_exceptions.create("A");
3333
try {
34-
for(var i = 0; i <= 200; ++i){
34+
for(let i = 0; i <= 200; ++i){
3535
if (i === 10) {
3636
throw {
3737
RE_EXN_ID: A,
@@ -44,7 +44,7 @@ function f(param) {
4444
return ;
4545
}
4646
catch (raw_exn){
47-
var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
47+
let exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
4848
if (exn.RE_EXN_ID === A) {
4949
return ;
5050
}
@@ -54,9 +54,9 @@ function f(param) {
5454

5555
Mt.from_pair_suites("406_primitive_test", suites.contents);
5656

57-
var v = 32;
57+
let v = 32;
5858

59-
var max_array_length = /* Max_wosize */2147483647;
59+
let max_array_length = /* Max_wosize */2147483647;
6060

6161
exports.suites = suites;
6262
exports.test_id = test_id;

jscomp/test/EmptyRecord.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function construct(b) {
1111
}
1212
}
1313

14-
var er = {};
14+
let er = {};
1515

1616
exports.construct = construct;
1717
exports.er = er;

jscomp/test/SafePromises.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
'use strict';
22

3-
var Js_promise2 = require("../../lib/js/js_promise2.js");
3+
let Js_promise2 = require("../../lib/js/js_promise2.js");
44

55
async function nestedPromise(xxx) {
6-
var xx = await xxx;
6+
let xx = await xxx;
77
Js_promise2.then(xx, (function (x) {
88
return Promise.resolve((console.log("Promise2.then", x), undefined));
99
}));
1010
Js_promise2.$$catch(xx, (function (x) {
1111
console.log("Promise2.catch_", x);
1212
return Promise.resolve(0);
1313
}));
14-
var arg1 = function (x) {
14+
let arg1 = function (x) {
1515
return Promise.resolve((console.log("Promise.then_", x), undefined));
1616
};
1717
xx.then(arg1);
@@ -22,9 +22,9 @@ async function create(x) {
2222
return x;
2323
}
2424

25-
var xx = create(10);
25+
let xx = create(10);
2626

27-
var xxx = create(xx);
27+
let xxx = create(xx);
2828

2929
nestedPromise(xxx);
3030

jscomp/test/UncurriedAlways.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ function foo(x, y) {
55
return x + y | 0;
66
}
77

8-
var z = 7;
8+
let z = 7;
99

1010
function bar(x, y) {
1111
return x + y | 0;
1212
}
1313

14-
var b = 7;
14+
let b = 7;
1515

16-
var w = 7;
16+
let w = 7;
1717

18-
var a = 7;
18+
let a = 7;
1919

2020
console.log(a);
2121

0 commit comments

Comments
 (0)