home
/
code
/
cellular-automata.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
ecf4b00
)
Throw appropriate error objects, rather than just strings
author
Siraaj Khandkar
<siraaj@khandkar.net>
Thu, 4 Aug 2016 19:53:41 +0000
(15:53 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Thu, 4 Aug 2016 19:53:41 +0000
(15:53 -0400)
life/006/life.ts
patch
|
blob
|
blame
|
history
diff --git
a/life/006/life.ts
b/life/006/life.ts
index
58f3f8b
..
e99d3fd
100644
(file)
--- a/
life/006/life.ts
+++ b/
life/006/life.ts
@@
-109,7
+109,7
@@
namespace Life {
switch (i)
{ case 0 : return "Dead"
; case 1 : return "Alive"
switch (i)
{ case 0 : return "Dead"
; case 1 : return "Alive"
- ; default: throw("No known State for integer: " + i)
+ ; default: throw
new RangeError
("No known State for integer: " + i)
}
};
}
};
@@
-117,7
+117,7
@@
namespace Life {
switch (t)
{ case "Dead" : return " "
; case "Alive": return "o"
switch (t)
{ case "Dead" : return " "
; case "Alive": return "o"
- ; default : throw("Illegal member of Life.State.T: " + t)
+ ; default : throw
new TypeError
("Illegal member of Life.State.T: " + t)
}
};
}
};
@@
-125,7
+125,7
@@
namespace Life {
switch (t)
{ case "Dead" : return false
; case "Alive": return true
switch (t)
{ case "Dead" : return false
; case "Alive": return true
- ; default : throw("Illegal member of Life.State.T: " + t)
+ ; default : throw
new TypeError
("Illegal member of Life.State.T: " + t)
}
};
}
};
This page took
0.02555 seconds
and
4
git commands to generate.