1 2 3 4 5 6 7 8 9 10 11 12 13
function foo(x) { return bar(x); } function bar(x) { return x.f + 10; } var g = Object(); g.f = 10; assertEq(foo(g), 20); assertEq(foo(g), 20); assertEq(foo(g), 20); eval("g.f = 'three'"); assertEq(foo(g), 'three10');