The if (C) {...}-thing still gives me annoying grieve,... I thought the added curly braces would have solved the issue for good...
1v70 Copyright 2014 G.Williams
>echo(0);
Uncaught Error: FOR loop can only iterate over Arrays, Strings or Objects, not undefined
at line 1 col 288
...or(var v in C)this.C[v]=C[v]}
^
Related to this code (line 10 in constructor), coming from the (again) working space-only-minified sandbox modules folder. (Had to re-enable some minification option after getting unexplicable out of memory error - see http://forum.espruino.com/comments/11900960/).
The minification messes with the code to the point where the execution and block nesting becomes broken... Why would I say so: Adding/removing some code further down in the module made the error flip-flop...
Interestingly, when I put a console.log() in the if-(then) block, it 'tricks' the minification and - miraculously (for me) - works:
if (C) { console.log("C:",C); for (var v in C) { this.C[v] = C[v]; } }
@Gordon, since you know your code like your own pockets, I'm sure you have a nice explanation - and may be - even a remedy top of your head... ;-)
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.
The if (C) {...}-thing still gives me annoying grieve,... I thought the added curly braces would have solved the issue for good...
Related to this code (line 10 in constructor), coming from the (again) working space-only-minified sandbox modules folder. (Had to re-enable some minification option after getting unexplicable out of memory error - see http://forum.espruino.com/comments/11900960/).
The constructor is invoked with undefined for C.
The minification messes with the code to the point where the execution and block nesting becomes broken... Why would I say so: Adding/removing some code further down in the module made the error flip-flop...
Interestingly, when I put a console.log() in the if-(then) block, it 'tricks' the minification and - miraculously (for me) - works:
@Gordon, since you know your code like your own pockets, I'm sure you have a nice explanation - and may be - even a remedy top of your head... ;-)
The stuff seems to be related to what @DaveNI experienced in Minified Code Producing Error - Solved at http://forum.espruino.com/conversations/257029/