on master help sign in
And a few more places with bad throws.
30319a3Dobes Vandermeer
core-js/Graphics/Element.js+2−2
@@ -481,7 +481,7 @@ Elm.Graphics = function() {
481 var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4];
481 var case1 = case0[1], case2 = case0[2], case3 = case0[3], case4 = case0[4];
482 return Form_84(t_212 + case1)(case2)(case3)(case4)
482 return Form_84(t_212 + case1)(case2)(case3)(case4)
483 }
483 }
484− throw"Non-exhaustive pattern match in case";
484+ throw new Error("Non-exhaustive pattern match in case");
485 }(Form$thetascaleposform_213)
485 }(Form$thetascaleposform_213)
486 }
486 }
487 }
487 }
@@ -505,7 +505,7 @@ Elm.Graphics = function() {
505 }
505 }
506 break
506 break
507 }
507 }
508− throw"Non-exhaustive pattern match in case";
508+ throw new Error("Non-exhaustive pattern match in case");
509 }(Form$thetascaleTuple2$pxpyform_226)
509 }(Form$thetascaleTuple2$pxpyform_226)
510 }
510 }
511 }
511 }
core-js/List.js+6−6
@@ -1,7 +1,7 @@
1Elm.List = function() {
1Elm.List = function() {
2
2
3 var throwError = function(f) {
3 var throwError = function(f) {
4− throw "Function '" + f + "' expecting a list!";
4+ throw new Error("Function '" + f + "' expecting a list!");
5 }
5 }
6
6
7 function length(xs) {
7 function length(xs) {
@@ -46,19 +46,19 @@ Elm.List = function() {
46 var minimum = foldl1(function(x) { return function(y) { return Math.min(x,y) } });
46 var minimum = foldl1(function(x) { return function(y) { return Math.min(x,y) } });
47 function head(v) {
47 function head(v) {
48 if (v[0] !== "Cons") {
48 if (v[0] !== "Cons") {
49− throw "Error: 'head' only accepts lists of length greater than one.";
49+ throw new Error("Error: 'head' only accepts lists of length greater than one.");
50 }
50 }
51 return v[1];
51 return v[1];
52 }
52 }
53 function tail(v) {
53 function tail(v) {
54 if (v[0] !== "Cons") {
54 if (v[0] !== "Cons") {
55− throw "Error: 'tail' only accepts lists of length greater than one.";
55+ throw new Error("Error: 'tail' only accepts lists of length greater than one.");
56 }
56 }
57 return v[2];
57 return v[2];
58 }
58 }
59 function last(v) {
59 function last(v) {
60 if (v[0] !== "Cons") {
60 if (v[0] !== "Cons") {
61− throw "Error: 'last' only accepts lists of length greater than one.";
61+ throw new Error("Error: 'last' only accepts lists of length greater than one.");
62 }
62 }
63 var out = v[1];
63 var out = v[1];
64 while (v[0] === "Cons") {
64 while (v[0] === "Cons") {
@@ -129,7 +129,7 @@ Elm.List = function() {
129 }
129 }
130 function foldr1(f) {
130 function foldr1(f) {
131 return function(xs) {
131 return function(xs) {
132− if (xs[0] === "Nil") { throw "'foldr1' requires an non-empty list." }
132+ if (xs[0] === "Nil") { throw new Error("'foldr1' requires an non-empty list.") }
133 if (xs[0] !== "Cons") { throwError('foldr1'); }
133 if (xs[0] !== "Cons") { throwError('foldr1'); }
134 var arr = [];
134 var arr = [];
135 while (xs[0] === "Cons") {
135 while (xs[0] === "Cons") {
@@ -165,7 +165,7 @@ Elm.List = function() {
165 function scanl1(f) {
165 function scanl1(f) {
166 return function(xs) {
166 return function(xs) {
167 if (xs[0] !== "Cons") {
167 if (xs[0] !== "Cons") {
168− throw "Error: 'scanl1' requires a list of at least length 1.";
168+ throw new Error("Error: 'scanl1' requires a list of at least length 1.");
169 }
169 }
170 return scanl(f)(xs[1])(xs[2]);
170 return scanl(f)(xs[1])(xs[2]);
171 }
171 }
core-js/Prelude.js+1−1
@@ -37,7 +37,7 @@ Elm.Prelude = function() {
37 };
37 };
38 var uncurry = function(f) { return function(p) {
38 var uncurry = function(f) { return function(p) {
39 if (p[0] !== "Tuple2") {
39 if (p[0] !== "Tuple2") {
40− throw "Function was uncurry'd but was not given a pair.";
40+ throw new Error("Function was uncurry'd but was not given a pair.");
41 }
41 }
42 return f(p[1])(p[2]); };
42 return f(p[1])(p[2]); };
43 };
43 };