Skip to content

Commit

Permalink
Merge pull request vuejs#1498 from vprimachenko/dev
Browse files Browse the repository at this point in the history
fix `(k,v) in o` bugs with falsy values
  • Loading branch information
yyx990803 committed Oct 28, 2015
2 parents aed6625 + 125b655 commit 09d2685
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/directives/public/for.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ module.exports = {
if (key) {
frag.scope.$key = key
}
// update interator
// update iterator
if (iterator) {
frag.scope[iterator] = key || i
frag.scope[iterator] = key !== null ? key : i
}
// update data for track-by, object repeat &
// primitive values.
Expand Down Expand Up @@ -218,7 +218,7 @@ module.exports = {
_.define(scope, '$key', null)
}
if (this.iterator) {
_.defineReactive(scope, this.iterator, key || index)
_.defineReactive(scope, this.iterator, key !== null ? key : index)
}
var frag = this.factory.create(host, scope, this._frag)
frag.forId = this.id
Expand Down

0 comments on commit 09d2685

Please sign in to comment.