Re:JavaScript Promises: There and back again
by thrush on Tuesday December 17, 2013 @11:52AM
(#6922106)
does this mean anything for NodeJS programmers that rely on an existing promise library (eg Q)?
[ Parent
| on HN ]
Re:JavaScript Promises: There and back again
by PhrosTT on Tuesday December 17, 2013 @11:57AM
(#6922137)
Well presumably this makes it's way into V8 and therefore node. I'd assume the performance is better than Q.
The biggest issue for me is Q's habit of hiding errors despite me defining a Q.onerror handler. Hopefully a native implementation would fail a little louder.
Re:JavaScript Promises: There and back again
by iamwil on Tuesday December 17, 2013 @12:04PM
(#6922160)
I've had this issue with Q and when. Sometimes, things would fail inside a then chain, and then I can't figure out where exactly it failed, because though it fell through a couple thens, I'm not sure exactly where it came from, or how it got that way.
Re:JavaScript Promises: There and back again
by stu_k on Tuesday December 17, 2013 @12:52PM
(#6922516)
Have you tried setting
Q.longStackSupport = true
? This is invaluable for debugging (although it does slow things down a lot, so don't use it in production)
Re:JavaScript Promises: There and back again
by spion on Tuesday December 17, 2013 @07:28PM
(#6925000)
Yep, and this is exactly why its so nice to have promises built into the language. That way, the implementing engine could provide long stack traces for them as well as extra inspection and tooling of all currently pending async operations - and it could do that at the lowest possible performance cost.
Re:JavaScript Promises: There and back again
by zoips on Tuesday December 17, 2013 @06:33PM
(#6924765)
Q contains some helper functions for creating generators, tying them to a promise, and automatically starting the generator, eg Q.async(). I've found that I'd rather continue using Q and use Q.async()/Q.spawn() rather than dealing directly with the generators and managing them.