ladybird/Userland/Libraries/LibJS/Tests/copy-this-to-local.js
Andreas Kling 8b7ad09a07 LibJS: Add test to verify copying this to a local doesn't break
Co-Authored-By: Simon Wanner <simon+git@skyrising.xyz>
2024-06-01 09:39:50 +02:00

10 lines
215 B
JavaScript

test("copy this to a local", () => {
const foo = {
foo() {
let thisCopy = this;
thisCopy = "oops";
return this;
},
};
expect(foo.foo()).toBe(foo);
});