function-length.js 349 B

1234567891011121314151617
  1. load("test-common.js");
  2. try {
  3. function foo() { }
  4. assert(foo.length === 0);
  5. assert((foo.length = 5) === 5);
  6. assert(foo.length === 0);
  7. function bar(a, b, c) {}
  8. assert(bar.length === 3);
  9. assert((bar.length = 5) === 5);
  10. assert(bar.length === 3);
  11. console.log("PASS");
  12. } catch (e) {
  13. console.log("FAIL: " + e);
  14. }