Commit f3288b0f154b91b996580e0c68b99ea612698769
array: fix set() when "fixedIndexing"
Matt McKegg committed on 11/9/2017, 8:39:45 AMParent: 1aafd09e523fdb479815d832932868b6130cc2be
Files changed
array.js | changed |
array.js | ||
---|---|---|
@@ -115,27 +115,30 @@ | ||
115 | 115 … | |
116 | 116 … | observable.set = function (values) { |
117 | 117 … | var changed = false |
118 | 118 … | if (fixedIndexing) { |
119 | - var length = values && values.length || 0 | |
119 … | + var length = (values && values.length) || 0 | |
120 | 120 … | for (var i = 0; i < length; i++) { |
121 | 121 … | if (isObservable(values[i])) { |
122 | 122 … | if (values[i] !== sources[i]) { |
123 | - tryInvoke(objectReleases[index]) | |
123 … | + tryInvoke(objectReleases[i]) | |
124 | 124 … | sources[i] = values[i] |
125 … | + object[i] = resolve(sources[i]) | |
125 | 126 … | changed = true |
126 | 127 … | if (binder.live) { |
127 | 128 … | objectReleases[i] = bind(sources[i]) |
128 | 129 … | } |
129 | 130 … | } |
130 | 131 … | } else if (sources[i] && sources[i]._type === 'MutantArrayValue') { |
131 | 132 … | if (!isSame(sources[i](), values[i], comparer)) { |
132 | 133 … | sources[i].set(values[i]) |
134 … | + object[i] = resolve(sources[i]) | |
133 | 135 … | changed = true |
134 | 136 … | } |
135 | 137 … | } else { |
136 | - tryInvoke(objectReleases[index]) | |
138 … | + tryInvoke(objectReleases[i]) | |
137 | 139 … | sources[i] = getObsValue(values[i]) |
140 … | + object[i] = resolve(sources[i]) | |
138 | 141 … | changed = true |
139 | 142 … | if (binder.live) { |
140 | 143 … | objectReleases[i] = bind(sources[i]) |
141 | 144 … | } |
Built with git-ssb-web