1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:28:10 +00:00

LibJS: Set the bound |this| value to the |this| value of the current

scope for arrow functions
This commit is contained in:
Jack Karamanian 2020-05-30 00:13:42 -05:00 committed by Andreas Kling
parent c12125fa81
commit 45ccd9f8d9
3 changed files with 16 additions and 4 deletions

View file

@ -64,6 +64,19 @@ try {
assert(foo === undefined);
assert(bar === undefined);
function FooBar() {
this.x = {
y: () => this,
z: function () {
return (() => this)();
}
};
}
var foobar = new FooBar();
assert(foobar.x.y() === foobar);
assert(foobar.x.z() === foobar.x);
(() => {
"use strict";
assert(isStrictMode());