From: Mihai Bazon Date: Wed, 7 Jan 2015 09:20:04 +0000 (+0200) Subject: Fix make_node_from_constant for Regexp-s X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=61c233a08ed3768f19f05579888b327eee7286ec;p=UglifyJS.git Fix make_node_from_constant for Regexp-s Close #588 --- diff --git a/lib/compress.js b/lib/compress.js index 83c3e6d0..d503ed17 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -163,10 +163,10 @@ merge(Compressor.prototype, { return make_node(AST_Undefined, orig).optimize(compressor); default: if (val === null) { - return make_node(AST_Null, orig).optimize(compressor); + return make_node(AST_Null, orig, { value: null }).optimize(compressor); } if (val instanceof RegExp) { - return make_node(AST_RegExp, orig).optimize(compressor); + return make_node(AST_RegExp, orig, { value: val }).optimize(compressor); } throw new Error(string_template("Can't handle constant of type: {type}", { type: typeof val