-
• #2
Works as designed and implemented... AND as documented on page https://www.espruino.com/Compilation :
JavaScript Compilation
- ...
- What works and what doesn't?
- Works
- ...
- ...
- Doesn't Work
- Creating objects with new
- ...
- Creating objects with new
- Works
New is not implemented for various reasons...
- ...
-
• #3
Wed 2018.10.03
Too many Windows containing reference documentation open and observed the contents under the wrong Caveats heading.
Good catch @allObjects
-
• #4
I should add that the process of creating typed arrays can be quite slow (as Espruino has to search for a contiguous area of free memory) so if you want to get the best performance out of compiled code you're best off allocating them once, when the device initialises.
Mon 2018.10.01
Just attempted
"compiled";
just after the function name line inside a class, as in the example.https://www.espruino.com/Compilation
But am faced with:
Is this supported for class functions?
EDIT Tue 2018.10.02
After many divide and conquer attempts;
"NewExpression" seems to refer to:
var ary = new Uint8ClampedArray(16);
and not
"compiled";
despite the function actually working as expected.