hydroper commented on issue #235:
URL: 
https://github.com/apache/royale-compiler/issues/235#issuecomment-2050594389

   Since ECMAScript 4 proposed generators without using a `*` prefix in 
function names unlike in ECMAScript Harmony, I suggest, please... maybe do not 
introduce the `async` modifier and comply with ECMAScript 4?
   
   Not that it's difficult to parse, but it'd be nice to have a general 
consensus in the syntax, since ActionScript 3.0 implements most of ECMAScript 4.
   
   ES4 examples:
   
   ```
   /* methodThatYields(): Iterator.<Number> */
   
   function methodThatYields(): Number {
       for (var i = 0; i < 10; i++) {
           yield i
       }
   }
   ```
   
   Example of asynchronous methods as in 
[AS3Parser](https://github.com/hydroper/as3parser):
   
   ```
   function asynchronousMethod1(): Promise.<Number> (
       Promise.resolve(10)
   );
   function asynchronousMethod2(): Promise.<Number> {
       return await asynchronousMethod1();
   }
   ```
   
   I've an implementation of `Promise` in my repository, as well (based on a 
polyfill), but I added a simple type parameter, so you may want to look at 
[agera.util](https://github.com/agera-air/util) instead.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@royale.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to