Fixed an error where incorrectly targeted effects would cause computation error
This commit is contained in:
@@ -89,7 +89,7 @@ export default class ComputationMemo {
|
|||||||
if (this.statsByVariableName[variableName]){
|
if (this.statsByVariableName[variableName]){
|
||||||
prop.value = NaN;
|
prop.value = NaN;
|
||||||
prop.computationDetails.error = 'variableNameCollision';
|
prop.computationDetails.error = 'variableNameCollision';
|
||||||
console.warn('variableNameCollision', prop);
|
if (Meteor.isClient) console.warn('variableNameCollision', prop);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.statsByVariableName[variableName] = prop;
|
this.statsByVariableName[variableName] = prop;
|
||||||
@@ -111,7 +111,9 @@ export default class ComputationMemo {
|
|||||||
prop = this.registerProperty(prop);
|
prop = this.registerProperty(prop);
|
||||||
let targets = this.getEffectTargets(prop);
|
let targets = this.getEffectTargets(prop);
|
||||||
targets.forEach(target => {
|
targets.forEach(target => {
|
||||||
target.computationDetails.effects.push(prop);
|
if (target.computationDetails.effects){
|
||||||
|
target.computationDetails.effects.push(prop);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
if (!targets.size){
|
if (!targets.size){
|
||||||
this.unassignedEffects.push(prop);
|
this.unassignedEffects.push(prop);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export default function computeStat(stat, memo){
|
|||||||
stat.value = NaN;
|
stat.value = NaN;
|
||||||
stat.computationDetails.busyComputing = false;
|
stat.computationDetails.busyComputing = false;
|
||||||
stat.computationDetails.error = 'dependencyLoop';
|
stat.computationDetails.error = 'dependencyLoop';
|
||||||
console.warn('dependencyLoop', stat);
|
if (Meteor.isClient) console.warn('dependencyLoop', stat);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Before doing any work, mark this stat as busy
|
// Before doing any work, mark this stat as busy
|
||||||
|
|||||||
@@ -84,7 +84,10 @@ function bulkWriteProperties(bulkWriteOps){
|
|||||||
bulkWriteOps,
|
bulkWriteOps,
|
||||||
{ordered : false},
|
{ordered : false},
|
||||||
function(e){
|
function(e){
|
||||||
if (e) console.error(e);
|
if (e) {
|
||||||
|
console.error('Bulk write failed: ');
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user