summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-this-08.js
blob: 4346115865ea21c665728142cc54de321cf373b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Frame.this and evalInFrame in arrow function that uses 'this'.
var g = newGlobal({newCompartment: true});
g.eval("x = 4");
g.eval("var foo = function() { 'use strict'; return () => this; }; var arrow = foo.call(3);");
var dbg = new Debugger(g);
var hits = 0;
dbg.onEnterFrame = function (frame) {
    if (frame.type === "eval")
	return;
    hits++;
    assertEq(frame.type, "call");
    assertEq(frame.this, 3);
    assertEq(frame.eval("this + 1").return, 4);
};
g.eval("arrow();");
assertEq(hits, 1);