Skip to content

Commit

Permalink
Changed getter and setter definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
giuliandrimba committed Mar 26, 2013
1 parent 8700537 commit 44bb66c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 4 additions & 2 deletions lib/theoricus.js
Original file line number Diff line number Diff line change
Expand Up @@ -11275,8 +11275,10 @@ var theoricus = window.theoricus = {'config':{},'core':{},'mvc':{'lib':{}},'util
throw new Error(msg);
}
};
this.prototype.__defineGetter__(field, getter);
return this.prototype.__defineSetter__(field, setter);
return Object.defineProperty(this.prototype, field, {
get: getter,
set: setter
});
};

/*
Expand Down
3 changes: 1 addition & 2 deletions www/src/mvc/model.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ class theoricus.mvc.Model extends theoricus.mvc.lib.Binder
msg = "Property '#{prop}' must to be #{stype}."
throw new Error msg

@::.__defineGetter__ field, getter
@::.__defineSetter__ field, setter
Object.defineProperty @::, field, get:getter, set:setter



Expand Down

0 comments on commit 44bb66c

Please sign in to comment.