staafl

Untitled

May 4th, 2013
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. //classical inheritance
  2. var extend = !function () {
  3. function Proxy() {}
  4.  
  5. return function (Child, Parent, protoProps) {
  6. Proxy.prototype = Parent.prototype;
  7. Child.prototype = new Proxy();
  8. Child.prototype.constructor = Child;
  9.  
  10. protoProps = protoProps || {};
  11.  
  12. for (var prop in protoProps) {
  13. if (protoProps.hasOwnProperty(prop)) {
  14. Child.prototype[prop] = protoProps[prop];
  15. }
  16. }
  17. };
  18. }();
Advertisement
Add Comment
Please, Sign In to add comment