blob: 1346cefe3c813fe673764e3a39a4e31416cfb617 [file] [log] [blame]
sbarati@apple.com36c13402015-09-18 23:37:42 +00001function f() {
2 return 20;
3}
4noInline(f);
5
6function bar(b) {
7 if (b)
8 throw new Error("blah!");
9}
10
11function Foo(b) {
12 try {
13 this.value = bar(b);
14 } catch(e) {
15 this.value = e.toString();
16 }
17
18 f(this.value, b);
19}
20noInline(Foo);
21
22
23for (var i = 1; i < 1000; i++) {
24 let value = new Foo(i % 3 === 0);
25 if (i % 3 === 0 && value.value !== "Error: blah!")
26 throw new Error("bad value: " + value.value);
27}