mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-11-10 10:11:04 +00:00
LibJS: Preserve the original this value
As shown in the test added by this patch, it was possible to re-assign the `this` value of a member function call while it was executing. Let's copy the original this value like we already do with the callee. Fixes #2226.
This commit is contained in:
parent
f4124c7f40
commit
e53e1d3586
Notes:
github-actions[bot]
2024-11-08 18:17:48 +00:00
Author: https://github.com/yyny
Commit: e53e1d3586
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2231
2 changed files with 15 additions and 8 deletions
|
|
@ -0,0 +1,5 @@
|
|||
test("overwriting this during function call still binds the original", () => {
|
||||
let tmp = new Map();
|
||||
// prettier-ignore
|
||||
tmp.set("", tmp = []);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue