copy.js 509 B

1234567891011121314151617181920
  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) { return this + a + b + foo + bar; };
  6. var result, o = {};
  7. fn.prototype = o;
  8. fn.foo = "raz";
  9. result = t.call(fn);
  10. a(result.length, fn.length, "Length");
  11. a(result.name, fn.name, "Length");
  12. a(result.call("marko", "el", "fe"), "markoelferazdwa", "Body");
  13. a(result.prototype, fn.prototype, "Prototype");
  14. a(result.foo, fn.foo, "Custom property");
  15. };