@@ -13729,7 +13729,7 @@ Compressor.prototype.compress = function(node) {
|
|||||||
}));
|
}));
|
||||||
return !abort;
|
return !abort;
|
||||||
};
|
};
|
||||||
} else if (in_await && !is_async(fn) || in_async_generator(scope)) {
|
} else if (in_await || is_async(fn) || in_async_generator(scope)) {
|
||||||
verify_body = function(stat) {
|
verify_body = function(stat) {
|
||||||
var abort = false;
|
var abort = false;
|
||||||
var find_return = new TreeWalker(function(node) {
|
var find_return = new TreeWalker(function(node) {
|
||||||
|
|||||||
@@ -3229,3 +3229,154 @@ issue_5528_4: {
|
|||||||
]
|
]
|
||||||
node_version: ">=8"
|
node_version: ">=8"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_5634_1: {
|
||||||
|
options = {
|
||||||
|
awaits: true,
|
||||||
|
inline: true,
|
||||||
|
side_effects: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a = "foo";
|
||||||
|
(async function() {
|
||||||
|
(async function() {
|
||||||
|
try {
|
||||||
|
return {
|
||||||
|
then(resolve) {
|
||||||
|
console.log("bar");
|
||||||
|
resolve();
|
||||||
|
console.log("baz");
|
||||||
|
},
|
||||||
|
};
|
||||||
|
} finally {
|
||||||
|
a = "moo";
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
})();
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a = "foo";
|
||||||
|
(async function() {
|
||||||
|
try {
|
||||||
|
return {
|
||||||
|
then(resolve) {
|
||||||
|
console.log("bar");
|
||||||
|
resolve();
|
||||||
|
console.log("baz");
|
||||||
|
},
|
||||||
|
};
|
||||||
|
} finally {
|
||||||
|
a = "moo";
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect_stdout: [
|
||||||
|
"moo",
|
||||||
|
"bar",
|
||||||
|
"baz",
|
||||||
|
]
|
||||||
|
node_version: ">=8"
|
||||||
|
}
|
||||||
|
|
||||||
|
issue_5634_2: {
|
||||||
|
options = {
|
||||||
|
inline: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a = "foo";
|
||||||
|
(async function() {
|
||||||
|
await async function() {
|
||||||
|
try {
|
||||||
|
return {
|
||||||
|
then(resolve) {
|
||||||
|
console.log("bar");
|
||||||
|
resolve();
|
||||||
|
console.log("baz");
|
||||||
|
},
|
||||||
|
};
|
||||||
|
} finally {
|
||||||
|
a = "moo";
|
||||||
|
}
|
||||||
|
}();
|
||||||
|
})();
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a = "foo";
|
||||||
|
(async function() {
|
||||||
|
await async function() {
|
||||||
|
try {
|
||||||
|
return {
|
||||||
|
then(resolve) {
|
||||||
|
console.log("bar");
|
||||||
|
resolve();
|
||||||
|
console.log("baz");
|
||||||
|
},
|
||||||
|
};
|
||||||
|
} finally {
|
||||||
|
a = "moo";
|
||||||
|
}
|
||||||
|
}();
|
||||||
|
})();
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect_stdout: [
|
||||||
|
"moo",
|
||||||
|
"bar",
|
||||||
|
"baz",
|
||||||
|
]
|
||||||
|
node_version: ">=8"
|
||||||
|
}
|
||||||
|
|
||||||
|
issue_5634_3: {
|
||||||
|
options = {
|
||||||
|
awaits: true,
|
||||||
|
inline: true,
|
||||||
|
}
|
||||||
|
input: {
|
||||||
|
var a = "foo";
|
||||||
|
(async function() {
|
||||||
|
return async function() {
|
||||||
|
try {
|
||||||
|
return {
|
||||||
|
then(resolve) {
|
||||||
|
console.log("bar");
|
||||||
|
resolve();
|
||||||
|
console.log("baz");
|
||||||
|
},
|
||||||
|
};
|
||||||
|
} finally {
|
||||||
|
a = "moo";
|
||||||
|
}
|
||||||
|
}();
|
||||||
|
})();
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect: {
|
||||||
|
var a = "foo";
|
||||||
|
(async function() {
|
||||||
|
return async function() {
|
||||||
|
try {
|
||||||
|
return {
|
||||||
|
then(resolve) {
|
||||||
|
console.log("bar");
|
||||||
|
resolve();
|
||||||
|
console.log("baz");
|
||||||
|
},
|
||||||
|
};
|
||||||
|
} finally {
|
||||||
|
a = "moo";
|
||||||
|
}
|
||||||
|
}();
|
||||||
|
})();
|
||||||
|
console.log(a);
|
||||||
|
}
|
||||||
|
expect_stdout: [
|
||||||
|
"moo",
|
||||||
|
"bar",
|
||||||
|
"baz",
|
||||||
|
]
|
||||||
|
node_version: ">=8"
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user