[js_interop/dart2wasm] Canonicalize and move <constant-or-literal>.toJS
at compile-time to mjs file
#56046
Labels
<constant-or-literal>.toJS
at compile-time to mjs file
#56046
We should evaluate whether it makes sense for dart2wasm recognize
<constant-or-literal>.toJS
expressions and canonicalize & move those objects at compile-time to JS (by emitting them into the...mjs
file and importing those external references) instead of lazily at runtime.It may be very common to have code such as
Currently one may be tempted to cache such manually at the top-level via
but this compiles to worse code in dart2js (see #56045)
/cc @srujzs
The text was updated successfully, but these errors were encountered: