Skip to content

Instantly share code, notes, and snippets.

@anttikuuskoski
Last active April 8, 2024 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anttikuuskoski/a04f81735b63b0b17ad41d19a49fe97b to your computer and use it in GitHub Desktop.
Save anttikuuskoski/a04f81735b63b0b17ad41d19a49fe97b to your computer and use it in GitHub Desktop.
Shelly 1.2.2 firmware console issue example
/* Shelly firmware 1.2.2 issue; tested on Pro3EM */
let counter = 0;
function breaksIt(i) {
console.log('break ' + i);
}
function worksBut(a) {
console.log('func ' + a + ' ' + (counter++) );
//breaksIt('whatever'); // uncommenting this line will cause the first worksBut call to show nothing.
}
worksBut(1);
worksBut(2);
worksBut(3);
worksBut(4);
//When L9 commented, prints out:
/*
func 1
func 2
func 3
func 4
*/
//When L9 uncommented, prints out:
/*
break whatever
func 2
break whatever
func 3
break whatever
func 4
break whatever
*/
// In other words, the first two console log calls were never performed or printed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment