on master help sign in
Check in all the new JS
commit300838716b4b29078fc3e3d0e6df56f7f03c0c25 authorEvan Czaplicki <info@elm-lang.org> dateThu 10 Sep 2015, 13:01 (11 years ago) parentdd54d5f
20 files changed+181−482
tests/test-files/good-expected-js/AliasSubstitution.elm.js+3−18 tests/test-files/good-expected-js/CaseExpression3.elm.js+23−47 tests/test-files/good-expected-js/Lists/EmptyList.elm.js+2−16 tests/test-files/good-expected-js/Lists/ListRange.elm.js+3−16 tests/test-files/good-expected-js/Lists/NonEmptyList.elm.js+4−18 tests/test-files/good-expected-js/NoExpressions.elm.js+1−14 tests/test-files/good-expected-js/Otherwise.elm.js+3−18 tests/test-files/good-expected-js/Ports.elm.js+54−71 tests/test-files/good-expected-js/PortsWithTypeAliases.elm.js+25−38 tests/test-files/good-expected-js/QuotesAndComments.elm.js+7−24 tests/test-files/good-expected-js/Soundness/Apply.elm.js+4−20 tests/test-files/good-expected-js/Soundness/ApplyAnnotated.elm.js+4−20 tests/test-files/good-expected-js/Soundness/Id.elm.js+5−21 tests/test-files/good-expected-js/Soundness/IdAnnotated.elm.js+5−21 tests/test-files/good-expected-js/Soundness/TrickyId.elm.js+4−18 tests/test-files/good-expected-js/Soundness/TrickyIdAnnotated.elm.js+4−18 tests/test-files/good-expected-js/Strings/Multiline.elm.js+2−16 tests/test-files/good-expected-js/Strings/MultilineNormal.elm.js+2−16 tests/test-files/good-expected-js/TailRecursive.elm.js+16−28 tests/test-files/good-expected-js/Unify/NonHomogeneousRecords.elm.js+10−24
tests/test-files/good-expected-js/AliasSubstitution.elm.js+3−18
@@ -1,19 +1,4 @@
1−Elm.Main = Elm.Main || {};
2−Elm.Main.make = function (_elm) {
3− "use strict";
4− _elm.Main = _elm.Main || {};
5− if (_elm.Main.values)
6− return _elm.Main.values;
7− var _op = {},
8− _N = Elm.Native,
9− _U = _N.Utils.make(_elm),
10− _L = _N.List.make(_elm),
11− $moduleName = "Main";
12− var extractVec = function (v) {
13− return {_: {},x: v.x,y: v.y};
14− };
15− _elm.Main.values = {_op: _op
16− ,Vec2Ext: Vec2Ext
17− ,extractVec: extractVec};
18− return _elm.Main.values;
1+var elm_lang$core$Main$_op = {};
2+var elm_lang$core$Main$extractVec = function (v) {
3+ return {_: {},x: v.x,y: v.y};
194};
tests/test-files/good-expected-js/CaseExpression3.elm.js+23−47
@@ -1,47 +1,23 @@
1−Elm.Main = Elm.Main || {};
2−Elm.Main.make = function (_elm) {
3− "use strict";
4− _elm.Main = _elm.Main || {};
5− if (_elm.Main.values)
6− return _elm.Main.values;
7− var _op = {},
8− _N = Elm.Native,
9− _U = _N.Utils.make(_elm),
10− _L = _N.List.make(_elm),
11− $moduleName = "Main";
12− var Cons = F2(function (a,b) {
13− return {ctor: "Cons"
14− ,_0: a
15− ,_1: b};
16− });
17− var Nil = {ctor: "Nil"};
18− var zip = F2(function (list1,
19− list2) {
20− var _v0 = {ctor: "_Tuple2"
21− ,_0: list1
22− ,_1: list2};
23− switch (_v0.ctor)
24− {case "_Tuple2":
25− switch (_v0._0.ctor)
26− {case "Nil": return Nil;}
27− switch (_v0._1.ctor)
28− {case "Nil": return Nil;}
29− switch (_v0._0.ctor)
30− {case "Cons":
31− switch (_v0._1.ctor)
32− {case "Cons": return A2(Cons,
33− {ctor: "_Tuple2"
34− ,_0: _v0._0._0
35− ,_1: _v0._1._0},
36− A2(zip,_v0._0._1,_v0._1._1));}
37− break;}
38− break;}
39− _U.badCase($moduleName,
40− "bugs in reporting the exact location right now");
41− });
42− _elm.Main.values = {_op: _op
43− ,Nil: Nil
44− ,Cons: Cons
45− ,zip: zip};
46− return _elm.Main.values;
47−};
1+var elm_lang$core$Main$_op = {};
2+var elm_lang$core$Main$Cons = F2(function (a,
3+b) {
4+ return {ctor: "Cons",_0: a,_1: b};
5+});
6+var elm_lang$core$Main$Nil = {ctor: "Nil"};
7+var elm_lang$core$Main$zip = F2(function (list1,
8+list2) {
9+ var _p0 = {ctor: "_Tuple2"
10+ ,_0: list1
11+ ,_1: list2};
12+ switch (_p0._0.ctor)
13+ {case "Nil": return elm_lang$core$Main$Nil;
14+ default: switch (_p0._1.ctor)
15+ {case "Nil": return elm_lang$core$Main$Nil;
16+ default: var x = _p0._0._0;
17+ var xs = _p0._0._1;
18+ var y = _p0._1._0;
19+ var ys = _p0._1._1;
20+ return A2(elm_lang$core$Main$Cons,
21+ {ctor: "_Tuple2",_0: x,_1: y},
22+ A2(elm_lang$core$Main$zip,xs,ys));}}
23+});
tests/test-files/good-expected-js/Lists/EmptyList.elm.js+2−16
@@ -1,16 +1,2 @@
1−Elm.Main = Elm.Main || {};
2−Elm.Main.make = function (_elm) {
3− "use strict";
4− _elm.Main = _elm.Main || {};
5− if (_elm.Main.values)
6− return _elm.Main.values;
7− var _op = {},
8− _N = Elm.Native,
9− _U = _N.Utils.make(_elm),
10− _L = _N.List.make(_elm),
11− $moduleName = "Main";
12− var emptyList = _L.fromArray([]);
13− _elm.Main.values = {_op: _op
14− ,emptyList: emptyList};
15− return _elm.Main.values;
16−};
1+var elm_lang$core$Main$_op = {};
2+var elm_lang$core$Main$emptyList = _utils.list([]);
tests/test-files/good-expected-js/Lists/ListRange.elm.js+3−16
@@ -1,16 +1,3 @@
1−Elm.Main = Elm.Main || {};
2−Elm.Main.make = function (_elm) {
3− "use strict";
4− _elm.Main = _elm.Main || {};
5− if (_elm.Main.values)
6− return _elm.Main.values;
7− var _op = {},
8− _N = Elm.Native,
9− _U = _N.Utils.make(_elm),
10− _L = _N.List.make(_elm),
11− $moduleName = "Main";
12− var listRange = _L.range(2,10);
13− _elm.Main.values = {_op: _op
14− ,listRange: listRange};
15− return _elm.Main.values;
16−};
1+var elm_lang$core$Main$_op = {};
2+var elm_lang$core$Main$listRange = _utils.range(2,
3+10);
tests/test-files/good-expected-js/Lists/NonEmptyList.elm.js+4−18
@@ -1,18 +1,4 @@
1−Elm.Main = Elm.Main || {};
2−Elm.Main.make = function (_elm) {
3− "use strict";
4− _elm.Main = _elm.Main || {};
5− if (_elm.Main.values)
6− return _elm.Main.values;
7− var _op = {},
8− _N = Elm.Native,
9− _U = _N.Utils.make(_elm),
10− _L = _N.List.make(_elm),
11− $moduleName = "Main";
12− var nonEmptyList = _L.fromArray([1
13− ,4
14− ,5]);
15− _elm.Main.values = {_op: _op
16− ,nonEmptyList: nonEmptyList};
17− return _elm.Main.values;
18−};
1+var elm_lang$core$Main$_op = {};
2+var elm_lang$core$Main$nonEmptyList = _utils.list([1
3+ ,4
4+ ,5]);
tests/test-files/good-expected-js/NoExpressions.elm.js+1−14
@@ -1,14 +1 @@
1−Elm.Main = Elm.Main || {};
2−Elm.Main.make = function (_elm) {
3− "use strict";
4− _elm.Main = _elm.Main || {};
5− if (_elm.Main.values)
6− return _elm.Main.values;
7− var _op = {},
8− _N = Elm.Native,
9− _U = _N.Utils.make(_elm),
10− _L = _N.List.make(_elm),
11− $moduleName = "Main";
12− _elm.Main.values = {_op: _op};
13− return _elm.Main.values;
14−};
1+var elm_lang$core$Main$_op = {};
tests/test-files/good-expected-js/Otherwise.elm.js+3−18
@@ -1,18 +1,3 @@
1−Elm.Otherwise = Elm.Otherwise || {};
2−Elm.Otherwise.make = function (_elm) {
3− "use strict";
4− _elm.Otherwise = _elm.Otherwise || {};
5− if (_elm.Otherwise.values)
6− return _elm.Otherwise.values;
7− var _op = {},
8− _N = Elm.Native,
9− _U = _N.Utils.make(_elm),
10− _L = _N.List.make(_elm),
11− $moduleName = "Otherwise";
12− var boo = false ? "Yay" : "Boo";
13− var otherwise = 3;
14− _elm.Otherwise.values = {_op: _op
15− ,otherwise: otherwise
16− ,boo: boo};
17− return _elm.Otherwise.values;
18−};
1+var elm_lang$core$Otherwise$_op = {};
2+var elm_lang$core$Otherwise$boo = false ? "Yay" : "Boo";
3+var elm_lang$core$Otherwise$otherwise = 3;
tests/test-files/good-expected-js/Ports.elm.js+54−71
@@ -1,74 +1,57 @@
1−Elm.Main = Elm.Main || {};
2−Elm.Main.make = function (_elm) {
3− "use strict";
4− _elm.Main = _elm.Main || {};
5− if (_elm.Main.values)
6− return _elm.Main.values;
7− var _op = {},
8− _N = Elm.Native,
9− _U = _N.Utils.make(_elm),
10− _L = _N.List.make(_elm),
11− $moduleName = "Main";
12− var students = Elm.Native.Port.make(_elm).outbound("students",
13− function (v) {
14− return Elm.Native.List.make(_elm).toArray(v).map(function (v) {
15− return {name: v.name
16− ,age: v.age};
17− });
18− },
19− _L.fromArray([{_: {}
20− ,age: 42
21− ,name: "Tom"}]));
22− var time = Elm.Native.Port.make(_elm).outbound("time",
23− function (v) {
24− return v;
25− },
26− 3.14);
27− var fortyTwo = Elm.Native.Port.make(_elm).outbound("fortyTwo",
28− function (v) {
29− return v;
30− },
31− 42);
32− var record = Elm.Native.Port.make(_elm).inbound("record",
33− "{ x : Float, y : Float }",
34− function (v) {
35− return typeof v === "object" && "x" in v && "y" in v ? {_: {}
36− ,x: typeof v.x === "number" ? v.x : _U.badPort("a number",
37− v.x)
38− ,y: typeof v.y === "number" ? v.y : _U.badPort("a number",
39− v.y)} : _U.badPort("an object with fields `x`, `y`",
40− v);
41− });
42− var array = Elm.Native.Port.make(_elm).inbound("array",
43− "List Int",
44− function (v) {
45− return typeof v === "object" && v instanceof Array ? Elm.Native.List.make(_elm).fromArray(v.map(function (v) {
46− return typeof v === "number" ? v : _U.badPort("a number",
47− v);
48− })) : _U.badPort("an array",v);
49− });
50− var tuple = Elm.Native.Port.make(_elm).inbound("tuple",
51− "(Float, Bool)",
52− function (v) {
53− return typeof v === "object" && v instanceof Array ? {ctor: "_Tuple2"
54− ,_0: typeof v[0] === "number" ? v[0] : _U.badPort("a number",
55− v[0])
56− ,_1: typeof v[1] === "boolean" ? v[1] : _U.badPort("a boolean (true or false)",
57− v[1])} : _U.badPort("an array",
58− v);
1+var elm_lang$core$Main$_op = {};
2+var elm_lang$core$Main$students = Elm.Native.Port.make(_elm).outbound("students",
3+function (v) {
4+ return Elm.Native.List.make(_elm).toArray(v).map(function (v) {
5+ return {name: v.name,age: v.age};
596 });
60− var number = Elm.Native.Port.make(_elm).inbound("number",
61− "Int",
62− function (v) {
7+},
8+_utils.list([{_: {},age: 42,name: "Tom"}]));
9+var elm_lang$core$Main$time = Elm.Native.Port.make(_elm).outbound("time",
10+function (v) {
11+ return v;
12+},
13+3.14);
14+var elm_lang$core$Main$fortyTwo = Elm.Native.Port.make(_elm).outbound("fortyTwo",
15+function (v) {
16+ return v;
17+},
18+42);
19+var elm_lang$core$Main$record = Elm.Native.Port.make(_elm).inbound("record",
20+"{ x : Float, y : Float }",
21+function (v) {
22+ return typeof v === "object" && "x" in v && "y" in v ? {_: {}
23+ ,x: typeof v.x === "number" ? v.x : _U.badPort("a number",
24+ v.x)
25+ ,y: typeof v.y === "number" ? v.y : _U.badPort("a number",
26+ v.y)} : _U.badPort("an object with fields `x`, `y`",
27+ v);
28+});
29+var elm_lang$core$Main$array = Elm.Native.Port.make(_elm).inbound("array",
30+"List Int",
31+function (v) {
32+ return typeof v === "object" && v instanceof Array ? Elm.Native.List.make(_elm).fromArray(v.map(function (v) {
6333 return typeof v === "number" ? v : _U.badPort("a number",
6434 v);
65− });
66− var userID = Elm.Native.Port.make(_elm).inbound("userID",
67− "String",
68− function (v) {
69− return typeof v === "string" || typeof v === "object" && v instanceof String ? v : _U.badPort("a string",
70− v);
71− });
72− _elm.Main.values = {_op: _op};
73− return _elm.Main.values;
74−};
35+ })) : _U.badPort("an array",v);
36+});
37+var elm_lang$core$Main$tuple = Elm.Native.Port.make(_elm).inbound("tuple",
38+"(Float, Bool)",
39+function (v) {
40+ return typeof v === "object" && v instanceof Array ? {ctor: "_Tuple2"
41+ ,_0: typeof v[0] === "number" ? v[0] : _U.badPort("a number",
42+ v[0])
43+ ,_1: typeof v[1] === "boolean" ? v[1] : _U.badPort("a boolean (true or false)",
44+ v[1])} : _U.badPort("an array",v);
45+});
46+var elm_lang$core$Main$number = Elm.Native.Port.make(_elm).inbound("number",
47+"Int",
48+function (v) {
49+ return typeof v === "number" ? v : _U.badPort("a number",
50+ v);
51+});
52+var elm_lang$core$Main$userID = Elm.Native.Port.make(_elm).inbound("userID",
53+"String",
54+function (v) {
55+ return typeof v === "string" || typeof v === "object" && v instanceof String ? v : _U.badPort("a string",
56+ v);
57+});
tests/test-files/good-expected-js/PortsWithTypeAliases.elm.js+25−38
@@ -1,38 +1,25 @@
1−Elm.Main = Elm.Main || {};
2−Elm.Main.make = function (_elm) {
3− "use strict";
4− _elm.Main = _elm.Main || {};
5− if (_elm.Main.values)
6− return _elm.Main.values;
7− var _op = {},
8− _N = Elm.Native,
9− _U = _N.Utils.make(_elm),
10− _L = _N.List.make(_elm),
11− $moduleName = "Main";
12− var pairs = Elm.Native.Port.make(_elm).inbound("pairs",
13− "Main.Point String String",
14− function (v) {
15− return typeof v === "object" && "x" in v && "y" in v ? {_: {}
16− ,x: typeof v.x === "string" || typeof v.x === "object" && v.x instanceof String ? v.x : _U.badPort("a string",
17− v.x)
18− ,y: typeof v.y === "string" || typeof v.y === "object" && v.y instanceof String ? v.y : _U.badPort("a string",
19− v.y)} : _U.badPort("an object with fields `x`, `y`",
20− v);
21− });
22− var points = Elm.Native.Port.make(_elm).inbound("points",
23− "Main.Point2D",
24− function (v) {
25− return typeof v === "object" && "x" in v && "y" in v ? {_: {}
26− ,x: typeof v.x === "number" ? v.x : _U.badPort("a number",
27− v.x)
28− ,y: typeof v.y === "number" ? v.y : _U.badPort("a number",
29− v.y)} : _U.badPort("an object with fields `x`, `y`",
30− v);
31− });
32− var Point = F2(function (a,b) {
33− return {_: {},x: a,y: b};
34− });
35− _elm.Main.values = {_op: _op
36− ,Point: Point};
37− return _elm.Main.values;
38−};
1+var elm_lang$core$Main$_op = {};
2+var elm_lang$core$Main$pairs = Elm.Native.Port.make(_elm).inbound("pairs",
3+"Main.Point String String",
4+function (v) {
5+ return typeof v === "object" && "x" in v && "y" in v ? {_: {}
6+ ,x: typeof v.x === "string" || typeof v.x === "object" && v.x instanceof String ? v.x : _U.badPort("a string",
7+ v.x)
8+ ,y: typeof v.y === "string" || typeof v.y === "object" && v.y instanceof String ? v.y : _U.badPort("a string",
9+ v.y)} : _U.badPort("an object with fields `x`, `y`",
10+ v);
11+});
12+var elm_lang$core$Main$points = Elm.Native.Port.make(_elm).inbound("points",
13+"Main.Point2D",
14+function (v) {
15+ return typeof v === "object" && "x" in v && "y" in v ? {_: {}
16+ ,x: typeof v.x === "number" ? v.x : _U.badPort("a number",
17+ v.x)
18+ ,y: typeof v.y === "number" ? v.y : _U.badPort("a number",
19+ v.y)} : _U.badPort("an object with fields `x`, `y`",
20+ v);
21+});
22+var elm_lang$core$Main$Point = F2(function (a,
23+b) {
24+ return {_: {},x: a,y: b};
25+});
tests/test-files/good-expected-js/QuotesAndComments.elm.js+7−24
@@ -1,25 +1,8 @@
1−Elm.Main = Elm.Main || {};
2−Elm.Main.make = function (_elm) {
3− "use strict";
4− _elm.Main = _elm.Main || {};
5− if (_elm.Main.values)
6− return _elm.Main.values;
7− var _op = {},
8− _N = Elm.Native,
9− _U = _N.Utils.make(_elm),
10− _L = _N.List.make(_elm),
11− $moduleName = "Main";
12− var commentStart = "{-";
13− var singleQuote = _U.chr("\'");
14− var doubleQuote = _U.chr("\"");
15− var variablesWithPrimes = function (x) {
16− var x$ = x;
17− return x$;
18− };
19− _elm.Main.values = {_op: _op
20− ,variablesWithPrimes: variablesWithPrimes
21− ,doubleQuote: doubleQuote
22− ,singleQuote: singleQuote
23− ,commentStart: commentStart};
24− return _elm.Main.values;
1+var elm_lang$core$Main$_op = {};
2+var elm_lang$core$Main$commentStart = "{-";
3+var elm_lang$core$Main$singleQuote = _utils.chr("\'");
4+var elm_lang$core$Main$doubleQuote = _utils.chr("\"");
5+var elm_lang$core$Main$variablesWithPrimes = function (x) {
6+ var x$ = x;
7+ return x$;
258};
tests/test-files/good-expected-js/Soundness/Apply.elm.js+4−20
@@ -1,21 +1,5 @@
1−Elm.Main = Elm.Main || {};
2−Elm.Main.make = function (_elm) {
3− "use strict";
4− _elm.Main = _elm.Main || {};
5− if (_elm.Main.values)
6− return _elm.Main.values;
7− var _op = {},
8− _N = Elm.Native,
9− _U = _N.Utils.make(_elm),
10− _L = _N.List.make(_elm),
11− $moduleName = "Main";
12− var apply = function (f) {
13− var g = function (x) {
14− return f(x);
15− };
16− return g;
17− };
18− _elm.Main.values = {_op: _op
19− ,apply: apply};
20− return _elm.Main.values;
1+var elm_lang$core$Main$_op = {};
2+var elm_lang$core$Main$apply = function (f) {
3+ var g = function (x) { return f(x);};
4+ return g;
215};
tests/test-files/good-expected-js/Soundness/ApplyAnnotated.elm.js+4−20
@@ -1,21 +1,5 @@
1−Elm.Main = Elm.Main || {};
2−Elm.Main.make = function (_elm) {
3− "use strict";
4− _elm.Main = _elm.Main || {};
5− if (_elm.Main.values)
6− return _elm.Main.values;
7− var _op = {},
8− _N = Elm.Native,
9− _U = _N.Utils.make(_elm),
10− _L = _N.List.make(_elm),
11− $moduleName = "Main";
12− var apply = function (f) {
13− var g = function (x) {
14− return f(x);
15− };
16− return g;
17− };
18− _elm.Main.values = {_op: _op
19− ,apply: apply};
20− return _elm.Main.values;
1+var elm_lang$core$Main$_op = {};
2+var elm_lang$core$Main$apply = function (f) {
3+ var g = function (x) { return f(x);};
4+ return g;
215};
tests/test-files/good-expected-js/Soundness/Id.elm.js+5−21
@@ -1,21 +1,5 @@
1−Elm.Main = Elm.Main || {};
2−Elm.Main.make = function (_elm) {
3− "use strict";
4− _elm.Main = _elm.Main || {};
5− if (_elm.Main.values)
6− return _elm.Main.values;
7− var _op = {},
8− _N = Elm.Native,
9− _U = _N.Utils.make(_elm),
10− _L = _N.List.make(_elm),
11− $moduleName = "Main";
12− var myId = function () {
13− var id = function (x) {
14− return x;
15− };
16− return id;
17− }();
18− _elm.Main.values = {_op: _op
19− ,myId: myId};
20− return _elm.Main.values;
21−};
1+var elm_lang$core$Main$_op = {};
2+var elm_lang$core$Main$myId = function () {
3+ var id = function (x) { return x;};
4+ return id;
5+}();
tests/test-files/good-expected-js/Soundness/IdAnnotated.elm.js+5−21
@@ -1,21 +1,5 @@
1−Elm.Main = Elm.Main || {};
2−Elm.Main.make = function (_elm) {
3− "use strict";
4− _elm.Main = _elm.Main || {};
5− if (_elm.Main.values)
6− return _elm.Main.values;
7− var _op = {},
8− _N = Elm.Native,
9− _U = _N.Utils.make(_elm),
10− _L = _N.List.make(_elm),
11− $moduleName = "Main";
12− var myId = function () {
13− var id = function (x) {
14− return x;
15− };
16− return id;
17− }();
18− _elm.Main.values = {_op: _op
19− ,myId: myId};
20− return _elm.Main.values;
21−};
1+var elm_lang$core$Main$_op = {};
2+var elm_lang$core$Main$myId = function () {
3+ var id = function (x) { return x;};
4+ return id;
5+}();
tests/test-files/good-expected-js/Soundness/TrickyId.elm.js+4−18
@@ -1,19 +1,5 @@
1−Elm.Main = Elm.Main || {};
2−Elm.Main.make = function (_elm) {
3− "use strict";
4− _elm.Main = _elm.Main || {};
5− if (_elm.Main.values)
6− return _elm.Main.values;
7− var _op = {},
8− _N = Elm.Native,
9− _U = _N.Utils.make(_elm),
10− _L = _N.List.make(_elm),
11− $moduleName = "Main";
12− var myId = function (x) {
13− var y = x;
14− return y;
15− };
16− _elm.Main.values = {_op: _op
17− ,myId: myId};
18− return _elm.Main.values;
1+var elm_lang$core$Main$_op = {};
2+var elm_lang$core$Main$myId = function (x) {
3+ var y = x;
4+ return y;
195};
tests/test-files/good-expected-js/Soundness/TrickyIdAnnotated.elm.js+4−18
@@ -1,19 +1,5 @@
1−Elm.Main = Elm.Main || {};
2−Elm.Main.make = function (_elm) {
3− "use strict";
4− _elm.Main = _elm.Main || {};
5− if (_elm.Main.values)
6− return _elm.Main.values;
7− var _op = {},
8− _N = Elm.Native,
9− _U = _N.Utils.make(_elm),
10− _L = _N.List.make(_elm),
11− $moduleName = "Main";
12− var myId = function (x) {
13− var y = x;
14− return y;
15− };
16− _elm.Main.values = {_op: _op
17− ,myId: myId};
18− return _elm.Main.values;
1+var elm_lang$core$Main$_op = {};
2+var elm_lang$core$Main$myId = function (x) {
3+ var y = x;
4+ return y;
195};
tests/test-files/good-expected-js/Strings/Multiline.elm.js+2−16
@@ -1,16 +1,2 @@
1−Elm.Main = Elm.Main || {};
2−Elm.Main.make = function (_elm) {
3− "use strict";
4− _elm.Main = _elm.Main || {};
5− if (_elm.Main.values)
6− return _elm.Main.values;
7− var _op = {},
8− _N = Elm.Native,
9− _U = _N.Utils.make(_elm),
10− _L = _N.List.make(_elm),
11− $moduleName = "Main";
12− var s = "\nhere\'s a quote: \"\n\n";
13− _elm.Main.values = {_op: _op
14− ,s: s};
15− return _elm.Main.values;
16−};
1+var elm_lang$core$Main$_op = {};
2+var elm_lang$core$Main$s = "\nhere\'s a quote: \"\n\n";
tests/test-files/good-expected-js/Strings/MultilineNormal.elm.js+2−16
@@ -1,16 +1,2 @@
1−Elm.Main = Elm.Main || {};
2−Elm.Main.make = function (_elm) {
3− "use strict";
4− _elm.Main = _elm.Main || {};
5− if (_elm.Main.values)
6− return _elm.Main.values;
7− var _op = {},
8− _N = Elm.Native,
9− _U = _N.Utils.make(_elm),
10− _L = _N.List.make(_elm),
11− $moduleName = "Main";
12− var s = "\nhere\'s a quote: \"\n\n";
13− _elm.Main.values = {_op: _op
14− ,s: s};
15− return _elm.Main.values;
16−};
1+var elm_lang$core$Main$_op = {};
2+var elm_lang$core$Main$s = "\nhere\'s a quote: \"\n\n";
tests/test-files/good-expected-js/TailRecursive.elm.js+16−28
@@ -1,28 +1,16 @@
1−Elm.Main = Elm.Main || {};
2−Elm.Main.make = function (_elm) {
3− "use strict";
4− _elm.Main = _elm.Main || {};
5− if (_elm.Main.values)
6− return _elm.Main.values;
7− var _op = {},
8− _N = Elm.Native,
9− _U = _N.Utils.make(_elm),
10− _L = _N.List.make(_elm),
11− $moduleName = "Main";
12− var any = F2(function (f,l) {
13− _v0: while (true) {
14− switch (l.ctor)
15− {case "::": if (f(l._0))
16− return true; else {
17− var _v4 = f,_v5 = l._1;
18− f = _v4;
19− l = _v5;
20− continue _v0;
21− }}
22− return false;
23− }
24− });
25− _elm.Main.values = {_op: _op
26− ,any: any};
27− return _elm.Main.values;
28−};
1+var elm_lang$core$Main$_op = {};
2+var elm_lang$core$Main$any = F2(function (f,l) {
3+ any: while (true) {
4+ var _p0 = l;
5+ switch (_p0.ctor)
6+ {case "::": var x = _p0._0;
7+ var xs = _p0._1;
8+ if (f(x)) return true; else {
9+ var _v0 = f,_v1 = xs;
10+ f = _v0;
11+ l = _v1;
12+ continue any;
13+ }
14+ default: return false;}
15+ }
16+});
tests/test-files/good-expected-js/Unify/NonHomogeneousRecords.elm.js+10−24
@@ -1,24 +1,10 @@
1−Elm.Main = Elm.Main || {};
2−Elm.Main.make = function (_elm) {
3− "use strict";
4− _elm.Main = _elm.Main || {};
5− if (_elm.Main.values)
6− return _elm.Main.values;
7− var _op = {},
8− _N = Elm.Native,
9− _U = _N.Utils.make(_elm),
10− _L = _N.List.make(_elm),
11− $moduleName = "Main";
12− var f = function (t) {
13− var y = t.y;
14− var x = t.x;
15− return t;
16− };
17− var Thing = F2(function (a,b) {
18− return {_: {},x: a,y: b};
19− });
20− _elm.Main.values = {_op: _op
21− ,Thing: Thing
22− ,f: f};
23− return _elm.Main.values;
24−};
1+var elm_lang$core$Main$_op = {};
2+var elm_lang$core$Main$f = function (t) {
3+ var y = t.y;
4+ var x = t.x;
5+ return t;
6+};
7+var elm_lang$core$Main$Thing = F2(function (a,
8+b) {
9+ return {_: {},x: a,y: b};
10+});