turbo
636f5846 - fix(ecmascript): eval assignop to the ident (#4609)

Commit
2 years ago
fix(ecmascript): eval assignop to the ident (#4609) ### Description - closes WEB-889 When there is a variable with `+=` assignop only to the given ident ``` var css = ''; for (var i = 0; i < length; i++) { var partRule = this.rules[i]; if (typeof partRule === 'string') { css += partRule; } else if (partRule) { css += partString; } } if (css) { .... } ``` evaluated result becomes ``` var css = ''; for(var i = 0; i < length; i++){ var partRule = this.rules[i]; if (typeof partRule === 'string') { css += partRule; } else if (partRule) { css += partString; } } if ("TURBOPACK compile-time falsy", 0) { "TURBOPACK unreachable"; } ``` so `if (css)` condition never executed even though it can be executed depends on the runtime assignop condition. PR attempts to evaluate if assignop is for the ident to prevent this. --------- Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
Author
Parents
Loading