diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/compress.js | 7 | ||||
-rw-r--r-- | lib/parse.js | 1 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/compress.js b/lib/compress.js index 325c0cd0..c3e315de 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -762,10 +762,11 @@ merge(Compressor.prototype, { return arg || make_node(AST_Undefined, iife); }, visit); }); - if (fn.rest) scan_declaration(tw, compressor, fn.rest, compressor.option("rests") && function() { - return make_node(AST_Array, fn, { + var rest = fn.rest; + if (rest) scan_declaration(tw, compressor, rest, compressor.option("rests") && function() { + return fn.rest === rest ? make_node(AST_Array, fn, { elements: iife.args.slice(fn.argnames.length), - }); + }) : rest; }, visit); walk_lambda(fn, tw); var safe_ids = tw.safe_ids; diff --git a/lib/parse.js b/lib/parse.js index c6d7cb6f..04b40149 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -1198,6 +1198,7 @@ function parse($TEXT, options) { } } else { body = []; + handle_regexp(); value = maybe_assign(); } S.input.pop_directives_stack(); |