Parsing a variable of type "undefined" creates an error:
function foo(x, y) { for (var i=0; i<arguments.length; i++) { console.log("i="+i); try { console.log("val="+arguments[i]); } catch (e) { console.log(e);} } } foo(undefined, 1, undefined, 2) i=0 ReferenceError: ReferenceError: "0" is not defined i=1 val=1 i=2 ReferenceError: ReferenceError: "2" is not defined i=3 val=2 =undefined
So there are two bugs: arguments.length is not updated (documented https://www.espruino.com/Reference#l__global_arguments). arguments fails for undefined arguments (not documented).
@maze1980 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.
Parsing a variable of type "undefined" creates an error:
So there are two bugs: arguments.length is not updated (documented https://www.espruino.com/Reference#l__global_arguments). arguments fails for undefined arguments (not documented).