mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-10-26 14:57:54 +03:00
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:
parent
e6b1e54c44
commit
8b7ad09a07
Notes:
sideshowbarker
2024-07-16 23:57:20 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/8b7ad09a07 Pull-request: https://github.com/SerenityOS/serenity/pull/24504
10
Userland/Libraries/LibJS/Tests/copy-this-to-local.js
Normal file
10
Userland/Libraries/LibJS/Tests/copy-this-to-local.js
Normal 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);
|
||||
});
|
Loading…
Reference in New Issue
Block a user