fix corner cases in keep_fnames (#5393)

This commit is contained in:
Alex Lam S.L
2022-03-28 20:01:01 +01:00
committed by GitHub
parent 15a4074d1a
commit 8922f08fbf
5 changed files with 35 additions and 13 deletions

View File

@@ -3557,6 +3557,27 @@ functions_inner_var: {
expect_stdout: "undefined undefined"
}
functions_keep_fnames: {
options = {
functions: true,
keep_fnames: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
var FAIL = function PASS() {};
FAIL.p = 42;
console.log(FAIL.name, FAIL.p);
}
expect: {
var FAIL = function PASS() {};
FAIL.p = 42;
console.log(FAIL.name, FAIL.p);
}
expect_stdout: "PASS 42"
}
issue_2437: {
options = {
collapse_vars: true,