Skip to content

Commit

Permalink
Demo: Comparison msg
Browse files Browse the repository at this point in the history
  • Loading branch information
slevithan committed Nov 8, 2024
1 parent d5c96a7 commit 8771b1a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,22 +80,22 @@ function showTranspiled() {
}
}
// Compose and display message about differences or lack thereof
let str = 'Tested all 9 <code>target</code>/<code>accuracy</code> combinations.';
if (differents.length) {
let str = '<p>🔀';
const withError = [];
const withDiff = [];
differents.forEach(d => (d.error ? withError : withDiff).push(d));
if (withError.length) {
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 = `<p>🔀 ${str}</p>`;
} else {
ui.alternateInfo.innerHTML = `<p>🟰 Results are the same ${
details.error ? '' : '(apart from flag <code>u</code>/<code>v</code>) '
}with all other targets and accuracies.</p>`;
ui.alternateInfo.innerHTML = `<p>🟰 ${str} Results were the same${
details.error ? '' : `, except <code>ES2018</code> used flag <code>u</code>`
}.</p>`;
}
}

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

Expand Down

0 comments on commit 8771b1a

Please sign in to comment.