michael@0: function neg0(x) { michael@0: return x===0 && (1/x)===-Infinity; michael@0: } michael@0: michael@0: function test(x,y) { michael@0: if (x == 1.1) michael@0: return 0; michael@0: else if (x == "a") michael@0: return 0; michael@0: return x*y michael@0: } michael@0: michael@0: var t = 0; michael@0: for(var i=0; i<1005; i++) { michael@0: test(1.1) michael@0: test("a") michael@0: t = test((i<1003)?i:-0, 0); michael@0: } michael@0: michael@0: assertEq(neg0(t), true);