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 Mar 30, 2023
1 parent 77b6a3b commit c63302d
Show file tree
Hide file tree
Showing 820 changed files with 23,526 additions and 23,526 deletions.
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 */
6 changes: 3 additions & 3 deletions jscomp/build_tests/namespace/src/demo.bs.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

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

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

exports.v = v;
/* No side effect */
4 changes: 2 additions & 2 deletions jscomp/build_tests/namespace/src/main.bs.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

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

var a = Demo$Namespace.v;
let a = Demo$Namespace.v;

exports.a = a;
/* No side effect */
2 changes: 1 addition & 1 deletion jscomp/build_tests/priv2/node_modules/liba/src/demo.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/priv2/node_modules/liba/src/priv.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/core/js_dump_lit.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,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 var = "let" (* should be able to switch to [let] easily*)

let return = "return"

Expand Down
22 changes: 11 additions & 11 deletions jscomp/test/406_primitive_test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
'use strict';

var Mt = require("./mt.js");
var Caml_exceptions = require("../../lib/js/caml_exceptions.js");
var Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js");
let Mt = require("./mt.js");
let Caml_exceptions = require("../../lib/js/caml_exceptions.js");
let Caml_js_exceptions = require("../../lib/js/caml_js_exceptions.js");

var suites = {
let suites = {
contents: /* [] */0
};

var test_id = {
let test_id = {
contents: 0
};

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

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

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

function f(param) {
var A = /* @__PURE__ */Caml_exceptions.create("A");
let A = /* @__PURE__ */Caml_exceptions.create("A");
try {
for(var i = 0; i <= 200; ++i){
for(let i = 0; i <= 200; ++i){
if (i === 10) {
throw {
RE_EXN_ID: A,
Expand All @@ -44,7 +44,7 @@ function f(param) {
return ;
}
catch (raw_exn){
var exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
let exn = Caml_js_exceptions.internalToOCamlException(raw_exn);
if (exn.RE_EXN_ID === A) {
return ;
}
Expand All @@ -54,9 +54,9 @@ function f(param) {

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

var v = 32;
let v = 32;

var max_array_length = /* Max_wosize */2147483647;
let max_array_length = /* Max_wosize */2147483647;

exports.suites = suites;
exports.test_id = test_id;
Expand Down
2 changes: 1 addition & 1 deletion jscomp/test/EmptyRecord.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function construct(b) {
}
}

var er = {};
let er = {};

exports.construct = construct;
exports.er = er;
Expand Down
10 changes: 5 additions & 5 deletions jscomp/test/SafePromises.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
'use strict';

var Js_promise2 = require("../../lib/js/js_promise2.js");
let Js_promise2 = require("../../lib/js/js_promise2.js");

async function nestedPromise(xxx) {
var xx = await xxx;
let xx = await xxx;
Js_promise2.then(xx, (function (x) {
return Promise.resolve((console.log("Promise2.then", x), undefined));
}));
Js_promise2.$$catch(xx, (function (x) {
console.log("Promise2.catch_", x);
return Promise.resolve(0);
}));
var arg1 = function (x) {
let arg1 = function (x) {
return Promise.resolve((console.log("Promise.then_", x), undefined));
};
xx.then(arg1);
Expand All @@ -22,9 +22,9 @@ async function create(x) {
return x;
}

var xx = create(10);
let xx = create(10);

var xxx = create(xx);
let xxx = create(xx);

nestedPromise(xxx);

Expand Down
8 changes: 4 additions & 4 deletions jscomp/test/UncurriedAlways.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ function foo(x, y) {
return x + y | 0;
}

var z = 7;
let z = 7;

function bar(x, y) {
return x + y | 0;
}

var b = 7;
let b = 7;

var w = 7;
let w = 7;

var a = 7;
let a = 7;

console.log(a);

Expand Down
52 changes: 26 additions & 26 deletions jscomp/test/UncurriedExternals.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var React = require("react");
let React = require("react");

function dd(param) {
throw {
Expand All @@ -9,53 +9,53 @@ function dd(param) {
};
}

var h = sum(1.0, 2.0);
let h = sum(1.0, 2.0);

var M = {
let M = {
sum: (function (prim0, prim1) {
return sum(prim0, prim1);
})
};

var hh = M.sum(1.0, 2.0);
let hh = M.sum(1.0, 2.0);

var mf = 3 % 4;
let mf = 3 % 4;

function tg(arr) {
return arr[0];
}

var tc = Object.assign({}, "abc");
let tc = Object.assign({}, "abc");

var te = {
let te = {
RE_EXN_ID: "Not_found"
};

var tcr = {};
let tcr = {};

function tsiC(c) {
c.increment = (function (amount) {
var me = this ;
let me = this ;
console.log(me);
});
}

function tsiU(c) {
c.increment = (function (amount) {
var me = this ;
let me = this ;
console.log(me);
});
}

var match = React.useState(function () {
let match = React.useState(function () {
return 3;
});

var StandardNotation_get = match[0];
let StandardNotation_get = match[0];

var StandardNotation_set = match[1];
let StandardNotation_set = match[1];

var StandardNotation = {
let StandardNotation = {
dd: dd,
h: h,
M: M,
Expand All @@ -78,51 +78,51 @@ function dd$1(param) {
};
}

var h$1 = sum(1.0, 2.0);
let h$1 = sum(1.0, 2.0);

var M$1 = {
let M$1 = {
sum: (function (prim0, prim1) {
return sum(prim0, prim1);
})
};

var hh$1 = M$1.sum(1.0, 2.0);
let hh$1 = M$1.sum(1.0, 2.0);

var mf$1 = 3 % 4;
let mf$1 = 3 % 4;

function tg$1(arr) {
return arr[0];
}

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

var te$1 = {
let te$1 = {
RE_EXN_ID: "Not_found"
};

var tcr$1 = {};
let tcr$1 = {};

function tsiC$1(c) {
c.increment = (function (amount) {
var me = this ;
let me = this ;
console.log(me);
});
}

function tsiU$1(c) {
c.increment = (function (amount) {
var me = this ;
let me = this ;
console.log(me);
});
}

var match$1 = React.useState(function (param) {
let match$1 = React.useState(function (param) {
return 3;
});

var get = match$1[0];
let get = match$1[0];

var set = match$1[1];
let set = match$1[1];

exports.StandardNotation = StandardNotation;
exports.dd = dd$1;
Expand Down
10 changes: 5 additions & 5 deletions jscomp/test/a_filename_test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
'use strict';

var Mt = require("./mt.js");
var $$Array = require("../../lib/js/array.js");
var Ext_filename_test = require("./ext_filename_test.js");
let Mt = require("./mt.js");
let $$Array = require("../../lib/js/array.js");
let Ext_filename_test = require("./ext_filename_test.js");

var suites = {
let suites = {
contents: /* [] */0
};

var test_id = {
let test_id = {
contents: 0
};

Expand Down
10 changes: 5 additions & 5 deletions jscomp/test/a_list_test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

var Mt = require("./mt.js");
var Ext_list_test = require("./ext_list_test.js");
let Mt = require("./mt.js");
let Ext_list_test = require("./ext_list_test.js");

var suites_0 = [
let suites_0 = [
"drop",
(function (param) {
return {
Expand All @@ -23,7 +23,7 @@ var suites_0 = [
})
];

var suites_1 = {
let suites_1 = {
hd: [
"drop1",
(function (param) {
Expand Down Expand Up @@ -103,7 +103,7 @@ var suites_1 = {
}
};

var suites = {
let suites = {
hd: suites_0,
tl: suites_1
};
Expand Down
Loading

0 comments on commit c63302d

Please sign in to comment.