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 3, 2023
1 parent fae27f7 commit 56d568a
Show file tree
Hide file tree
Showing 830 changed files with 23,556 additions and 23,556 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 */
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.

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/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.

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.

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.

16 changes: 8 additions & 8 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.

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
Loading

0 comments on commit 56d568a

Please sign in to comment.