summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/arrow-functions/this-5.js
blob: 98b7bf81680518f26766a2f4ff71057b6bf78600 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// Arrow functions can have primitive |this| values.

Number.prototype.foo = function() {
    "use strict";
    return () => this;
}

for (var i=0; i<5; i++) {
    var n = i.foo()();
    assertEq(typeof n, "number");
    assertEq(n, i);
}