aboutsummaryrefslogtreecommitdiff
path: root/lib/compress.js
diff options
context:
space:
mode:
authorMihai Bazon <mihai@bazon.net>2015-01-07 11:20:04 +0200
committerMihai Bazon <mihai@bazon.net>2015-01-07 11:20:04 +0200
commit61c233a08ed3768f19f05579888b327eee7286ec (patch)
tree1e526df4faeda3926a7e1a33e3f7e05e2a666751 /lib/compress.js
parentd2d716483aa69927541a0a29f3c1ee3c7bba30b4 (diff)
downloadtracifyjs-61c233a08ed3768f19f05579888b327eee7286ec.tar.gz
tracifyjs-61c233a08ed3768f19f05579888b327eee7286ec.zip
Fix make_node_from_constant for Regexp-s
Close #588
Diffstat (limited to 'lib/compress.js')
-rw-r--r--lib/compress.js4
1 files changed, 2 insertions, 2 deletions
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