This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function AsyncRun(generatorCreator) { | |
| const generator = generatorCreator(); | |
| function handleNext(next) { | |
| if (next.done) { | |
| // return Promise.resolve(next.value); | |
| return next.value; | |
| } else { | |
| return next.value.then(handleSuccess, handleError); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <type_traits> | |
| #include <utility> | |
| namespace detail | |
| { | |
| constexpr inline int Sgn(int v) | |
| { | |
| return (v > 0) - (v < 0); | |
| } |