> I never use that single line if style so I
> didn't realize how much less code it could be.
I don't use it in my regular code either, but I actually do use it for
stuff like this in my test cases.
--fg
On May 22, 3:20 pm, Mikeal Rogers <
mikeal.rog...@gmail.com> wrote:
> Checking for instance of error isn't in keeping with the standard
> callback API. If *anything* is passed as the first argument that is
> truthy then an error has occurred. While node is good about passing an
> Error object a lot of third party modules aren't.
>
> I don't agree that it "doesn't belong" in the assert library because
> the behavior differs slighlty and throws a different error type.
> That's sounds like some silly notion of purity that I just don't
> understand.
>
> If it's useful for testing then it's a good addition, if it's not
> useful then it doesn't belong. Felix makes some good points that it
> might not be that useful, I never use that single line if style so I
> didn't realize how much less code it could be.
>
> -Mikeal
>
> On Sat, May 22, 2010 at 11:48 AM, Jonas Pfenniger (zimbatm)
>
>
>
>
>
> <
jo...@pfenniger.name> wrote:
> > On Sat, May 22, 2010 at 7:31 PM, Mikeal Rogers <
mikeal.rog...@gmail.com> wrote:
> >> The difference is that you want to throw the error that is passed and
> >> not an AssertError.
>
> > Then it doesn't have it's place in the "assert" library.
>
> > The noError method could make sense if it checks for a value that is
> > not an instanceof Error, but then it must at least throw an
> > AssertError (with the other error embedded if you want).
>
> > --
> > You received this message because you are subscribed to the Google Groups "nodejs" group.
> > To post to this group, send email to
nod...@googlegroups.com.
> > To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com.
> > For more options, visit this group athttp://
groups.google.com/group/nodejs?hl=en.
> For more options, visit this group athttp://
groups.google.com/group/nodejs?hl=en.