Skip to content

Commit

Permalink
Merge pull request #839 from null-a/better-check-in-factor
Browse files Browse the repository at this point in the history
Increase strictness of check in factor.
  • Loading branch information
stuhlmueller committed Apr 27, 2017
2 parents 87fc4ab + 9bb5063 commit 45876ad
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ module.exports = function(env) {
};

env.factor = function(s, k, a, score) {
assert.ok(!isNaN(ad.value(score)), 'factor() score was NaN');
var _score = ad.value(score);
if (typeof _score !== 'number' || isNaN(_score)) {
throw new Error('The score argument is not a number.');
}
return env.coroutine.factor(s, k, a, score);
};

Expand Down

0 comments on commit 45876ad

Please sign in to comment.