Skip to content

Commit

Permalink
use typeof instead of instanceof
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhead committed May 2, 2010
1 parent 547d478 commit ba08ca3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/vows.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function addVow(/* description & callback */) {
// Sometimes it might be nicer to pass the proof first,
// and the description second, so we let the user choose
// the order.
if (args[0] instanceof Function) {
if (typeof(args[0]) === "function") {
vow.callback = args[0], vow.description = args[1];
} else {
vow.callback = args[1], vow.description = args[0];
Expand Down Expand Up @@ -302,7 +302,7 @@ vows.tell = function (topic, tests) {
// setup fires.
// If we encounter an object literal, we recurse, sending it
// our current context.
if (vow.callback instanceof Function) {
if (typeof(vow.callback) === 'function') {
setup.addVow(vow);
} else if (typeof(vow.callback) === 'object' && ! Array.isArray(vow.callback)) {
// If there's a setup stage, we have to wait for it to fire,
Expand Down

0 comments on commit ba08ca3

Please sign in to comment.