new Float32Array([])/Float64Array([]) hangs

Posted on
  • On a Pico, v1.91, Creating an empty array with new Float32Array([]) or Float64Array([]) hangs up Espruino.
    Passing "0" as argument has the same effect.
    Passing a not empty array as argument works as expected: new Float32Array([1]). Creating other arrays of size 0 (Uint8 etc.) also works.
    Is this a (small) bug?

  • Wow - sounds like a bug - I'm amazed that's never come up before!

    I'll take a look on Monday, and I should be able to get a fix in for 1v92.

  • Ok, this is now fixed and will be in 1v92 - it turned out to be a problem with converting them to a JSON-formatted string (so their use in normal execution would have been fine).

  • Great! Looking forward to 1v92..

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

new Float32Array([])/Float64Array([]) hangs

Posted by Avatar for Steffen @Steffen