diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/debug/Environment-setVariable-11.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/debug/Environment-setVariable-11.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,16 @@ +// setVariable cannot modify the binding for a FunctionExpression's name. + +load(libdir + "asserts.js"); + +var g = newGlobal(); +var dbg = Debugger(g); +var hits = 0; +dbg.onDebuggerStatement = function (frame) { + var env = frame.environment.find("f"); + assertEq(env.getVariable("f"), frame.callee); + assertThrowsInstanceOf(function () { env.setVariable("f", 0) }, TypeError); + assertThrowsInstanceOf(function () { env.setVariable("f", frame.callee) }, TypeError); + hits++; +}; +g.eval("(function f() { debugger; })();"); +assertEq(hits, 1);