It's because it only recognizes basic function declarations (not function expressions). Try:
function dotwinkle(ths) { "compiled"; // replace 'this' with 'ths' } leds.dotwinkle = function() { dotwinkle(this); }
You'll also have to pass in 'this' as an argument, as it doesn't handle it properly otherwise.
@Gordon started
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.
It's because it only recognizes basic function declarations (not function expressions). Try:
You'll also have to pass in 'this' as an argument, as it doesn't handle it properly otherwise.