Skip to content

Commit ab30c6b

Browse files
committed
pass stats to error handler again, to prevent breaking change
1 parent b863851 commit ab30c6b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lib/Compiler.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,24 @@ Watching.prototype._go = function() {
7777
});
7878
};
7979

80+
Watching.prototype._getStats = function(compilation) {
81+
var stats = new Stats(compilation);
82+
stats.startTime = this.startTime;
83+
stats.endTime = new Date().getTime();
84+
return stats;
85+
};
86+
8087
Watching.prototype._done = function(err, compilation) {
8188
this.running = false;
8289
if(this.invalid) return this._go();
8390

91+
var stats = this._getStats(compilation);
8492
if(err) {
8593
this.compiler.applyPlugins("failed", err);
86-
this.handler(err);
94+
this.handler(err, stats);
8795
return;
8896
}
8997

90-
var stats = new Stats(compilation);
91-
stats.startTime = this.startTime;
92-
stats.endTime = new Date().getTime();
9398
this.compiler.applyPlugins("done", stats);
9499
this.handler(null, stats);
95100
if(!this.closed) {

0 commit comments

Comments
 (0)