dart2js: --minify does not remove a string if the string is used in an interpolation / concatenation within a dead code block #13167
Labels
closed-not-planned
Closed as we don't intend to take action on the reported issue
P3
A lower priority bug or feature request
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
web-dart2js
This issue was originally filed by ross.dart...@gmail.com
r27277
Windows 7x64
Consider the following program:
///////////////////////////////////////////////////////////////
import 'package:logging/logging.dart';
final _logger = new Logger('snarf');
const bool isLoggingEnabled = false;
int x = 42;
main() {
log('please shake me out!');
}
log(String message) {
if (isLoggingEnabled) {
_logger.info('$x $message');
}
}
///////////////////////////////////////////////////////////////
I would expect that 'please shake me out' would be removed by minification as the block wrapped by
isLoggingEnabled
is dead code. The interpolation withx
inside of this (dead) block appears to keep it around. If I remove the interpolation withx
it is removed from the output. I've tried also concatenation (+) and using a StringBuffer inside the same block, to no avail.thanks,
The text was updated successfully, but these errors were encountered: