LibJS: Add test to verify copying this to a local doesn't break

Co-Authored-By: Simon Wanner <simon+git@skyrising.xyz>
This commit is contained in:
Andreas Kling 2024-06-01 07:03:34 +02:00
parent e6b1e54c44
commit 8b7ad09a07
Notes: sideshowbarker 2024-07-16 23:57:20 +09:00

View File

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