Skip to content

Commit

Permalink
add computed property tests, and scope prop local variable correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Mar 2, 2017
1 parent 9725351 commit 7ed92ad
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 3 deletions.
5 changes: 4 additions & 1 deletion dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* @param {Object} computed
*/
var initComputed = function (instance, computed) {
for (var prop in computed) {
var setComputedProperty = function (prop) {
var properties = {
get: function () {
return computed[prop].get.call(instance);
Expand All @@ -46,6 +46,9 @@
};
}
Object.defineProperty(instance.$data, prop, properties);
};
for (var propName in computed) {
setComputedProperty(propName);
}
};

Expand Down
Loading

0 comments on commit 7ed92ad

Please sign in to comment.