aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/compress.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/compress.js b/lib/compress.js
index dc82db02..0f00d091 100644
--- a/lib/compress.js
+++ b/lib/compress.js
@@ -92,12 +92,9 @@ function Compressor(options, false_by_default) {
var global_defs = this.options["global_defs"];
if (typeof global_defs == "object") for (var key in global_defs) {
if (/^@/.test(key) && HOP(global_defs, key)) {
- var ast = parse(global_defs[key]);
- if (ast.body.length == 1 && ast.body[0] instanceof AST_SimpleStatement) {
- global_defs[key.slice(1)] = ast.body[0].body;
- } else throw new Error(string_template("Can't handle expression: {value}", {
- value: global_defs[key]
- }));
+ global_defs[key.slice(1)] = parse(global_defs[key], {
+ expression: true
+ });
}
}
var pure_funcs = this.options["pure_funcs"];