Skip to content

Commit c63302d

Browse files
committed
Test emitting let instead of var.
Fixes #856
1 parent 77b6a3b commit c63302d

File tree

820 files changed

+23526
-23526
lines changed

Some content is hidden

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

820 files changed

+23526
-23526
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 */
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/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/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

jscomp/test/UncurriedExternals.js

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

3-
var React = require("react");
3+
let React = require("react");
44

55
function dd(param) {
66
throw {
@@ -9,53 +9,53 @@ function dd(param) {
99
};
1010
}
1111

12-
var h = sum(1.0, 2.0);
12+
let h = sum(1.0, 2.0);
1313

14-
var M = {
14+
let M = {
1515
sum: (function (prim0, prim1) {
1616
return sum(prim0, prim1);
1717
})
1818
};
1919

20-
var hh = M.sum(1.0, 2.0);
20+
let hh = M.sum(1.0, 2.0);
2121

22-
var mf = 3 % 4;
22+
let mf = 3 % 4;
2323

2424
function tg(arr) {
2525
return arr[0];
2626
}
2727

28-
var tc = Object.assign({}, "abc");
28+
let tc = Object.assign({}, "abc");
2929

30-
var te = {
30+
let te = {
3131
RE_EXN_ID: "Not_found"
3232
};
3333

34-
var tcr = {};
34+
let tcr = {};
3535

3636
function tsiC(c) {
3737
c.increment = (function (amount) {
38-
var me = this ;
38+
let me = this ;
3939
console.log(me);
4040
});
4141
}
4242

4343
function tsiU(c) {
4444
c.increment = (function (amount) {
45-
var me = this ;
45+
let me = this ;
4646
console.log(me);
4747
});
4848
}
4949

50-
var match = React.useState(function () {
50+
let match = React.useState(function () {
5151
return 3;
5252
});
5353

54-
var StandardNotation_get = match[0];
54+
let StandardNotation_get = match[0];
5555

56-
var StandardNotation_set = match[1];
56+
let StandardNotation_set = match[1];
5757

58-
var StandardNotation = {
58+
let StandardNotation = {
5959
dd: dd,
6060
h: h,
6161
M: M,
@@ -78,51 +78,51 @@ function dd$1(param) {
7878
};
7979
}
8080

81-
var h$1 = sum(1.0, 2.0);
81+
let h$1 = sum(1.0, 2.0);
8282

83-
var M$1 = {
83+
let M$1 = {
8484
sum: (function (prim0, prim1) {
8585
return sum(prim0, prim1);
8686
})
8787
};
8888

89-
var hh$1 = M$1.sum(1.0, 2.0);
89+
let hh$1 = M$1.sum(1.0, 2.0);
9090

91-
var mf$1 = 3 % 4;
91+
let mf$1 = 3 % 4;
9292

9393
function tg$1(arr) {
9494
return arr[0];
9595
}
9696

97-
var tc$1 = Object.assign({}, "abc");
97+
let tc$1 = Object.assign({}, "abc");
9898

99-
var te$1 = {
99+
let te$1 = {
100100
RE_EXN_ID: "Not_found"
101101
};
102102

103-
var tcr$1 = {};
103+
let tcr$1 = {};
104104

105105
function tsiC$1(c) {
106106
c.increment = (function (amount) {
107-
var me = this ;
107+
let me = this ;
108108
console.log(me);
109109
});
110110
}
111111

112112
function tsiU$1(c) {
113113
c.increment = (function (amount) {
114-
var me = this ;
114+
let me = this ;
115115
console.log(me);
116116
});
117117
}
118118

119-
var match$1 = React.useState(function (param) {
119+
let match$1 = React.useState(function (param) {
120120
return 3;
121121
});
122122

123-
var get = match$1[0];
123+
let get = match$1[0];
124124

125-
var set = match$1[1];
125+
let set = match$1[1];
126126

127127
exports.StandardNotation = StandardNotation;
128128
exports.dd = dd$1;

jscomp/test/a_filename_test.js

Lines changed: 5 additions & 5 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 $$Array = require("../../lib/js/array.js");
5-
var Ext_filename_test = require("./ext_filename_test.js");
3+
let Mt = require("./mt.js");
4+
let $$Array = require("../../lib/js/array.js");
5+
let Ext_filename_test = require("./ext_filename_test.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

jscomp/test/a_list_test.js

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

3-
var Mt = require("./mt.js");
4-
var Ext_list_test = require("./ext_list_test.js");
3+
let Mt = require("./mt.js");
4+
let Ext_list_test = require("./ext_list_test.js");
55

6-
var suites_0 = [
6+
let suites_0 = [
77
"drop",
88
(function (param) {
99
return {
@@ -23,7 +23,7 @@ var suites_0 = [
2323
})
2424
];
2525

26-
var suites_1 = {
26+
let suites_1 = {
2727
hd: [
2828
"drop1",
2929
(function (param) {
@@ -103,7 +103,7 @@ var suites_1 = {
103103
}
104104
};
105105

106-
var suites = {
106+
let suites = {
107107
hd: suites_0,
108108
tl: suites_1
109109
};

0 commit comments

Comments
 (0)