You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This used to work until v0.2.81, but no longer works now. I assume this is due to #2855
import() is not an actual JavaScript function since it is a "special syntax", so perhaps this used to work somewhat by accident. However, the change in #2855 was intended to address something else entirely, and is transforming the generated code into something that definitely does not make sense. It is now trying to call a non-existent function with the name "_import".
Expected Behavior
Either things should continue to work as they did before, or compilation/code-generation should give an error message that using this js_name is not allowed.
I proposed in the discord to make import a function in js-sys, any thoughts on that?
I think it would be a good idea to have that. But if there is interest in that, then I think a new issue should be created specifically for that feature.
IMHO this issue is about the regression bug. Something that used to work does not work anymore, and in addition it breaks in a way that does not trigger an error, but breaks the generated JavaScript code silently.
Describe the Bug
We use the following snippet in order to use "dynamic import" special syntax from rust:
This used to work until v0.2.81, but no longer works now. I assume this is due to #2855
import()
is not an actual JavaScript function since it is a "special syntax", so perhaps this used to work somewhat by accident. However, the change in #2855 was intended to address something else entirely, and is transforming the generated code into something that definitely does not make sense. It is now trying to call a non-existent function with the name "_import".Expected Behavior
Either things should continue to work as they did before, or compilation/code-generation should give an error message that using this js_name is not allowed.
Actual Behavior
The generated code looks something like this:
The text was updated successfully, but these errors were encountered: