git ssb

1+

Matt McKegg / mutant



Commit f3288b0f154b91b996580e0c68b99ea612698769

array: fix set() when "fixedIndexing"

Matt McKegg committed on 11/9/2017, 8:39:45 AM
Parent: 1aafd09e523fdb479815d832932868b6130cc2be

Files changed

array.jschanged
array.jsView
@@ -115,27 +115,30 @@
115115
116116 observable.set = function (values) {
117117 var changed = false
118118 if (fixedIndexing) {
119- var length = values && values.length || 0
119 + var length = (values && values.length) || 0
120120 for (var i = 0; i < length; i++) {
121121 if (isObservable(values[i])) {
122122 if (values[i] !== sources[i]) {
123- tryInvoke(objectReleases[index])
123 + tryInvoke(objectReleases[i])
124124 sources[i] = values[i]
125 + object[i] = resolve(sources[i])
125126 changed = true
126127 if (binder.live) {
127128 objectReleases[i] = bind(sources[i])
128129 }
129130 }
130131 } else if (sources[i] && sources[i]._type === 'MutantArrayValue') {
131132 if (!isSame(sources[i](), values[i], comparer)) {
132133 sources[i].set(values[i])
134 + object[i] = resolve(sources[i])
133135 changed = true
134136 }
135137 } else {
136- tryInvoke(objectReleases[index])
138 + tryInvoke(objectReleases[i])
137139 sources[i] = getObsValue(values[i])
140 + object[i] = resolve(sources[i])
138141 changed = true
139142 if (binder.live) {
140143 objectReleases[i] = bind(sources[i])
141144 }

Built with git-ssb-web