1 2 3 4 5 6 7 8 9 10 11
this.name = "outer"; var sb = evalcx(''); sb.name = "inner"; sb.parent = this; function f() { assertEq(this.name, "outer"); } evalcx('with(this) { ff = parent.f; }; (function() { eval(""); for(var i=0; i<10; i++) { ff() } })()', sb);