项目原始demo,不改动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 

18 lines
394 B

  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. };