michael@0: // Frame.prototype.this in strict-mode functions, with primitive values michael@0: michael@0: var g = newGlobal(); michael@0: var dbg = new Debugger(g); michael@0: var hits = 0; michael@0: dbg.onDebuggerStatement = function (frame) { michael@0: hits++; michael@0: assertEq(frame.this, g.v); michael@0: }; michael@0: michael@0: g.eval("function f() { 'use strict'; debugger; }"); michael@0: michael@0: g.eval("Boolean.prototype.f = f; v = true; v.f();"); michael@0: g.eval("f.call(v);"); michael@0: g.eval("Number.prototype.f = f; v = 3.14; v.f();"); michael@0: g.eval("f.call(v);"); michael@0: g.eval("String.prototype.f = f; v = 'hello'; v.f();"); michael@0: g.eval("f.call(v);"); michael@0: g.eval("v = undefined; f.call(v);"); michael@0: g.eval("v = null; f.call(v);"); michael@0: michael@0: assertEq(hits, 8);