From 61c233a08ed3768f19f05579888b327eee7286ec Mon Sep 17 00:00:00 2001 From: Mihai Bazon Date: Wed, 7 Jan 2015 11:20:04 +0200 Subject: Fix make_node_from_constant for Regexp-s Close #588 --- lib/compress.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/compress.js') 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 -- cgit v1.2.3