martin-pabst / Online-IDE-new-compiler

Online-IDE with new compiler
GNU General Public License v3.0
1 stars 0 forks source link

Attention: JavaCompiler.compileIfDirty is async #38

Closed fjf2002 closed 3 weeks ago

fjf2002 commented 3 weeks ago

The following sequence occurs twice:

https://github.com/martin-pabst/Online-IDE-new-compiler/blob/47446e324247c83665868048f60ade72b1f3dbd0/src/compiler/java/JavaCompiler.ts#L263-L265

I suppose the afterCompiling method shall be called after compileIfDirty ?

That won't work.

Note that compileIfDirty is async and is not called using await. So it will return probably on the first await call that actually does something asynchronous (interruptIfNeeded?).

I could rework some of that stuff ... ?

fjf2002 commented 3 weeks ago

I will activate ESLint. That will show such (and many other) errors.

Consider activating the ESLint VSCode plugin in your IDE.