Comparing version 0.1.6 to 0.1.7
var async = require('async'); | ||
var us = require('underscore'); | ||
var FlowTaskError = require('./flowTaskError'); | ||
var FlowTaskArgumentNullError = require('./FlowTaskArgumentNullError'); | ||
@@ -140,3 +141,3 @@ module.exports = { | ||
var fnName = fn.name; | ||
if(!receiver) throw new FlowTaskError(taskName, "Cannot call function '" + fn.name + "' on " + receiver); | ||
if(!receiver) return cb(new FlowTaskArgumentNullError(taskName, receiverName, fnName)); | ||
fn = receiver[fnName]; | ||
@@ -143,0 +144,0 @@ if(!fn) throw new FlowTaskError(taskName, "Unknown symbol '" + fnName + "' must be either the name of a task, the name of data, or the name of a function on '" + receiverName + "'"); |
@@ -6,3 +6,3 @@ { | ||
"author": "David Fenster <david@dfenster.com>", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"repository": { | ||
@@ -9,0 +9,0 @@ "type": "git", |
@@ -470,17 +470,13 @@ var util = require('util'); | ||
module.exports["undefined instance error"] = function(test){ | ||
try { | ||
flow({ | ||
genreName: 'Fictiony' | ||
}, { | ||
getGenre: [Genre.getByName, 'genreName'], | ||
getBooks: ['getGenre', 'getBooks'] | ||
}, function(err, results){ | ||
test.fail(null, null, "no error received"); | ||
}); | ||
} catch(e) { | ||
flow({ | ||
genreName: 'Fictiony' | ||
}, { | ||
getGenre: [Genre.getByName, 'genreName'], | ||
getBooks: ['getGenre', 'getBooks'] | ||
}, function(e, results){ | ||
test.ok(e, 'got an error'); | ||
test.equals(e.name, "FlowTaskError", "got FlowTaskError"); | ||
test.equals(e.message, "Flow error in 'getBooks': Cannot call function 'getBooks' on undefined", "error message match") | ||
test.equals(e.name, "FlowTaskArgumentNullError", "got FlowTaskError"); | ||
test.equals(e.message, "Flow error in 'getBooks': Cannot call function 'getBooks' on null/undefined 'getGenre'", "error message match") | ||
test.done(); | ||
} | ||
}); | ||
} | ||
@@ -487,0 +483,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
53968
7
1253