Comparing version 0.1.11 to 0.1.12
var async = require('async'); | ||
var us = require('underscore'); | ||
var FlowTaskError = require('./flowTaskError'); | ||
var FlowTaskArgumentNullError = require('./flowTaskArgumentNullError'); | ||
var FlowTaskArgumentNullError = require('./FlowTaskArgumentNullError'); | ||
@@ -140,5 +140,6 @@ module.exports = { | ||
var result = results; | ||
arg.forEach(function(arg){ | ||
result = result[arg]; | ||
}); | ||
for(var j in arg) { | ||
if(result === undefined) return cb(new FlowTaskArgumentNullError(taskName, arg[j-1], arg[j])); | ||
result = result[arg[j]]; | ||
} | ||
fnArgs[i] = result; | ||
@@ -145,0 +146,0 @@ } else fnArgs[i] = results[arg]; |
@@ -6,3 +6,3 @@ { | ||
"author": "David Fenster <david@dfenster.com>", | ||
"version": "0.1.11", | ||
"version": "0.1.12", | ||
"repository": { | ||
@@ -9,0 +9,0 @@ "type": "git", |
@@ -349,3 +349,18 @@ var util = require('util'); | ||
module.exports["instance task execution with undefined dot notation function"] = function(test){ | ||
flow({ | ||
authorName: 'Dan Brown', | ||
genreName: 'Superfiction' | ||
}, { | ||
getAuthor: [Author.getByName, 'authorName'], | ||
getGenre: [Genre.getByName, 'genreName'], | ||
getBooks: ['getGenre.findBooksByAuthor', 'getAuthor'] | ||
}, function(err, results){ | ||
test.ok(err); | ||
test.equals(err.message, 'Flow error in \'getBooks\': Cannot call function \'findBooksByAuthor\' on null/undefined \'getGenre\'') | ||
test.done(); | ||
}); | ||
} | ||
module.exports["multiple asyncronus tasks with prerequisite task execution"] = function(test){ | ||
@@ -352,0 +367,0 @@ flow( [ |
57829
1385