konsoletyper / teavm

Compiles Java bytecode to JavaScript, WebAssembly and C
https://teavm.org
Apache License 2.0
2.55k stars 261 forks source link

Update DefaultGlobalNameWriter.java to also include dynamic `import` … #844

Closed aghasemi closed 8 months ago

aghasemi commented 8 months ago

…in non-appendable functions

konsoletyper commented 8 months ago

This PR is simply wrong. It solves one particular case, but in general it's wrong. Instead, TeaVM needs to support ES6 modules (which includes ES6 syntax in general), needs to get rid of this $rt_globals (which actually a hack), but a big refactoring is required, which I'm currently working on.

aghasemi commented 8 months ago

This PR is simply wrong. It solves one particular case, but in general it's wrong. Instead, TeaVM needs to support ES6 modules (which includes ES6 syntax in general), needs to get rid of this $rt_globals (which actually a hack), but a big refactoring is required, which I'm currently working on.

I expected this to be incorrect. Just wanted to open the discussion. Looking forward to the refactoring.