shim.js 394 B

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