Skip to content

Commit

Permalink
Clear traverse cache and recrawl for mangler (#381)
Browse files Browse the repository at this point in the history
  • Loading branch information
boopathi authored and kangax committed Jan 19, 2017
1 parent d01ac10 commit 6656c18
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/babel-plugin-minify-mangle-names/src/index.js
@@ -1,4 +1,4 @@
module.exports = ({ types: t }) => {
module.exports = ({ types: t, traverse }) => {
const hop = Object.prototype.hasOwnProperty;

class Mangler {
Expand All @@ -24,11 +24,17 @@ module.exports = ({ types: t }) => {
}

run() {
this.cleanup();
this.collect();
this.charset.sort();
this.mangle();
}

cleanup() {
traverse.clearCache();
this.program.scope.crawl();
}

isBlacklist(name) {
return hop.call(this.blacklist, name);
}
Expand Down

0 comments on commit 6656c18

Please sign in to comment.