utilities.js 474 B

123456789101112131415161718192021
  1. var util = {
  2. inherits: function(ctor, superCtor) {
  3. ctor.super_ = superCtor;
  4. ctor.prototype = Object.create(superCtor.prototype, {
  5. constructor: {
  6. value: ctor,
  7. enumerable: false,
  8. writable: true,
  9. configurable: true
  10. }
  11. });
  12. },
  13. extend: function(dest, source) {
  14. for(var key in source) {
  15. if(source.hasOwnProperty(key)) {
  16. dest[key] = source[key];
  17. }
  18. }
  19. return dest;
  20. }
  21. }