From 7bb393e08b97d568b24c4a615f37f4e591711861 Mon Sep 17 00:00:00 2001 From: mde Date: Sat, 27 Nov 2010 02:55:16 -0600 Subject: [PATCH] A bit more doco. --- lib/jake.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/jake.js b/lib/jake.js index c3e7bf33..6c9cf379 100644 --- a/lib/jake.js +++ b/lib/jake.js @@ -168,10 +168,23 @@ jake = new function () { !(obj.propertyIsEnumerable('length')); } + /** + * Tells us if the task has any dependencies + * @param {Array.} deps An array of dependencies + * @return {Boolean} true if deps is a non-empty Array + */ , _taskHasDeps = function (deps) { return !!(deps && _isArray(deps) && deps.length); } + /** + * Handles a file task + * @param {Error} err Error, if any, returned from fs.lstat + * @param {fs.Stats} stats Stats obj, if any, returned from fs.lstat + * @param {String} name The task name + * @param {Array} deps The array of dependencies, if any + * @callback {Function} Callback for running the task + */ , _handleFileTask = function (err, stats, name, deps, callback) { // If the task has dependencies these are invoked in order. // If any of them were changed after the current file, or @@ -197,6 +210,7 @@ jake = new function () { // be found, simply execute the task and use the // current time as the last time it changed. else if (err) { + // File not found if (err.errno == 2) { _taskList.push(name); callback(new Date()); @@ -218,6 +232,8 @@ jake = new function () { * recursively -- depth-first, so deps run first * @param {String} name The name of the current task whose * dependencies are being parsed. + * @param {Boolean} root Is this the root task of a dependency tree or not + * @param {Function} [callback] Callbacks for async tasks */ , _parseDeps = function (name, root, callback) { var task = _this.getTask(name),