diff --git a/lib/compress.js b/lib/compress.js index 9a7ccfc3..bfdb1952 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -230,9 +230,16 @@ merge(Compressor.prototype, { return /@ngInject/.test(comment.value); } function make_arguments_names_list(func) { + var foundDestructuring = false; return func.argnames.map(function(sym){ - // TODO not sure what to do here with destructuring + if (sym instanceof AST_Destructuring) { + compressor.warn("Function with destructuring arguments marked with @ngInject [{file}:{line},{col}]", token); + foundDestructuring = true; + } + if (foundDestructuring) { return null; } return make_node(AST_String, sym, { value: sym.name }); + }).filter(function (name) { + return name !== null; }); } function make_array(orig, elements) {