soywiz-archive / jtransc

Bytecode to source converting Java & Kotlin code into JavaScript, C++, D, C#, PHP, AS3, Dart and Haxe and run it everywhere. Also use JVM code in your favourite language as a library.
https://jtransc.soywiz.com/
Apache License 2.0
632 stars 67 forks source link

JS: async/await #274

Closed soywiz closed 7 years ago

soywiz commented 7 years ago

Target JS to ES6 (you can always transpile it with a transpiler) Use async/await pattern to enable support for synchronous I/O and threads

Partially implementation of https://github.com/jtransc/jtransc/issues/265 (but just for JS)

intrigus commented 7 years ago

Wouldn't it be by far easier to implicitly mark all methods as @JTranscSync and only async methods as JTranscAsync?

soywiz commented 7 years ago

@intrigus Yes, it would be easier. But I wanted two things:

codecov[bot] commented 7 years ago

Codecov Report

Merging #274 into master will increase coverage by 0.02%. The diff coverage is 42.99%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #274      +/-   ##
============================================
+ Coverage     17.82%   17.85%   +0.02%     
  Complexity      386      386              
============================================
  Files           312      314       +2     
  Lines         20747    20802      +55     
  Branches       4485     4493       +8     
============================================
+ Hits           3699     3714      +15     
- Misses        16369    16405      +36     
- Partials        679      683       +4
Impacted Files Coverage Δ Complexity Δ
...sc-rt-core/src/com/jtransc/text/MStringReader.java 0% <ø> (ø) 0 <0> (ø) :arrow_down:
...re/src/com/jtransc/simd/MutableFloat32x4Utils.java 0% <ø> (ø) 0 <0> (ø) :arrow_down:
...c-rt-core/src/com/jtransc/lang/JTranscObjects.java 0% <ø> (ø) 0 <0> (ø) :arrow_down:
...ransc-rt-core/src/com/jtransc/mem/FastMemByte.java 0% <ø> (ø) 0 <0> (ø) :arrow_down:
jtransc-rt-core/src/com/jtransc/FastMemory.java 19.35% <ø> (ø) 6 <0> (ø) :arrow_down:
jtransc-rt-core/src/com/jtransc/simd/Simd.java 0% <ø> (ø) 0 <0> (ø) :arrow_down:
...c-rt-core/src/com/jtransc/simd/Float32x4Utils.java 0% <ø> (ø) 0 <0> (ø) :arrow_down:
...sc-rt-core/src/com/jtransc/mem/BytesReadAlign.java 0% <ø> (ø) 0 <0> (ø) :arrow_down:
jtransc-rt-core/src/com/jtransc/mem/BytesRead.java 0% <ø> (ø) 0 <0> (ø) :arrow_down:
...ansc-rt-core/src/com/jtransc/ds/FastStringMap.java 0% <ø> (ø) 0 <0> (ø) :arrow_down:
... and 42 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 67193c2...3302723. Read the comment docs.