@@ -512,6 +512,42 @@ inline_block_await: {
|
||||
}
|
||||
|
||||
inline_block_await_async: {
|
||||
options = {
|
||||
inline: true,
|
||||
}
|
||||
input: {
|
||||
(async function() {
|
||||
console.log("foo");
|
||||
await (async function() {
|
||||
while (await console.log("bar"));
|
||||
console.log("baz");
|
||||
})();
|
||||
console.log("moo");
|
||||
})().then(console.log);
|
||||
console.log("moz");
|
||||
}
|
||||
expect: {
|
||||
(async function() {
|
||||
console.log("foo");
|
||||
while (await console.log("bar"));
|
||||
console.log("baz");
|
||||
await 0;
|
||||
console.log("moo");
|
||||
})().then(console.log);
|
||||
console.log("moz");
|
||||
}
|
||||
expect_stdout: [
|
||||
"foo",
|
||||
"bar",
|
||||
"moz",
|
||||
"baz",
|
||||
"moo",
|
||||
"undefined",
|
||||
]
|
||||
node_version: ">=8"
|
||||
}
|
||||
|
||||
inline_block_await_async_return: {
|
||||
options = {
|
||||
awaits: true,
|
||||
if_return: true,
|
||||
@@ -2540,3 +2576,32 @@ issue_5177: {
|
||||
expect_stdout: "function"
|
||||
node_version: ">=8"
|
||||
}
|
||||
|
||||
issue_5250: {
|
||||
options = {
|
||||
inline: true,
|
||||
}
|
||||
input: {
|
||||
(async function() {
|
||||
await function() {
|
||||
while (console.log("foo"));
|
||||
}();
|
||||
console.log("bar");
|
||||
})();
|
||||
console.log("baz");
|
||||
}
|
||||
expect: {
|
||||
(async function() {
|
||||
while (console.log("foo"));
|
||||
await 0;
|
||||
console.log("bar");
|
||||
})();
|
||||
console.log("baz");
|
||||
}
|
||||
expect_stdout: [
|
||||
"foo",
|
||||
"baz",
|
||||
"bar",
|
||||
]
|
||||
node_version: ">=8"
|
||||
}
|
||||
|
||||
@@ -628,7 +628,8 @@ inline_binary_and: {
|
||||
while (console.log("baz"));
|
||||
return void "moo";
|
||||
return;
|
||||
}
|
||||
} else
|
||||
return;
|
||||
}());
|
||||
}
|
||||
expect_stdout: [
|
||||
@@ -7686,3 +7687,66 @@ issue_5240_2: {
|
||||
}
|
||||
expect_stdout: "undefined"
|
||||
}
|
||||
|
||||
issue_5249_1: {
|
||||
options = {
|
||||
inline: true,
|
||||
}
|
||||
input: {
|
||||
console.log(function() {
|
||||
if (!console)
|
||||
var a = "FAIL 1";
|
||||
else
|
||||
return void (a && function() {
|
||||
while (console.log("FAIL 2"));
|
||||
}());
|
||||
throw "FAIL 3";
|
||||
}());
|
||||
}
|
||||
expect: {
|
||||
console.log(function() {
|
||||
if (!console)
|
||||
var a = "FAIL 1";
|
||||
else if (a) {
|
||||
while (console.log("FAIL 2"));
|
||||
return;
|
||||
} else
|
||||
return;
|
||||
throw "FAIL 3";
|
||||
}());
|
||||
}
|
||||
expect_stdout: "undefined"
|
||||
}
|
||||
|
||||
issue_5249_2: {
|
||||
options = {
|
||||
conditionals: true,
|
||||
dead_code: true,
|
||||
evaluate: true,
|
||||
if_return: true,
|
||||
inline: true,
|
||||
passes: 3,
|
||||
reduce_vars: true,
|
||||
sequences: true,
|
||||
side_effects: true,
|
||||
unused: true,
|
||||
}
|
||||
input: {
|
||||
console.log(function() {
|
||||
if (!console)
|
||||
var a = "FAIL 1";
|
||||
else
|
||||
return void (a && function() {
|
||||
while (console.log("FAIL 2"));
|
||||
}());
|
||||
throw "FAIL 3";
|
||||
}());
|
||||
}
|
||||
expect: {
|
||||
console.log(function() {
|
||||
if (!console)
|
||||
throw "FAIL 3";
|
||||
}());
|
||||
}
|
||||
expect_stdout: "undefined"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user