You are reading a single comment by @allObjects and its replies. Click here to read the full conversation.
  • edited... (and see post #10)
    I expected the negative side effects... unfortunately (Chrome) browser just does not behave as (EDITED: by me misread) MDN constructor specs / doc ...

    In test code new Uint8Array(buffer, begin, length).length return just the length of buffer... and on .set() it reports Uncaught RangeError: Source is too large(…).

    In Chrom inspec/debug console:

    > var b = new Uint8Array(10);
    < undefined
    > var t = new Uint8Array(5);
    < undefined
    > t.set(new Uint8Array(b,0,5))
    X> VM380:1 Uncaught RangeError: Source is too large(…)(anonymous function) @ VM380:1
    > (new Uint8Array(b,0,5)).length
    < 10
    

    Found no complaint on the Web about this violation...

    Write a compiled copy function, could that help speeding up an element-wise copy?

About

Avatar for allObjects @allObjects started