workaround function declaration quirks in ES6+ (#5833)

fixes #1666
This commit is contained in:
Alex Lam S.L
2024-06-09 00:57:15 +03:00
committed by GitHub
parent 3dfb379486
commit e7b9b4aafb
4 changed files with 317 additions and 2 deletions

View File

@@ -47,3 +47,45 @@ keep_some_blocks: {
} else stuff();
}
}
issue_1666: {
input: {
var a = 42;
{
function a() {}
a();
}
console.log("PASS");
}
expect: {
var a = 42;
{
function a() {}
a();
}
console.log("PASS");
}
expect_stdout: true
}
issue_1666_strict: {
input: {
"use strict";
var a = 42;
{
function a() {}
a();
}
console.log("PASS");
}
expect: {
"use strict";
var a = 42;
{
function a() {}
a();
}
console.log("PASS");
}
expect_stdout: true
}