-
Tue 2020.04.14
'where I can fine re information about is Espruino event object'
The reference made in post #10 is to the detail provided once the watch fires. The easiest way to see what is available is to create a new var inside the watch and assign 'e' to that var, then follow that with the 'debugger' command. Fire the watch. Attempting to just write to the console will result in
[object Object]
The return property set is described in the second to last full pp beneath the description heading.
In the off chance that comment was a reference to Espruinos 'E' class as there are a few events within it:Search 'E Class' or nav on left-hand side 'E'
https://www.espruino.com/Reference#t_E
https://www.espruino.com/Reference#t_l_E_errorFlag
https://www.espruino.com/Reference#t_l_E_init'what will happen if there is an un-handled exception in Espruino'
when within the user JS code and not from within the underlying C source
Typically nothing out of the ordinary. Where necessary, I wrap internal function code sections with try/catch blocks and throw my own exceptions. Gordon provided this nice snippet that may help, regarding assertions:post #6 and #7 How to determine which setWatch callback
Thanks @Gordon for your suggestions. I will try it for sure. Since there is already Arduino library available, will it be worth to try to add the C code in Espruino src as a lib and compile it locally? As you are doing with microbit, hexbadge and BangleJS as a same way add my C code in lib folder and compile?
Another question, what will happen if there is an un-handled exception in Espruino? A restart/reset?
@allObjects, As I am exploring all available option, I would like to know where I can fine re information about is Espruino event object?