michael@0: michael@0: function testEval(x, y) { michael@0: x = 5; michael@0: eval("arguments[0] += 10"); michael@0: assertEq(x, 15); michael@0: } michael@0: for (var i = 0; i < 5; i++) michael@0: testEval(3); michael@0: michael@0: function testEvalWithArguments(x, y) { michael@0: eval("arguments[0] += 10"); michael@0: assertEq(arguments[y], 13); michael@0: } michael@0: for (var i = 0; i < 5; i++) michael@0: testEvalWithArguments(3, 0); michael@0: michael@0: function testNestedEval(x, y) { michael@0: x = 5; michael@0: eval("eval('arguments[0] += 10')"); michael@0: assertEq(x, 15); michael@0: } michael@0: for (var i = 0; i < 5; i++) michael@0: testNestedEval(3); michael@0: michael@0: function testWith(x, y) { michael@0: with ({}) { michael@0: arguments[0] += 10; michael@0: assertEq(x, 13); michael@0: } michael@0: } michael@0: for (var i = 0; i < 5; i++) michael@0: testWith(3);