Support getters and setters #19

wants to merge 4 commits into


None yet

2 participants


Fixes support for getters and setters where supported by the engine. This only works if the getter/setter is set on the mixed in object directly.

Also cleaned up whitespace and linting errors and added a .gitignore.

Haven't added tests due to the issues in #17 and #18.


var Counter = Compose(function(){
  this._i = 0;
}, {
  get next(){
    return this._i++;

var counter = new Counter;; // 0; // 1; // 2
kriszyp commented Feb 25, 2012

I had started on something like this. However, the getter/setter code needs to be in it's own module, and only loaded in server environment or if user selects it. There is no reason for this code to add size to the browser version of compose.js.


Hmm, not sure how that would be achieved though. Dependency injection for the mixin method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment