swc/crates/swc_ecma_minifier/tests/fixture/issues/6141/input.js
Donny/강동윤 3d271e82a2
fix(es/minifier): Preserve return values of recursive IIFE (#6142)
**Description:**

This PR fixes the logic for dropping return values of IIFE.

**Related issue:**

 - Closes https://github.com/swc-project/swc/issues/6141.
2022-10-14 09:32:56 +09:00

14 lines
266 B
JavaScript

(function foo(obj) {
if (obj) {
for (const key in obj) {
const element = obj[key];
if (element && foo(element.children)) {
// do something
}
}
return true;
}
return false;
})()