You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Hi,

    Yesterday I completed some pretty big changes to Espruino that allow built-in functions to be referenced. This means you can now do some of the more interesting JavaScript stuff, like:

    >[1,2,3,4].map(console.log) 
    1 0 [1,2,3,4]
    2 1 [1,2,3,4]
    3 2 [1,2,3,4]
    4 3 [1,2,3,4]
    =[]
    >[1,2,3,4].map(Math.sin)   
    =[0.841470984807896549284,0.909297426825681576190,0.141120008059867219074,-0.75680249530792824685]
    >Math.min.apply(undefined,[1,2,3,4]) 
    =1
    

    As I said, they're pretty big changes. I've tested it against the tests that I have, but I'd be pretty sure that there were still outstanding problems, so I don't want to make a new release until it has been tested some more.

    Please can you help me out and let me know if anything's broken that was working before?

    Because you can now take the built-in functions and use them in ways that weren't intended (eg. SPI1.send.apply(I2C1,"foo")) you may be able to get some instability/odd errors when doing things like that and it'd be great if you could help find those. Even better if you can fix them too ;)

    To test the newest version, just flash via the Web IDE in the normal way, but copy and paste this URL into the flasher:

    http://www.espruino.com/binaries/git/commits/74d4bc574cfed38d0fc0d99f4d8b8ca07c0c677a/espruino_1v60_espruino_1r3.bin
    

    Anyway, it'll be great to get this all released - I think this fixes the biggest incompatibility that Espruino had with normal JavaScript code.

About

Avatar for Gordon @Gordon started