blob: 74459075dedcd2991311eca5f8ae87f95b73434f [file] [log] [blame]
ticaiolima@gmail.com9ca174d2018-01-20 12:53:52 +00001function assert(a) {
2 if (!a)
3 throw new Error("Bad assertion");
4}
5
6let o = {
7 valueOf: () => {
8 throw new Error("Bad");
9 return 2;
10 }
11}
12
13let a = 2;
14try {
15 a.toString(o);
16 assert(false);
17} catch (e) {
18 assert(e.message == "Bad");
19}
20