fix corner case in inline & unused (#5725)

fixes #5724
This commit is contained in:
Alex Lam S.L
2022-10-29 03:53:30 +01:00
committed by GitHub
parent 7270671687
commit f40dbd6e33
3 changed files with 56 additions and 22 deletions

View File

@@ -3901,3 +3901,29 @@ issue_5682_class_key_computed: {
expect_stdout: "PASS"
node_version: ">=4"
}
issue_5724: {
options = {
arrows: true,
inline: true,
keep_fargs: true,
toplevel: true,
unused: true,
}
input: {
"use strict";
class A {
static P = function(a) {
console.log(a, a);
}(a);
}
}
expect: {
"use strict";
(function(a) {
console.log(a, a);
})(a);
}
expect_stdout: ReferenceError("a is not defined")
node_version: ">=12"
}