Skip to content

Commit

Permalink
incorrect function name in log gulpjs#1492
Browse files Browse the repository at this point in the history
  • Loading branch information
axvm committed Mar 8, 2016
1 parent 06d81ae commit ba3f351
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,21 @@ function Gulp() {

// Bind the functions for destructuring
this.watch = this.watch.bind(this);
this.task = this.task.bind(this);
this.task = function(name, fn) {
if (typeof name === 'function') {
fn = name;
name = fn.displayName || fn.name;
}

if (!fn) {
fn = this._getTask(name);
fn.displayName = fn.displayName || name;

This comment has been minimized.

Copy link
@axvm

axvm Mar 9, 2016

Author Owner

Cant read property 'displayName' of undefined if task not found. 😿


return fn;
}

this._setTask(name, fn);
}.bind(this);
this.series = this.series.bind(this);
this.parallel = this.parallel.bind(this);
this.registry = this.registry.bind(this);
Expand Down

0 comments on commit ba3f351

Please sign in to comment.