mirror of
https://github.com/Horizontal42/summarum.git
synced 2026-11-10 19:11:58 +03:00
fix: move misplaced comment in evaluation engine catch block (#93)
Moved the informational comment `// a line without a result beats a dead sheet.` to the correct location in the catch block right above `value = null;`, where it accurately describes why we assign null instead of crashing. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This commit is contained in:
parent
268ac9e81b
commit
ba4ebe2d5c
1 changed files with 1 additions and 1 deletions
|
|
@ -137,7 +137,6 @@ export class SumEngine {
|
||||||
historicalRates: this.historicalRates,
|
historicalRates: this.historicalRates,
|
||||||
resolveXRef,
|
resolveXRef,
|
||||||
};
|
};
|
||||||
// a line without a result beats a dead sheet.
|
|
||||||
value = evaluate(parsed.expr, ctx);
|
value = evaluate(parsed.expr, ctx);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
@ -150,6 +149,7 @@ export class SumEngine {
|
||||||
lineError = e instanceof Error ? e.message : String(e);
|
lineError = e instanceof Error ? e.message : String(e);
|
||||||
console.warn("evaluate failed:", e);
|
console.warn("evaluate failed:", e);
|
||||||
}
|
}
|
||||||
|
// a line without a result beats a dead sheet.
|
||||||
value = null;
|
value = null;
|
||||||
}
|
}
|
||||||
if (value?.kind === "quantity" && !value.value.isFinite()) value = null;
|
if (value?.kind === "quantity" && !value.value.isFinite()) value = null;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue