blob: e52693162cadadd254c93a490b5360cf4394d9c9 [file] [log] [blame]
fpizlo@apple.com152abff2012-06-19 23:10:12 +00001description(
2"Tests what happens if we fail to constant fold a LogicalNot that leads into a branch, when the CFA proves that the LogicalNot has a constant value."
3);
4
5function foo1(o) {
6 if (!!o.thingy)
7 return o.thingy(42);
8 else
9 return o.otherThingy(57);
10}
11
12function foo2(o) {
13 if (!o.thingy)
14 return o.otherThingy(42);
15 else
16 return o.thingy(57);
17}
18
19function Stuff() {
20}
21
22Stuff.prototype = {
23 thingy: function(x) { return x + 1; },
24 otherThingy: function(x) { return x - 1; }
25};
26
fpizlo@apple.com0fa83862013-09-06 19:01:21 +000027dfgShouldBe(foo1, "foo1(new Stuff())", "43");
28dfgShouldBe(foo2, "foo2(new Stuff())", "58");