Changeset 516 for Dev/trunk/node_modules/grunt/lib/util/task.js
- Timestamp:
- 03/14/14 12:36:58 (11 years ago)
- Location:
- Dev/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk
- Property svn:ignore
-
old new 1 1 build 2 quod-erat.git
-
- Property svn:ignore
-
Dev/trunk/node_modules/grunt/lib/util/task.js
r484 r516 3 3 * http://gruntjs.com/ 4 4 * 5 * Copyright (c) 201 3"Cowboy" Ben Alman5 * Copyright (c) 2014 "Cowboy" Ben Alman 6 6 * Licensed under the MIT license. 7 7 * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT … … 90 90 // easier to implement than some kind of in-task "super" functionality. 91 91 Task.prototype.renameTask = function(oldname, newname) { 92 if (!this._tasks[oldname]) { 93 throw new Error('Cannot rename missing "' + oldname + '" task.'); 94 } 92 95 // Rename task. 93 96 this._tasks[newname] = this._tasks[oldname]; … … 186 189 187 190 // Run a task function, handling this.async / return value. 188 Task.prototype.runTaskFn = function(context, fn, done ) {191 Task.prototype.runTaskFn = function(context, fn, done, asyncDone) { 189 192 // Async flag. 190 193 var async = false; … … 213 216 this._options.error.call({name: context.name, nameArgs: context.nameArgs}, err); 214 217 } 215 done(err, success); 218 // only call done async if explicitly requested to 219 // see: https://github.com/gruntjs/grunt/pull/1026 220 if (asyncDone) { 221 process.nextTick(function () { 222 done(err, success); 223 }); 224 } else { 225 done(err, success); 226 } 216 227 }.bind(this); 217 228 … … 244 255 245 256 // Begin task queue processing. Ie. run all tasks. 246 Task.prototype.start = function() { 257 Task.prototype.start = function(opts) { 258 if (!opts) { 259 opts = {}; 260 } 247 261 // Abort if already running. 248 262 if (this._running) { return false; } … … 281 295 this.runTaskFn(context, function() { 282 296 return thing.task.fn.apply(this, this.args); 283 }, nextTask );297 }, nextTask, !!opts.asyncDone); 284 298 285 299 }.bind(this);
Note: See TracChangeset
for help on using the changeset viewer.