Module.addCached() does not break. It looks that I was mixing up different errors in my code when writing
passing source code in the Modules.addCached(id,source) would still break... and there actually it happened
first.
(new lines inserted as code with escape are ignored...: initially, I stored the code as a module in the IDE's configured module folder. Then I took it from there - including the line-breaks - by adding them in the inline code concatenating strings - one for each line with ending new line... and meant to see the same error... but it was a nesting of quoting that lead to an error and I attributed it first to the line-break issue).
I conclude that JS interpreter is just fine... (same behavior as return with arguments and statement closing semicolon on next line) but IDE is a bit out of sync with that for other language constructs...
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.
Module.addCached()
does not break. It looks that I was mixing up different errors in my code when writing(new lines inserted as code with escape are ignored...: initially, I stored the code as a module in the IDE's configured module folder. Then I took it from there - including the line-breaks - by adding them in the inline code concatenating strings - one for each line with ending new line... and meant to see the same error... but it was a nesting of quoting that lead to an error and I attributed it first to the line-break issue).
I conclude that JS interpreter is just fine... (same behavior as return with arguments and statement closing semicolon on next line) but IDE is a bit out of sync with that for other language constructs...