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 writ

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