• Ok, that's now fixed in GitHub. This also explains the problems people were having with resetting the displays. I'm still not sure why I never had this issue myself :)

    Just a note about uint8arrays:

    >var a = new ArrayBuffer(10)
    >b = new Uint8Array(a)
    =[object Uint8Array]{
    0: 0,
    1: 0,
    2: 0,
    3: 0,
    4: 0,
    5: 0,
    6: 0,
    7: 0,
    8: 0,
    9: 0
    }
    >for (i in b) b[i]=i;
    > c = new Uint8Array(b,5,5)
    = [object Uint8Array]{
    0: 0,
    1: 1,
    2: 2,
    3: 3,
    4: 4,
    5: 5,
    6: 6,
    7: 7,
    8: 8,
    9: 9
    }
    > c = new Uint8Array(a,5,5)
    = [object Uint8Array]{
    0: 5,
    1: 6,
    2: 7,
    3: 8,
    4: 9
    }
    

    It's a bit crazy really.

    Graphics in Espruino uses ArrayBuffer, not Uint8Array, so actually in this case it's behaving perfectly - the only issue is that it doesn't error out when you give it range that extends past the end of the array - that that's actually pretty useful :)

About

Avatar for Gordon @Gordon started