That should work fine. When/where are you calling it? Is it possible you are calling it before the JsVars have been initialised, so it's unable to allocate anything?
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.
That should work fine. When/where are you calling it? Is it possible you are calling it before the JsVars have been initialised, so it's unable to allocate anything?