pdf.js/external/builder/fixtures_esprima/ifs.js
Jonas Jenwald 14ef0b4211 Remove empty, top-level, nodes in the Babel plugin
Looking at the *built* files you'll notice some lines containing nothing more than a semicolon. This is the result of (mostly top-level) `if`-statements, which include `PDFJSDev`-checks, that evalute to `false` during Babel parsing.

This has always annoyed me a bit, and looking at Babel plugin it seems that we can fix this simply by *removing* the relevant nodes.
2024-02-09 13:58:24 +01:00

35 lines
282 B
JavaScript

if ('test') {
"1";
}
if (true) {
"1";
}
if (true) {
"1";
} else {
"2";
}
if (false) {
"1";
}
if (false) {
"1";
} else {
"2";
}
if (true && false) {
"1";
}
if (true && false || '1') {
"1";
}
function f1() {
if (true) {
"1";
}
if (false) {
"2";
}
}