JS: use 'Util::describeExpression' in js/trivial-conditional

This commit is contained in:
Esben Sparre Andreasen
2018-10-31 09:09:40 +01:00
parent 4e54af3b41
commit 651f32514b
2 changed files with 19 additions and 22 deletions

View File

@@ -138,10 +138,7 @@ where isConditional(cond, op.asExpr()) and
// otherwise we just report that `op` always evaluates to `cv`
else (
sel = op.asExpr().stripParens() and
if sel instanceof VarAccess then
msg = "Variable '" + sel.(VarAccess).getVariable().getName() + "' always evaluates to " + cv + " here."
else
msg = "This expression always evaluates to " + cv + "."
msg = "This " + describeExpression(sel) + " always evaluates to " + cv + "."
)
select sel, msg