From 8771b1a54d5a2957c12a7c9e30f714ed2ed7db41 Mon Sep 17 00:00:00 2001 From: Steven Levithan Date: Fri, 8 Nov 2024 15:20:23 +0100 Subject: [PATCH] Demo: Comparison msg --- demo/demo.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/demo/demo.js b/demo/demo.js index bf7075d..2993db2 100644 --- a/demo/demo.js +++ b/demo/demo.js @@ -80,8 +80,8 @@ function showTranspiled() { } } // Compose and display message about differences or lack thereof + let str = 'Tested all 9 target/accuracy combinations.'; if (differents.length) { - let str = '

🔀'; const withError = []; const withDiff = []; differents.forEach(d => (d.error ? withError : withDiff).push(d)); @@ -89,13 +89,13 @@ function showTranspiled() { str += ` Can't emulate for ${listDifferents(withError)}.`; } if (withDiff.length) { - str += ` Emulation ${details.error ? 'is possible' : 'uses different details'} for ${listDifferents(withDiff)}.`; + str += ` Emulation ${details.error ? 'is possible' : 'used different details'} for ${listDifferents(withDiff)}.`; } - ui.alternateInfo.innerHTML = str; + ui.alternateInfo.innerHTML = `

🔀 ${str}

`; } else { - ui.alternateInfo.innerHTML = `

🟰 Results are the same ${ - details.error ? '' : '(apart from flag u/v) ' - }with all other targets and accuracies.

`; + ui.alternateInfo.innerHTML = `

🟰 ${str} Results were the same${ + details.error ? '' : `, except ES2018 used flag u` + }.

`; } } @@ -140,9 +140,9 @@ function listDifferents(arr) { target[a.target].push(a.accuracy); } return Object.keys(target).map(t => { - return `target '${t}' with ${ + return `target ${t} with ${ target[t].length > 1 ? 'accuracies' : 'accuracy' - } '${target[t].join("'/'")}'`; + } ${target[t].join('/')}`; }).join(', '); }