Skip to content

Commit cdbc509

Browse files
committed
fixed chunk parent bug
1 parent 30c4174 commit cdbc509

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/Chunk.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Chunk.prototype.removeModule = function(module) {
2727
};
2828

2929
Chunk.prototype.addChunk = function(chunk) {
30+
if(chunk === this) return false;
3031
if(this.chunks.indexOf(chunk) >= 0) return false;
3132
this.chunks.push(chunk);
3233
return true;
@@ -41,6 +42,7 @@ Chunk.prototype.removeChunk = function(chunk) {
4142
};
4243

4344
Chunk.prototype.addParent = function(chunk) {
45+
if(chunk === this) return false;
4446
if(this.parents.indexOf(chunk) >= 0) return false;
4547
this.parents.push(chunk);
4648
return true;

0 commit comments

Comments
 (0)