shim.js 421 B

1234567891011121314151617181920212223
  1. "use strict";
  2. exports.__generic = function (t, a) {
  3. var count = 0, o = {}, self = Object(this);
  4. a(
  5. t.call(
  6. self,
  7. function (value, i, scope) {
  8. a(value, this[i], "Value");
  9. a(i, count++, "Index");
  10. a(scope, this, "Scope");
  11. },
  12. self
  13. ),
  14. -1,
  15. "Falsy result"
  16. );
  17. a(count, 3);
  18. count = -1;
  19. a(t.call(this, function () { return ++count ? o : null; }, this), 1, "Truthy result");
  20. a(count, 1);
  21. };