Serafim

Untitled

Sep 4th, 2013
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var Observable, Some,
  2.   __hasProp = {}.hasOwnProperty,
  3.   __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
  4.  
  5. Observable = (function() {
  6.   function Observable() {}
  7.  
  8.   Observable.prototype.set = function(name, value) {
  9.     this["_" + name] = value;
  10.     this.__defineSetter__(name, function(data) {
  11.       return this["_" + name] = value * 5;
  12.     });
  13.     this.__defineGetter__(name, function() {
  14.       return this["_" + name];
  15.     });
  16.     return this;
  17.   };
  18.  
  19.   return Observable;
  20.  
  21. })();
  22.  
  23. Some = (function(_super) {
  24.   __extends(Some, _super);
  25.  
  26.   function Some() {
  27.     this.set("vaule", 42);
  28.   }
  29.  
  30.   return Some;
  31.  
  32. })(Observable);
Advertisement
Add Comment
Please, Sign In to add comment