fix corner cases in inline & unused (#5534)

fixes #5533
This commit is contained in:
Alex Lam S.L
2022-06-30 08:34:45 +01:00
committed by GitHub
parent 2426657daa
commit 4c227cc6bd
7 changed files with 694 additions and 12 deletions

View File

@@ -2104,9 +2104,9 @@ if (require.main !== module) {
function run_code(code, toplevel, timeout) {
if (async && has_await) code = [
'"use strict";',
"(async ()=>{",
"(async()=>{",
code,
"})().catch(e=>console.log(e));",
'})().catch(e=>process.on("exit",()=>{throw e}));',
].join("\n");
return sandbox.run_code(sandbox.patch_module_statements(code), toplevel, timeout);
}