function-length.js 324 B

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