1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 07:34:58 +00:00
serenity/Libraries/LibJS/Tests/function-this-in-arguments.js

17 lines
300 B
JavaScript

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);
}