Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
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.

function-bind-context.js 599B

123456789101112131415161718192021222324
  1. var aFunction = require('../internals/a-function');
  2. // optional / simple context binding
  3. module.exports = function (fn, that, length) {
  4. aFunction(fn);
  5. if (that === undefined) return fn;
  6. switch (length) {
  7. case 0: return function () {
  8. return fn.call(that);
  9. };
  10. case 1: return function (a) {
  11. return fn.call(that, a);
  12. };
  13. case 2: return function (a, b) {
  14. return fn.call(that, a, b);
  15. };
  16. case 3: return function (a, b, c) {
  17. return fn.call(that, a, b, c);
  18. };
  19. }
  20. return function (/* ...args */) {
  21. return fn.apply(that, arguments);
  22. };
  23. };