copy.js 512 B

12345678910111213141516171819202122
  1. "use strict";
  2. module.exports = function (t, a) {
  3. var foo = "raz", bar = "dwa";
  4. // eslint-disable-next-line func-names
  5. var fn = function marko(a, b) {
  6. return this + a + b + foo + bar;
  7. };
  8. var result, o = {};
  9. fn.prototype = o;
  10. fn.foo = "raz";
  11. result = t.call(fn);
  12. a(result.length, fn.length, "Length");
  13. a(result.name, fn.name, "Length");
  14. a(result.call("marko", "el", "fe"), "markoelferazdwa", "Body");
  15. a(result.prototype, fn.prototype, "Prototype");
  16. a(result.foo, fn.foo, "Custom property");
  17. };