Skip to content

Commit 6626d3b

Browse files
committed
functional tests pass
1 parent a847fdd commit 6626d3b

File tree

9 files changed

+97
-396
lines changed

9 files changed

+97
-396
lines changed

examples/todomvc/js/app.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,7 @@
115115
},
116116

117117
removeCompleted: function () {
118-
this.todos.$remove(function (todo) {
119-
return todo.completed;
120-
});
118+
this.todos = this.todos.filter(filters.active);
121119
todoStorage.save();
122120
}
123121
}

src/compiler.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ function Compiler (vm, options) {
120120
// because they are ienumerable
121121
if (compiler.repeat) {
122122
compiler.createBinding('$index')
123-
if (data.$key) compiler.createBinding('$key')
123+
if (data.$key) {
124+
compiler.createBinding('$key')
125+
}
124126
}
125127

126128
// now parse the DOM, during which we will create necessary bindings
@@ -604,13 +606,13 @@ CompilerProto.defineProp = function (key, binding) {
604606

605607
// make sure the key is present in data
606608
// so it can be observed
607-
if (!(key in data)) {
609+
if (!(hasOwn.call(data, key))) {
608610
data[key] = undefined
609611
}
610612

611613
// if the data object is already observed, but the key
612614
// is not observed, we need to add it to the observed keys.
613-
if (ob && !(key in ob.values)) {
615+
if (ob && !(hasOwn.call(ob.values, key))) {
614616
Observer.convertKey(data, key)
615617
}
616618

0 commit comments

Comments
 (0)