michael@0: function f(o, p) { michael@0: try {} catch(e) {}; michael@0: return o[p]; michael@0: } michael@0: function test() { michael@0: var o = {foo: 1, bar: 2, foobar: 3}; michael@0: michael@0: for (var i = 0; i < 30; i++) { michael@0: assertEq(f(o, "foo1".substr(0, 3)), 1); michael@0: assertEq(f(o, "bar1".substr(0, 3)), 2); michael@0: assertEq(f(o, "foobar1".substr(0, 6)), 3); michael@0: } michael@0: } michael@0: test();