Skip to content

Commit 09d2685

Browse files
committed
Merge pull request #1498 from vprimachenko/dev
fix `(k,v) in o` bugs with falsy values
2 parents aed6625 + 125b655 commit 09d2685

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/directives/public/for.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,9 @@ module.exports = {
122122
if (key) {
123123
frag.scope.$key = key
124124
}
125-
// update interator
125+
// update iterator
126126
if (iterator) {
127-
frag.scope[iterator] = key || i
127+
frag.scope[iterator] = key !== null ? key : i
128128
}
129129
// update data for track-by, object repeat &
130130
// primitive values.
@@ -218,7 +218,7 @@ module.exports = {
218218
_.define(scope, '$key', null)
219219
}
220220
if (this.iterator) {
221-
_.defineReactive(scope, this.iterator, key || index)
221+
_.defineReactive(scope, this.iterator, key !== null ? key : index)
222222
}
223223
var frag = this.factory.create(host, scope, this._frag)
224224
frag.forId = this.id

0 commit comments

Comments
 (0)