first-index.js 422 B

1234567891011121314151617
  1. "use strict";
  2. module.exports = function (t, a) {
  3. var x;
  4. a(t.call([]), null, "Empty");
  5. a(t.call([null]), 0, "One value");
  6. a(t.call([1, 2, 3]), 0, "Many values");
  7. a(t.call(new Array(1000)), null, "Sparse empty");
  8. x = [];
  9. x[883] = undefined;
  10. x[890] = null;
  11. a(t.call(x), 883, "Manual sparse, distant value");
  12. x = new Array(1000);
  13. x[657] = undefined;
  14. x[700] = null;
  15. a(t.call(x), 657, "Sparse, distant value");
  16. };