Am starting to examine and debug now ... I ran a trace ... and the following is interesting as it appears to clearly show the puzzle. Now going to start looking at jsnative.c:
>var x = setInterval(function() {
: print("!");
:}, 1000);
=1
#1[r2,l1] Object {
#2[r1,l2] Name String [1 blocks] "ÿ" #3[r1,l2] Object {
#6[r1,l2] Name String [2 blocks] "timers" #8[r2,l1] Array(2) [
#46[r1,l2] Name Integer 1 #38[r1,l1] Object {
#40[r1,l2] Name String [1 blocks] "time" #39[r1,l1] Integer 10249
#42[r1,l2] Name String [2 blocks] "interval" #41[r1,l1] Integer 8855
#44[r1,l2] Name String [2 blocks] "callback" #25[r1,l1] Function {
#21[r1,l2] Name String [1 blocks] "ÿcod" #24[r1,l1] String [3 blocks] "{\n print(\"!\");\n}"
}
}
]
#9[r1,l2] Name String [2 blocks] "watches" #11[r2,l1] Array(0) [ ]
#12[r1,l2] Name String [2 blocks] "history" #16[r1,l1] Array(3) [
#17[r1,l2] Name Integer 0 #13[r1,l1] String [2 blocks] "echo(0);"
#18[r1,l2] Name Integer 1 #19[r1,l1] String [2 blocks] "echo(1);"
#26[r1,l2] Name Integer 2 #28[r1,l1] String [8 blocks] "var x = setInterval(function() {\n print(\"!\");\n}, 1000);"
]
}
#27[r1,l2] Name String [1 blocks] "x"= int 1
}
=undefined
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.
Am starting to examine and debug now ... I ran a trace ... and the following is interesting as it appears to clearly show the puzzle. Now going to start looking at jsnative.c: