Commit cad6936104a79a67373781dd13199377e5726f60
set: fix setting empty value
Matt McKegg committed on 10/10/2016, 1:06:42 PMParent: 4c9ff2e15d10208c68d4ce7a98c9f26019f94439
Files changed
set.js | changed |
set.js | ||
---|---|---|
@@ -73,11 +73,13 @@ | ||
73 | 73 … | |
74 | 74 … | ProtoSet.prototype.set = function (values) { |
75 | 75 … | var self = this |
76 | 76 … | self.sources.length = 0 |
77 | - values.forEach(function (value) { | |
78 | - self.sources.push(value) | |
79 | - }) | |
77 … | + if (Array.isArray(values)) { | |
78 … | + values.forEach(function (value) { | |
79 … | + self.sources.push(value) | |
80 … | + }) | |
81 … | + } | |
80 | 82 … | self.binder.onUpdate() |
81 | 83 … | } |
82 | 84 … | |
83 | 85 … | ProtoSet.prototype.get = function (index) { |
Built with git-ssb-web