Fix make_node_from_constant for Regexp-s

Close #588
This commit is contained in:
Mihai Bazon
2015-01-07 11:20:04 +02:00
parent d2d716483a
commit 61c233a08e

View File

@@ -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