Skip to content

Commit

Permalink
fix(cli): transform array to map
Browse files Browse the repository at this point in the history
  • Loading branch information
Genuifx committed May 31, 2019
1 parent e257237 commit e3b6543
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/wxa-cli/src/schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class Schedule {

// if watch mode, use childNodes to clean up the dep tree.
// update each module's childnodes, then according to reference unlink file.
this.cleanUpChildren(children, dep);
this.cleanUpChildren(new Map(children), dep);

// cover new childNodes
dep.childNodes = new Map(children);
Expand Down Expand Up @@ -228,7 +228,7 @@ class Schedule {
) {
debug('useless module find %s', oldChild.src);
// nested clean children
this.cleanUpChildren([], oldChild);
this.cleanUpChildren(new Map(), oldChild);
// unlink module
this.deleteFile(oldChild);
this.$indexOfModule.delete(src);
Expand All @@ -245,7 +245,7 @@ class Schedule {
droppedPages.forEach((droppedPage)=>{
debug('dropped page %O', droppedPage);
// nested clean up children module
this.cleanUpChildren([], droppedPage);
this.cleanUpChildren(new Map(), droppedPage);

// drop module from index
if (this.$indexOfModule.has(droppedPage.src)) {
Expand Down

0 comments on commit e3b6543

Please sign in to comment.