Skip to content

Commit

Permalink
fix(minify-dead-code): fix #601 (#602)
Browse files Browse the repository at this point in the history
* fix(minify-dead-code): fix #601

- add block checks to getUseStrictDirectives()

* fix(minify-dead-code): fix #601 - reverting to previous fix, now passing tests

* format(minify-dead-code): auto-fix formatting

* refactor(miniy-dead-code): update array check
  • Loading branch information
Karsten Schmidt authored and boopathi committed Jun 27, 2017
1 parent 768ac47 commit 72c2cac
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ function isStrict(block) {
}

function getUseStrictDirectives(block) {
return block.get("directives").filter(directive => {
return directive.node.value.value === useStrict;
});
var dir = block.get("directives");
return Array.isArray(dir)
? dir.filter(function(directive) {
return directive.node.value.value === useStrict;
})
: [];
}

0 comments on commit 72c2cac

Please # to comment.