diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/9030/input.js b/crates/swc_ecma_minifier/tests/fixture/issues/9030/input.js new file mode 100644 index 000000000000..d3168d762c44 --- /dev/null +++ b/crates/swc_ecma_minifier/tests/fixture/issues/9030/input.js @@ -0,0 +1,16 @@ +var FRUITS = { MANGO: "mango" }; + +var getMangoLabel = (label) => label[FRUITS.MANGO]; + +export default (name) => { + // Breaks with switch case + switch (name) { + case FRUITS.MANGO: { + return getMangoLabel + } + } + // Works with if else + // if (name === FRUITS.MANGO) { + // return getMangoLabel; + // } +}; \ No newline at end of file