mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibJS: Evaluate CallExpression arguments before pushing a CallFrame
This commit is contained in:
parent
8f08ec5038
commit
bb15b37228
Notes:
sideshowbarker
2024-07-19 08:00:14 +09:00
Author: https://github.com/jack-karamanian
Commit: bb15b37228
Pull-request: https://github.com/SerenityOS/serenity/pull/1573
2 changed files with 23 additions and 2 deletions
17
Libraries/LibJS/Tests/function-this-in-arguments.js
Normal file
17
Libraries/LibJS/Tests/function-this-in-arguments.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
function assert(x) { if (!x) throw 1; }
|
||||
|
||||
try {
|
||||
assert(typeof this === "object");
|
||||
assert(this === global);
|
||||
|
||||
function Foo() {
|
||||
this.x = 5;
|
||||
assert(typeof this === "object");
|
||||
assert(this.x === 5);
|
||||
}
|
||||
|
||||
new Foo();
|
||||
console.log("PASS");
|
||||
} catch (err) {
|
||||
console.log("FAIL: " + err);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue