The following is 100% reproduceable, just uploading the code.
Uncaught ReferenceError: "dpu" is not defined
I performed the following three times as I couldn't believe my luck finding a repeatable condition.
Out of all the situations I've come across this past week, this is the easiest to reproduce.
I've gutted nearly 1/2 of code file lines, primarily external comment blocks, embedded comment lines within functions, and any code snippets that weren't needed to run a simple test.
It shouldn't be necessary to wire external pins as code no longer functions, although I haven't tested.
To get to this final file, the goal of the project no longer works, and many features can no longer be tested. That's okay at this point, as I've found a 100% reporoduceable situation. It appears that whatever table mechanism that references internal functions by name, becomes corrupt and therefore unaccessible, just by uploading!
3x I've powered off/on the device. I've closed/opened the WebIDE. I haven't rebooted Windows10 yet, but will do soon as I also search for, and try other lint tools.
I added some simple function wrappers to avoid having to type long commands.
Display Memory Flags Error
>dmf()
Process Memory shortcut
>pm()
Run Garbage Collection
>rgc()
I load the code file from disk. I upload to the MDBT42Q.
It takes twenty seconds to settle down before the second > prompt is visible.
At this point, an attempt to run function dpu() results in:
Uncaught ReferenceError: "dpu" is not defined
at line 1265 col 3
dpu();
Typing dump() or searching within the WebIDE editor will find that function at L200
I've run every combination of the following, and ther results are approximately the same. Running a garbage collection does clear the 'LOW_MEMORY' flag and frees up 6 JSVARS. Repeatable.
Here is a sample:
Even with 30%+ free JSVARS, no MEMORY error, but a hidden LOW_MEMORY flag is set:
Attempting to run a function that is visible on the code side and within a dump() results in:
>dpu()
Uncaught ReferenceError: "dpu" is not defined
at line 1 col 1
dpu()
^
>r()
counter: 0
counterPulses: 0
Uncaught ReferenceError: "dpu" is not defined
at line 1265 col 3
dpu()
Performing a dump() will clearly show the function listed in tact L367 around the first quarter of the dump, as everything does not match the source file chronological order.
I'm posting this here now, as this ran a week ago before I started adding more comments and additional accessor functions. I'll search for other lint checkers, and continue testing tomorrow with a fresh start.
Windows 10, version 1909 64bit
Web IDE version 0.70.6
{
"VERSION": "2v03",
"GIT_COMMIT": "e77d74f6",
"BOARD": "MDBT42Q",
Butchered code file to get the repeatable error, so withold the comments on format and style. ;-)
L367 in dump20200328p0807dpuTEST3.txt file is the dump showing function exists
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.
Sun 2020.03.29
The following is 100% reproduceable, just uploading the code.
I performed the following three times as I couldn't believe my luck finding a repeatable condition.
Out of all the situations I've come across this past week, this is the easiest to reproduce.
I've gutted nearly 1/2 of code file lines, primarily external comment blocks, embedded comment lines within functions, and any code snippets that weren't needed to run a simple test.
It shouldn't be necessary to wire external pins as code no longer functions, although I haven't tested.
To get to this final file, the goal of the project no longer works, and many features can no longer be tested. That's okay at this point, as I've found a 100% reporoduceable situation. It appears that whatever table mechanism that references internal functions by name, becomes corrupt and therefore unaccessible, just by uploading!
3x I've powered off/on the device. I've closed/opened the WebIDE. I haven't rebooted Windows10 yet, but will do soon as I also search for, and try other lint tools.
I added some simple function wrappers to avoid having to type long commands.
I load the code file from disk. I upload to the MDBT42Q.
It takes twenty seconds to settle down before the second > prompt is visible.
At this point, an attempt to run function dpu() results in:
Typing dump() or searching within the WebIDE editor will find that function at L200
I've run every combination of the following, and ther results are approximately the same. Running a garbage collection does clear the 'LOW_MEMORY' flag and frees up 6 JSVARS. Repeatable.
Here is a sample:
Even with 30%+ free JSVARS, no MEMORY error, but a hidden LOW_MEMORY flag is set:
Attempting to run a function that is visible on the code side and within a dump() results in:
Performing a dump() will clearly show the function listed in tact L367 around the first quarter of the dump, as everything does not match the source file chronological order.
I'm posting this here now, as this ran a week ago before I started adding more comments and additional accessor functions. I'll search for other lint checkers, and continue testing tomorrow with a fresh start.
Butchered code file to get the repeatable error, so withold the comments on format and style. ;-)
L367 in dump20200328p0807dpuTEST3.txt file is the dump showing function exists
3 Attachments