mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-17 00:41:32 +00:00
Implement TypedArray#forEach (#530)
This commit is contained in:
@ -9,6 +9,7 @@ import {
|
||||
FIND_INDEX,
|
||||
SOME,
|
||||
EVERY,
|
||||
FOREACH,
|
||||
} from "./internal/typedarray";
|
||||
|
||||
import {
|
||||
@ -63,6 +64,10 @@ export class Int8Array extends TypedArray<i8> {
|
||||
every(callbackfn: (value: i8, index: i32, self: Int8Array) => bool): bool {
|
||||
return EVERY<Int8Array, i8>(this, callbackfn);
|
||||
}
|
||||
|
||||
forEach(callbackfn: (value: i8, index: i32, self: Int8Array) => void): void {
|
||||
FOREACH<Int8Array, i8>(this, callbackfn);
|
||||
}
|
||||
}
|
||||
|
||||
export class Uint8Array extends TypedArray<u8> {
|
||||
@ -109,6 +114,10 @@ export class Uint8Array extends TypedArray<u8> {
|
||||
every(callbackfn: (value: u8, index: i32, self: Uint8Array) => bool): bool {
|
||||
return EVERY<Uint8Array, u8>(this, callbackfn);
|
||||
}
|
||||
|
||||
forEach(callbackfn: (value: u8, index: i32, self: Uint8Array) => void): void {
|
||||
FOREACH<Uint8Array, u8>(this, callbackfn);
|
||||
}
|
||||
}
|
||||
|
||||
export class Uint8ClampedArray extends Uint8Array {
|
||||
@ -165,6 +174,10 @@ export class Uint8ClampedArray extends Uint8Array {
|
||||
every(callbackfn: (value: u8, index: i32, self: Uint8ClampedArray) => bool): bool {
|
||||
return EVERY<Uint8ClampedArray, u8>(this, callbackfn);
|
||||
}
|
||||
|
||||
forEach(callbackfn: (value: u8, index: i32, self: Uint8ClampedArray) => void): void {
|
||||
FOREACH<Uint8ClampedArray, u8>(this, callbackfn);
|
||||
}
|
||||
}
|
||||
|
||||
export class Int16Array extends TypedArray<i16> {
|
||||
@ -211,6 +224,10 @@ export class Int16Array extends TypedArray<i16> {
|
||||
every(callbackfn: (value: i16, index: i32, self: Int16Array) => bool): bool {
|
||||
return EVERY<Int16Array, i16>(this, callbackfn);
|
||||
}
|
||||
|
||||
forEach(callbackfn: (value: i16, index: i32, self: Int16Array) => void): void {
|
||||
FOREACH<Int16Array, i16>(this, callbackfn);
|
||||
}
|
||||
}
|
||||
|
||||
export class Uint16Array extends TypedArray<u16> {
|
||||
@ -257,6 +274,10 @@ export class Uint16Array extends TypedArray<u16> {
|
||||
every(callbackfn: (value: u16, index: i32, self: Uint16Array) => bool): bool {
|
||||
return EVERY<Uint16Array, u16>(this, callbackfn);
|
||||
}
|
||||
|
||||
forEach(callbackfn: (value: u16, index: i32, self: Uint16Array) => void): void {
|
||||
FOREACH<Uint16Array, u16>(this, callbackfn);
|
||||
}
|
||||
}
|
||||
|
||||
export class Int32Array extends TypedArray<i32> {
|
||||
@ -303,6 +324,10 @@ export class Int32Array extends TypedArray<i32> {
|
||||
every(callbackfn: (value: i32, index: i32, self: Int32Array) => bool): bool {
|
||||
return EVERY<Int32Array, i32>(this, callbackfn);
|
||||
}
|
||||
|
||||
forEach(callbackfn: (value: i32, index: i32, self: Int32Array) => void): void {
|
||||
FOREACH<Int32Array, i32>(this, callbackfn);
|
||||
}
|
||||
}
|
||||
|
||||
export class Uint32Array extends TypedArray<u32> {
|
||||
@ -349,6 +374,10 @@ export class Uint32Array extends TypedArray<u32> {
|
||||
every(callbackfn: (value: u32, index: i32, self: Uint32Array) => bool): bool {
|
||||
return EVERY<Uint32Array, u32>(this, callbackfn);
|
||||
}
|
||||
|
||||
forEach(callbackfn: (value: u32, index: i32, self: Uint32Array) => void): void {
|
||||
FOREACH<Uint32Array, u32>(this, callbackfn);
|
||||
}
|
||||
}
|
||||
|
||||
export class Int64Array extends TypedArray<i64> {
|
||||
@ -395,6 +424,10 @@ export class Int64Array extends TypedArray<i64> {
|
||||
every(callbackfn: (value: i64, index: i32, self: Int64Array) => bool): bool {
|
||||
return EVERY<Int64Array, i64>(this, callbackfn);
|
||||
}
|
||||
|
||||
forEach(callbackfn: (value: i64, index: i32, self: Int64Array) => void): void {
|
||||
FOREACH<Int64Array, i64>(this, callbackfn);
|
||||
}
|
||||
}
|
||||
|
||||
export class Uint64Array extends TypedArray<u64> {
|
||||
@ -441,6 +474,10 @@ export class Uint64Array extends TypedArray<u64> {
|
||||
every(callbackfn: (value: u64, index: i32, self: Uint64Array) => bool): bool {
|
||||
return EVERY<Uint64Array, u64>(this, callbackfn);
|
||||
}
|
||||
|
||||
forEach(callbackfn: (value: u64, index: i32, self: Uint64Array) => void): void {
|
||||
FOREACH<Uint64Array, u64>(this, callbackfn);
|
||||
}
|
||||
}
|
||||
|
||||
export class Float32Array extends TypedArray<f32> {
|
||||
@ -487,6 +524,10 @@ export class Float32Array extends TypedArray<f32> {
|
||||
every(callbackfn: (value: f32, index: i32, self: Float32Array) => bool): bool {
|
||||
return EVERY<Float32Array, f32>(this, callbackfn);
|
||||
}
|
||||
|
||||
forEach(callbackfn: (value: f32, index: i32, self: Float32Array) => void): void {
|
||||
FOREACH<Float32Array, f32>(this, callbackfn);
|
||||
}
|
||||
}
|
||||
|
||||
export class Float64Array extends TypedArray<f64> {
|
||||
@ -533,4 +574,8 @@ export class Float64Array extends TypedArray<f64> {
|
||||
every(callbackfn: (value: f64, index: i32, self: Float64Array) => bool): bool {
|
||||
return EVERY<Float64Array, f64>(this, callbackfn);
|
||||
}
|
||||
|
||||
forEach(callbackfn: (value: f64, index: i32, self: Float64Array) => void): void {
|
||||
FOREACH<Float64Array, f64>(this, callbackfn);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user