Sorry, seems I didn't make myself clear.  My point was that this function returns either true, false or undefined, which seems a bit odd.