Fix for Firefox

On Firefox, `Function.prototype.name` returns `""`, which is false-y. Check for undefined.