1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
switch_case_and_private_fields: {
options = {
switches: true,
dead_code: true,
}
input: {
class A {
#a = "FAIL";
#b = "PASS";
print(variant) {
switch (variant) {
case 1:
return this.#a;
case 2:
return this.#b;
}
}
}
console.log(new A().print(2));
}
expect: {
class A {
#a = "FAIL";
#b = "PASS";
print(variant) {
switch (variant) {
case 1:
return this.#a;
case 2:
return this.#b;
}
}
}
console.log(new A().print(2));
}
expect_stdout: "PASS"
}
|