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

    I'm afraid there aren't any definitions around, although it would be easy enough to extract the information from the Espruino build process. All the functions are described in 'wrapper files': https://github.com/espruino/Espruino/blo­b/master/README_BuildProcess.md#wrapper-­files-

    For instance there's a type file for Tern's autocomplete in the Web IDE: http://www.espruino.com/json/espruino.js­on

    However that doesn't contain all the info - for instance if you wrote your own tool to look at the JSON comments in the wrappers, you could determine what was definitely supposed to be an integer/float/etc.

    Having said all that, have you tried running TypeScript-compiled code yet? There was an issue posted up a week or so ago - in that case the TypeScript compiler that was being used created code where functions are used before they're declared.

    That's fine in normal JS where everything is parsed beforehand, but in Espruino it's parsed as it is executed, so 'Function Hoisting' doesn't work. To get code working in that case you'd ideally need to flip some setting in the transpiler to make it generate code for functions in an order that doesn't rely on the hoisting.

About

Avatar for Gordon @Gordon started