diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/pic/callname-eager-this2.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/pic/callname-eager-this2.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,25 @@ +this.name = "outer"; + +var sb = evalcx(''); +sb.name = "inner"; +sb.parent = this; + +var res = 0; + +function f() { + assertEq(this.name, "outer"); + res++; +} + +// ff is a property of the inner global object. Generate a CALLNAME IC, then +// change ff to a function on the outer global. It should get the inner this +// value. +evalcx('this.ff = function() {};' + + '(function() { ' + + 'eval("");' + + 'for(var i=0; i<10; i++) {' + + 'ff();' + + 'if (i == 5) ff = parent.f;' + + '}' + + '})()', sb); +assertEq(res, 4);