blob: 493214e3b115fa128c81de48aa234b695b00505e (
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();
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);
|