Merge branch 'master' into harmony

This commit is contained in:
Richard van Velzen
2016-06-09 22:29:52 +02:00
9 changed files with 142 additions and 6 deletions

View File

@@ -346,7 +346,7 @@ merge(Compressor.prototype, {
if (ref.scope.uses_eval || ref.scope.uses_with) break;
// Constant single use vars can be replaced in any scope.
if (var_decl.value.is_constant(compressor)) {
if (!(var_decl.value instanceof AST_RegExp) && var_decl.value.is_constant(compressor)) {
var ctt = new TreeTransformer(function(node) {
if (node === ref)
return replace_var(node, ctt.parent(), true);