So I ran into a few issues that I tracked down to the way the F# compiler generates code that references global variables. Rather than just do "Serial1.print()", it generates "window.Serial1.print()". It likes to do that so it doesn't have to deal with variable name collisions for global objects it doesn't know about. I am running 1.71 on my board and some things work but I have seen some odd behavior that doesn't happen if I don't use the window object.
I figured I would debug into it and try the latest code from github. At least compiled for Linux, there is no global "window" object.
What is the general direction for the project? Do you want and have plans for supporting the "window" object? Or is that not desirable and you expect everyone to use the global objects directly? What I would like to decide is if it is worthwhile to dig into the source code to work out theses issues or if I should create my own "window" object with the Espruino globals as members.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
So I ran into a few issues that I tracked down to the way the F# compiler generates code that references global variables. Rather than just do "Serial1.print()", it generates "window.Serial1.print()". It likes to do that so it doesn't have to deal with variable name collisions for global objects it doesn't know about. I am running 1.71 on my board and some things work but I have seen some odd behavior that doesn't happen if I don't use the window object.
I figured I would debug into it and try the latest code from github. At least compiled for Linux, there is no global "window" object.
What is the general direction for the project? Do you want and have plans for supporting the "window" object? Or is that not desirable and you expect everyone to use the global objects directly? What I would like to decide is if it is worthwhile to dig into the source code to work out theses issues or if I should create my own "window" object with the Espruino globals as members.