home
/
code
/
cellular-automata.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Throw appropriate error objects, rather than just strings
[cellular-automata.git]
/
life
/
006
/
life.ts
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.022083 seconds
and
4
git commands to generate.