Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 // After an implicit toString call throws an exception, the calling frame's
2 // onStep hook fires.
4 var g = newGlobal();
5 g.eval("var x = {toString: function () { debugger; log += 'x'; throw 'mud'; }};");
7 var dbg = Debugger(g);
8 dbg.onDebuggerStatement = function (frame) {
9 g.log += 'd';
10 frame.older.onStep = function () {
11 if (!g.log.match(/[sy]$/))
12 g.log += 's';
13 };
14 };
16 g.log = '';
17 g.eval("try { x + ''; } catch (x) { }\n" +
18 "log += 'y';\n");
19 assertEq(g.log, "dxsy");
21 g.log = '';
22 g.eval("try { '' + x; } catch (x) { }\n" +
23 "log += 'y';\n");
24 assertEq(g.log, "dxsy");