ladybird/Userland/Libraries/LibJS/Tests/functions/function-assignment-in-arguments.js
Jonne Ransijn e53e1d3586 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.
2024-11-08 19:16:56 +01:00

5 lines
158 B
JavaScript

test("overwriting this during function call still binds the original", () => {
let tmp = new Map();
// prettier-ignore
tmp.set("", tmp = []);
});