Correct TypedArray#byteOffset handling and fix TypedArray#subarray (#328)

This commit is contained in:
Max Graey
2018-11-09 00:19:41 +02:00
committed by Daniel Wirtz
parent 2ecec660d2
commit d93ca84aed
5 changed files with 362 additions and 419 deletions

View File

@ -21,7 +21,7 @@ export class Uint8Array extends TypedArray<u8,u32> {
export class Uint8ClampedArray extends TypedArray<u8,u32> {
static readonly BYTES_PER_ELEMENT: usize = sizeof<u8>();
@operator("[]=")
@inline @operator("[]=")
protected __set(index: i32, value: i32): void {
super.__set(index, max(min(value, 255), 0));
}