await and promise

2014-03-30 Thread Mark Volkmann
I looked at the async keyword examples in Traceur for the first time today. Cool stuff! IIUC, when a function is annotated with the async keyword, it can use await and the done function is magically defined. An interesting corollary to that idea would be to introduce a promise keyword that can

await and promise

2014-03-30 Thread Erik Arvidsson
The done function is injected by the Traceur test runner for async tests. It is standard mocha stuff. On Sunday, March 30, 2014 9:06:23 AM, Mark Volkmann r.mark.volkm...@gmail.com wrote: I looked at the async keyword examples in Traceur for the first time today. Cool stuff! IIUC, when a

Re: await and promise

2014-03-30 Thread Mark Volkmann
I have seen that in Mocha tests, but this code looked different to me. I'm looking at https://github.com/google/traceur-compiler/blob/master/test/feature/AsyncFunctions/AlphaRenaming.js . I thought to use done in a Mocha test you have to have a parameter named done in the test function. I suppose

RE: await and promise

2014-03-30 Thread Domenic Denicola
`new Promise(` should be seen as a bridge, used only for interfacing with asynchronicity that does not use promises. (Such as Nodebacks, setTimeout, or older DOM interfaces.) Otherwise you can just return the promise and chain off of it, or await it. (There are some other use cases, such as

Re: standardizing Error.stack or equivalent

2014-03-30 Thread John Lenz
sourceUrl works in chrome, with eval at least. Is displayName for function naming? On Mar 28, 2014 11:56 AM, Sebastian Zartner sebastianzart...@gmail.com wrote: Hi John, supposedly https://developers.google.com/chrome-developer-tools/docs/javascript-debugging#breakpoints-dynamic-javascript

Re: standardizing Error.stack or equivalent

2014-03-30 Thread John Barton
Hi Mark. I implemented the first sourceURL support, for Firebug back in the day. It's a kludge we worked out because there was no alternative. It forces debuggers seek the ends of buffers even if they are millions of bytes and even if the the name does not turn out to be the one the dev was