function-this-in-arguments.js 288 B

1234567891011121314151617
  1. load("test-common.js");
  2. try {
  3. assert(typeof this === "object");
  4. assert(this === globalThis);
  5. function Foo() {
  6. this.x = 5;
  7. assert(typeof this === "object");
  8. assert(this.x === 5);
  9. }
  10. new Foo();
  11. console.log("PASS");
  12. } catch (err) {
  13. console.log("FAIL: " + err);
  14. }