diff --git a/static_core/plugins/ets/stdlib/escompat/Array.ets b/static_core/plugins/ets/stdlib/escompat/Array.ets index 1d135fd6638bc336c283c295fd57df3a7357745f..75e87d56f45604de407420204858e10b28a78cc7 100644 --- a/static_core/plugins/ets/stdlib/escompat/Array.ets +++ b/static_core/plugins/ets/stdlib/escompat/Array.ets @@ -862,11 +862,11 @@ export class Array implements ReadonlyArray, Iterable { * * @returns New `Array` instance constructed from `this` with elements filtered using test function `predicate`. */ - public override filter(predicate: (value: T, index: number, array: Array) => boolean): Array { + public override filter(predicate: (value: T, index: int, array: Array) => boolean): Array { const res = new Array() for (let i: int = 0; i < this.actualLength; i++) { const val = this.$_get_unsafe(i) - if (predicate(val, i.toDouble(), this)) { + if (predicate(val, i, this)) { res.push(val) } } @@ -982,7 +982,7 @@ export class Array implements ReadonlyArray, Iterable { * @return new Array after map and than flat */ // NOTE(ivan-tyulyandin): TBD, flatMap may be not subset, see ReadonlyArray - public flatMap(fn: (v: T, k: number, arr: Array) => U): Array { + public flatMap(fn: (v: T, k: int, arr: Array) => U): Array { let mapped: Array = this.map(fn) return mapped.flat() } @@ -1151,7 +1151,7 @@ export class Array implements ReadonlyArray, Iterable { * * @returns the value of the first element in the array or undefined */ - public override find(predicate: (value: T, index: number, array: Array) => boolean): T | undefined { + public override find(predicate: (value: T, index: int, array: Array) => boolean): T | undefined { const res = this.findIndex(predicate) if (res == -1) { return undefined @@ -1169,9 +1169,9 @@ export class Array implements ReadonlyArray, Iterable { * * @returns found element index or -1 otherwise */ - public override findIndex(predicate: (value: T, index: number, array: Array) => boolean): number { + public override findIndex(predicate: (value: T, index: int, array: Array) => boolean): number { for (let i = 0; i < this.actualLength; i++) { - if (predicate(this.$_get_unsafe(i), i.toDouble(), this)) { + if (predicate(this.$_get_unsafe(i), i, this)) { return i; } } @@ -1186,10 +1186,10 @@ export class Array implements ReadonlyArray, Iterable { * * @returns found element or undefined otherwise */ - public override findLast(predicate: (elem: T, index: number, array: Array) => boolean): T | undefined { + public override findLast(predicate: (elem: T, index: int, array: Array) => boolean): T | undefined { for (let i = this.actualLength - 1; i >= 0; i--) { const val = this.$_get_unsafe(i); - if (predicate(val, i.toDouble(), this)) { + if (predicate(val, i, this)) { return val; } } @@ -1205,10 +1205,10 @@ export class Array implements ReadonlyArray, Iterable { * * @returns `true` if `predicate` returns a `true` value for every array element. Otherwise, `false`. */ - public override every(predicate: (value: T, index: number, array: Array) => boolean): boolean { + public override every(predicate: (value: T, index: int, array: Array) => boolean): boolean { let curArrLength = this.actualLength for (let i = 0; i < curArrLength && i < this.actualLength; i++) { - if (!predicate(this.$_get_unsafe(i), i.toDouble(), this)) { + if (!predicate(this.$_get_unsafe(i), i, this)) { return false } } @@ -1224,9 +1224,9 @@ export class Array implements ReadonlyArray, Iterable { * * @returns `true` if `predicate` returns a `true` value for at least one array element. Otherwise, `false`. */ - public override some(predicate: (value: T, index: number, array: Array) => boolean): boolean { + public override some(predicate: (value: T, index: int, array: Array) => boolean): boolean { for (let i = 0; i < this.actualLength; i++) { - if (predicate(this.$_get_unsafe(i), i.toDouble(), this)) { + if (predicate(this.$_get_unsafe(i), i, this)) { return true } } @@ -1242,9 +1242,9 @@ export class Array implements ReadonlyArray, Iterable { * * @returns index of first element satisfying to predicate, -1 if no such element */ - public override findLastIndex(predicate: (element: T, index: number, array: Array) => boolean): number { + public override findLastIndex(predicate: (element: T, index: int, array: Array) => boolean): number { for (let i = this.actualLength - 1; i >= 0; i--) { - if (predicate(this.$_get_unsafe(i), i.toDouble(), this)) { + if (predicate(this.$_get_unsafe(i), i, this)) { return i } } @@ -1258,13 +1258,13 @@ export class Array implements ReadonlyArray, Iterable { * * @returns a result after applying callbackfn over all elements of the Array */ - public override reduce(callbackfn: (previousValue: T, currentValue: T, index: number, array: Array) => T): T { + public override reduce(callbackfn: (previousValue: T, currentValue: T, index: int, array: Array) => T): T { if (this.actualLength == 0) { throw new TypeError("Reduce of empty array with no initial value") } let acc: T = this.$_get_unsafe(0); for (let i = 1; i < this.actualLength; i++) { - acc = callbackfn(acc, this.$_get_unsafe(i), i.toDouble(), this) + acc = callbackfn(acc, this.$_get_unsafe(i), i, this) } return acc } @@ -1278,10 +1278,10 @@ export class Array implements ReadonlyArray, Iterable { * * @returns a result after applying callbackfn over all elements of the Array */ - public override reduce(callbackfn: (previousValue: U, currentValue: T, index: number, array: Array) => U, initialValue: U): U { + public override reduce(callbackfn: (previousValue: U, currentValue: T, index: int, array: Array) => U, initialValue: U): U { let acc = initialValue for (let i = 0; i < this.actualLength; i++) { - acc = callbackfn(acc, this.$_get_unsafe(i), i.toDouble(), this) + acc = callbackfn(acc, this.$_get_unsafe(i), i, this) } return acc } @@ -1295,10 +1295,10 @@ export class Array implements ReadonlyArray, Iterable { * * @returns a result after applying callbackfn over all elements of the Array */ - public override reduceRight(callbackfn: (previousValue: U, currentValue: T, index: number, array: Array) => U, initialValue: U): U { + public override reduceRight(callbackfn: (previousValue: U, currentValue: T, index: int, array: Array) => U, initialValue: U): U { let acc = initialValue for (let i = this.actualLength - 1; i >= 0; i--) { - acc = callbackfn(acc, this.$_get_unsafe(i), i.toDouble(), this) + acc = callbackfn(acc, this.$_get_unsafe(i), i, this) } return acc } @@ -1308,13 +1308,13 @@ export class Array implements ReadonlyArray, Iterable { * * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. */ - public override forEach(callbackfn: (value: T, index: number, array: Array) => void): void { + public override forEach(callbackfn: (value: T, index: int, array: Array) => void): void { const len0 = this.actualLength; for (let i = 0; i < len0; i++) { if (i >= this.actualLength) { break } - callbackfn(this.$_get_unsafe(i), i.toDouble(), this) + callbackfn(this.$_get_unsafe(i), i, this) } } @@ -1778,11 +1778,11 @@ export class Array implements ReadonlyArray, Iterable { * * @returns `Array` instance, constructed from `this` and given function. */ - public override map(callbackfn: (value: T, index: number, array: Array) => U): Array { + public override map(callbackfn: (value: T, index: int, array: Array) => U): Array { const len = this.actualLength; let res : FixedArray = new Any[len]; for (let i = 0; i < this.actualLength; i++) { - res[i] = callbackfn(this.$_get_unsafe(i), i.toDouble(), this); + res[i] = callbackfn(this.$_get_unsafe(i), i, this); } return new Array(FROM_BUFFER, res); } @@ -1794,14 +1794,14 @@ export class Array implements ReadonlyArray, Iterable { * * @returns a result after applying callbackfn over all elements of the Array */ - public override reduceRight(callbackfn: (previousValue: T, currentValue: T, index: number, array: Array) => T): T { + public override reduceRight(callbackfn: (previousValue: T, currentValue: T, index: int, array: Array) => T): T { if (this.actualLength == 0) { throw new TypeError("Reduce of empty array with no initial value") } let acc: T = this.$_get_unsafe(this.actualLength - 1); for (let i = this.actualLength - 2; i >= 0; i--) { if (this.actualLength > i) { - acc = callbackfn(acc, this.$_get_unsafe(i), i.toDouble(), this) + acc = callbackfn(acc, this.$_get_unsafe(i), i, this) } } return acc diff --git a/static_core/plugins/ets/stdlib/escompat/ReadonlyArray.ets b/static_core/plugins/ets/stdlib/escompat/ReadonlyArray.ets index fea81ac9a95381ae69729215583ecb61108ebcaf..155fb8ef24273ec2f273bb96de26929b07d19484 100644 --- a/static_core/plugins/ets/stdlib/escompat/ReadonlyArray.ets +++ b/static_core/plugins/ets/stdlib/escompat/ReadonlyArray.ets @@ -23,17 +23,17 @@ export interface ReadonlyArray extends ConcatArray { entries(): IterableIterator<[number, T]>; - every(predicate: (value: T, index: number, array: ReadonlyArray) => boolean): boolean; + every(predicate: (value: T, index: int, array: ReadonlyArray) => boolean): boolean; - filter(predicate: (value: T, index: number, array: ReadonlyArray) => boolean): Array; + filter(predicate: (value: T, index: int, array: ReadonlyArray) => boolean): Array; - find(predicate: (value: T, index: number, obj: ReadonlyArray) => boolean): T | undefined; + find(predicate: (value: T, index: int, obj: ReadonlyArray) => boolean): T | undefined; - findLast(predicate: (value: T, index: number, obj: ReadonlyArray) => boolean): T | undefined; + findLast(predicate: (value: T, index: int, obj: ReadonlyArray) => boolean): T | undefined; - findIndex(predicate: (value: T, index: number, obj: ReadonlyArray) => boolean): number; + findIndex(predicate: (value: T, index: int, obj: ReadonlyArray) => boolean): number; - findLastIndex(predicate: (value: T, index: number, obj: ReadonlyArray) => boolean): number; + findLastIndex(predicate: (value: T, index: int, obj: ReadonlyArray) => boolean): number; // NOTE(ivan-tyulyandin): TBD, FlatArray is non-subset type // flat( @@ -47,7 +47,7 @@ export interface ReadonlyArray extends ConcatArray { // thisArg?: This, // ): U[]; - forEach(action: (value: T, index: number, array: ReadonlyArray) => void): void; + forEach(action: (value: T, index: int, array: ReadonlyArray) => void): void; join(separator?: string): string; @@ -59,19 +59,19 @@ export interface ReadonlyArray extends ConcatArray { lastIndexOf(searchElement: T, fromIndex?: int): int; - map(mapper: (value: T, index: number, array: ReadonlyArray) => U): Array; + map(mapper: (value: T, index: int, array: ReadonlyArray) => U): Array; - reduce(reducer: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T): T; + reduce(reducer: (previousValue: T, currentValue: T, currentIndex: int, array: ReadonlyArray) => T): T; - reduce(reducer: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U; + reduce(reducer: (previousValue: U, currentValue: T, currentIndex: int, array: ReadonlyArray) => U, initialValue: U): U; - reduceRight(reducer: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T): T; + reduceRight(reducer: (previousValue: T, currentValue: T, currentIndex: int, array: ReadonlyArray) => T): T; - reduceRight(reducer: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U; + reduceRight(reducer: (previousValue: U, currentValue: T, currentIndex: int, array: ReadonlyArray) => U, initialValue: U): U; slice(start?: number, end?: number): Array; - some(predicate: (value: T, index: number, array: ReadonlyArray) => boolean): boolean; + some(predicate: (value: T, index: int, array: ReadonlyArray) => boolean): boolean; // toLocaleString(): string; // All objects in ArkTS have such method, no need to define it here diff --git a/static_core/plugins/ets/stdlib/escompat/RegExp.ets b/static_core/plugins/ets/stdlib/escompat/RegExp.ets index 7d176d9d27a492f211c9cce20c2213df5e20f88b..59122da2560fc814862e9a56b13ba3e60d5d33ab 100644 --- a/static_core/plugins/ets/stdlib/escompat/RegExp.ets +++ b/static_core/plugins/ets/stdlib/escompat/RegExp.ets @@ -327,7 +327,7 @@ export class RegExpResultArray /*extends Array*/ { * Returns elements that meet the condition specified in a callback function. */ public filter(predicate: (value: String, index: number, array: RegExpResultArray) => boolean): Array { - return this.result_.filter((value: String, index: number, array: Array) => { + return this.result_.filter((value: String, index: int, array: Array) => { return predicate(value, index, this) }) } @@ -336,7 +336,7 @@ export class RegExpResultArray /*extends Array*/ { * Returns the value of the first element where predicate is true. */ public find(predicate: (value: String, index: number, array: RegExpResultArray) => boolean): String | undefined { - return this.result_.find((value: String, index: number, array: Array) => { + return this.result_.find((value: String, index: int, array: Array) => { return predicate(value, index, this) }) } @@ -345,7 +345,7 @@ export class RegExpResultArray /*extends Array*/ { * Returns the index of the first element where predicate is true. */ public findIndex(predicate: (value: String, index: number, array: RegExpResultArray) => boolean): number { - return this.result_.findIndex((value: String, index: number, array: Array) => { + return this.result_.findIndex((value: String, index: int, array: Array) => { return predicate(value, index, this) }) } @@ -354,7 +354,7 @@ export class RegExpResultArray /*extends Array*/ { * Returns the value of the last element that satisfies the testing function. */ public findLast(predicate: (elem: String, index: number, array: RegExpResultArray) => boolean): String | undefined { - return this.result_.findLast((elem: String, index: number, array: Array) => { + return this.result_.findLast((elem: String, index: int, array: Array) => { return predicate(elem, index, this) }) } @@ -363,7 +363,7 @@ export class RegExpResultArray /*extends Array*/ { * Returns the index of the last element that satisfies the testing function. */ public findLastIndex(predicate: (element: String, index: number, array: RegExpResultArray) => boolean): number { - return this.result_.findLastIndex((element: String, index: number, array: Array) => { + return this.result_.findLastIndex((element: String, index: int, array: Array) => { return predicate(element, index, this) }) } @@ -393,7 +393,7 @@ export class RegExpResultArray /*extends Array*/ { * Applies flat and then map. */ public flatMap(fn: (v: String, k: number, arr: RegExpResultArray) => U): Array { - return this.result_.flatMap((v: String, k: number, arr: Array) => { + return this.result_.flatMap((v: String, k: int, arr: Array) => { return fn(v, k, this) }) } @@ -402,7 +402,7 @@ export class RegExpResultArray /*extends Array*/ { * Determines whether all members satisfy the specified test. */ public every(predicate: (value: String, index: number, array: RegExpResultArray) => boolean): boolean { - return this.result_.every((value: String, index: number, array: Array) => { + return this.result_.every((value: String, index: int, array: Array) => { return predicate(value, index, this) }) } @@ -411,7 +411,7 @@ export class RegExpResultArray /*extends Array*/ { * Determines whether any element satisfies the specified test. */ public some(predicate: (value: String, index: number, array: RegExpResultArray) => boolean): boolean { - return this.result_.some((value: String, index: number, array: Array) => { + return this.result_.some((value: String, index: int, array: Array) => { return predicate(value, index, this) }) } @@ -420,7 +420,7 @@ export class RegExpResultArray /*extends Array*/ { * Calls the callback function for all elements and accumulates the result. */ public reduce(callbackfn: (previousValue: String, currentValue: String, index: number, array: RegExpResultArray) => String): String { - return this.result_.reduce((previousValue: String, currentValue: String, index: number, array: Array) => { + return this.result_.reduce((previousValue: String, currentValue: String, index: int, array: Array) => { return callbackfn(previousValue, currentValue, index, this) }) } @@ -429,7 +429,7 @@ export class RegExpResultArray /*extends Array*/ { * Calls the callback function for all elements and accumulates the result. */ public reduce(callbackfn: (previousValue: U, currentValue: String, index: number, array: RegExpResultArray) => U, initialValue: U): U { - return this.result_.reduce((previousValue: U, currentValue: String, index: number, array: Array) => { + return this.result_.reduce((previousValue: U, currentValue: String, index: int, array: Array) => { return callbackfn(previousValue, currentValue, index, this) }, initialValue) } @@ -438,7 +438,7 @@ export class RegExpResultArray /*extends Array*/ { * Calls the callback function for all elements in descending order and accumulates the result. */ public reduceRight(callbackfn: (previousValue: U, currentValue: String, index: number, array: RegExpResultArray) => U, initialValue: U): U { - return this.result_.reduceRight((previousValue: U, currentValue: String, index: number, array: Array) => { + return this.result_.reduceRight((previousValue: U, currentValue: String, index: int, array: Array) => { return callbackfn(previousValue, currentValue, index, this) }, initialValue) } @@ -447,7 +447,7 @@ export class RegExpResultArray /*extends Array*/ { * Calls the callback function for all elements in descending order and accumulates the result. */ public reduceRight(callbackfn: (previousValue: String, currentValue: String, index: number, array: RegExpResultArray) => String): String { - return this.result_.reduceRight((previousValue: String, currentValue: String, index: number, array: Array) => { + return this.result_.reduceRight((previousValue: String, currentValue: String, index: int, array: Array) => { return callbackfn(previousValue, currentValue, index, this) }) } @@ -456,7 +456,7 @@ export class RegExpResultArray /*extends Array*/ { * Performs the specified action for each element. */ public forEach(callbackfn: (value: String, index: number, array: RegExpResultArray) => void): void { - this.result_.forEach((value: String, index: number, array: Array) => { + this.result_.forEach((value: String, index: int, array: Array) => { callbackfn(value, index, this) }) } @@ -720,7 +720,7 @@ export class RegExpResultArray /*extends Array*/ { * Calls a callback function on each element and returns an array with the results. */ public map(callbackfn: (value: String, index: number, array: RegExpResultArray) => U): Array { - return this.result_.map((value: String, index: number, array: Array) => { + return this.result_.map((value: String, index: int, array: Array) => { return callbackfn(value, index, this) }) } diff --git a/static_core/plugins/ets/stdlib/escompat/json.ets b/static_core/plugins/ets/stdlib/escompat/json.ets index f1edd9ea51b14a181a44ab3c993bf33aa24ba75c..b1b37e04791a292cb3608699940ea606ea6e2664 100644 --- a/static_core/plugins/ets/stdlib/escompat/json.ets +++ b/static_core/plugins/ets/stdlib/escompat/json.ets @@ -1070,13 +1070,11 @@ class JSONWriter { } private checkSameRename(field: Field, fields: Array<[Field, reflect.Value]>): boolean { - return fields.some((value: [Field, reflect.Value], index: number, array:Array<[Field, reflect.Value]>) - => {return value[0].getName() == field.getName()}); + return fields.some((value, index, array) => value[0].getName() == field.getName()); } private findKeyIndex(field: Field, fields: Array<[Field, reflect.Value]>): number { - return fields.findIndex((value: [Field, reflect.Value], index: number, array:Array<[Field, reflect.Value]>) - => {return value[0].getName() == field.getName()}); + return fields.findIndex((value, index, array) => value[0].getName() == field.getName()); } private getWritableFields(classType: ClassType, classValue: ClassValue): Array<[Field, reflect.Value]> { diff --git a/static_core/plugins/ets/stdlib/escompat/taskpool.ets b/static_core/plugins/ets/stdlib/escompat/taskpool.ets index b8a0048c108f5ef3d1ec2cb0d729ab20b1830165..3265a567a9230ed9f9c99dd80756509ece7b612a 100644 --- a/static_core/plugins/ets/stdlib/escompat/taskpool.ets +++ b/static_core/plugins/ets/stdlib/escompat/taskpool.ets @@ -1340,10 +1340,10 @@ export namespace taskpool { const Info: TaskPoolInfo = new TaskPoolInfo(); const taskInfosRes: TaskInfo[] = new TaskInfo[taskInfos.length.toInt()]; const threadInfosRes: ThreadInfo[] = new ThreadInfo[threadInfos.length.toInt()]; - taskInfos.forEach((taskInfo: TaskInfo, index: number) => { + taskInfos.forEach((taskInfo: TaskInfo, index: int) => { taskInfosRes[index.toInt()] = taskInfo; }); - threadInfos.forEach((threadInfo: ThreadInfo, index: number) => { + threadInfos.forEach((threadInfo: ThreadInfo, index: int) => { threadInfosRes[index.toInt()] = threadInfo; }); Info.taskInfos = taskInfosRes; diff --git a/static_core/plugins/ets/stdlib/std/core/BuiltinArray.ets b/static_core/plugins/ets/stdlib/std/core/BuiltinArray.ets index 2816b2e2fd845f5c326b0d945ed230c07fc016e9..7fd159f004d9193ba2c2d50a2a68c77ab974af67 100644 --- a/static_core/plugins/ets/stdlib/std/core/BuiltinArray.ets +++ b/static_core/plugins/ets/stdlib/std/core/BuiltinArray.ets @@ -251,7 +251,7 @@ export function fill(self: FixedArray, value: boolean, start: int, end: * * @returns the value of the first element in the array or undefined */ -export function find(self: FixedArray, predicate: (value: boolean, index: number, array: FixedArray) => boolean): Boolean | undefined { +export function find(self: FixedArray, predicate: (value: boolean, index: int, array: FixedArray) => boolean): Boolean | undefined { const res = findIndex(self, predicate) if (res == -1) { return undefined @@ -269,9 +269,9 @@ export function find(self: FixedArray, predicate: (value: boolean, inde * * @returns found element index or -1 otherwise */ -export function findIndex(self: FixedArray, predicate: (value: boolean, index: number, array: FixedArray) => boolean): number { +export function findIndex(self: FixedArray, predicate: (value: boolean, index: int, array: FixedArray) => boolean): number { for (let i = 0; i < self.length; i++) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return i; } } @@ -286,10 +286,10 @@ export function findIndex(self: FixedArray, predicate: (value: boolean, * * @returns found element or undefined otherwise */ -export function findLast(self: FixedArray, predicate: (elem: boolean, index: number, array: FixedArray) => boolean): Boolean | undefined { +export function findLast(self: FixedArray, predicate: (elem: boolean, index: int, array: FixedArray) => boolean): Boolean | undefined { for (let i = self.length - 1; i >= 0; i--) { const val = self[i]; - if (predicate(val, i.toDouble(), self)) { + if (predicate(val, i, self)) { return val; } } @@ -305,9 +305,9 @@ export function findLast(self: FixedArray, predicate: (elem: boolean, i * * @returns `true` if `predicate` returns a `true` value for every array element. Otherwise, `false`. */ -export function every(self: FixedArray, predicate: (value: boolean, index: number, array: FixedArray) => boolean): boolean { +export function every(self: FixedArray, predicate: (value: boolean, index: int, array: FixedArray) => boolean): boolean { for (let i = 0; i < self.length; i++) { - if (!predicate(self[i], i.toDouble(), self)) { + if (!predicate(self[i], i, self)) { return false } } @@ -323,9 +323,9 @@ export function every(self: FixedArray, predicate: (value: boolean, ind * * @returns `true` if `predicate` returns a `true` value for at least one array element. Otherwise, `false`. */ -export function some(self: FixedArray, predicate: (value: boolean, index: number, array: FixedArray) => boolean): boolean { +export function some(self: FixedArray, predicate: (value: boolean, index: int, array: FixedArray) => boolean): boolean { for (let i = 0; i < self.length; i++) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return true } } @@ -341,9 +341,9 @@ export function some(self: FixedArray, predicate: (value: boolean, inde * * @returns index of first element satisfying to predicate, -1 if no such element */ -export function findLastIndex(self: FixedArray, predicate: (element: boolean, index: number, array: FixedArray) => boolean): number { +export function findLastIndex(self: FixedArray, predicate: (element: boolean, index: int, array: FixedArray) => boolean): number { for (let i = self.length - 1; i >= 0; i--) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return i } } @@ -357,13 +357,13 @@ export function findLastIndex(self: FixedArray, predicate: (element: bo * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduce(self: FixedArray, callbackfn: (previousValue: boolean, currentValue: boolean, index: number, array: FixedArray) => boolean): boolean { +export function reduce(self: FixedArray, callbackfn: (previousValue: boolean, currentValue: boolean, index: int, array: FixedArray) => boolean): boolean { if (self.length == 0) { throw new TypeError("Reduce of empty array with no initial value") } let acc: boolean = self[0]; for (let i = 1; i < self.length; i++) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -377,10 +377,10 @@ export function reduce(self: FixedArray, callbackfn: (previousValue: bo * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduce(self: FixedArray, callbackfn: (previousValue: U, currentValue: boolean, index: number, array: FixedArray) => U, initialValue: U): U { +export function reduce(self: FixedArray, callbackfn: (previousValue: U, currentValue: boolean, index: int, array: FixedArray) => U, initialValue: U): U { let acc = initialValue for (let i = 0; i < self.length; i++) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -394,10 +394,10 @@ export function reduce(self: FixedArray, callbackfn: (prev * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduceRight(self: FixedArray, callbackfn: (previousValue: U, currentValue: boolean, index: number, array: FixedArray) => U, initialValue: U): U { +export function reduceRight(self: FixedArray, callbackfn: (previousValue: U, currentValue: boolean, index: int, array: FixedArray) => U, initialValue: U): U { let acc = initialValue for (let i = self.length - 1; i >= 0; i--) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -407,13 +407,13 @@ export function reduceRight(self: FixedArray, callbackfn: (previousV * * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. */ -export function forEach(self: FixedArray, callbackfn: (value: boolean, index: number, array: FixedArray) => void): void { +export function forEach(self: FixedArray, callbackfn: (value: boolean, index: int, array: FixedArray) => void): void { const len0 = self.length; for (let i = 0; i < len0; i++) { if (i >= self.length) { break } - callbackfn(self[i], i.toDouble(), self) + callbackfn(self[i], i, self) } } @@ -805,11 +805,11 @@ export function entries(self: FixedArray): IterableIterator<[number, bo * * @returns `Array` instance, constructed from `this` and given function. */ -export function map(self: FixedArray, callbackfn: (value: boolean, index: number, array: FixedArray) => boolean): FixedArray { +export function map(self: FixedArray, callbackfn: (value: boolean, index: int, array: FixedArray) => boolean): FixedArray { const len = self.length; let res : FixedArray = new boolean[len]; for (let i = 0; i < len; i++) { - res[i] = callbackfn(self[i], i.toDouble(), self); + res[i] = callbackfn(self[i], i, self); } return res; } @@ -821,13 +821,13 @@ export function map(self: FixedArray, callbackfn: (value: boolean, inde * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduceRight(self: FixedArray, callbackfn: (previousValue: boolean, currentValue: boolean, index: number, array: FixedArray) => boolean): boolean { +export function reduceRight(self: FixedArray, callbackfn: (previousValue: boolean, currentValue: boolean, index: int, array: FixedArray) => boolean): boolean { if (self.length == 0) { throw new TypeError("Reduce of empty array with no initial value") } let acc: boolean = self[self.length - 1]; for (let i = self.length - 2; i >= 0; i--) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -1177,7 +1177,7 @@ export function fill(self: FixedArray, value: byte, start: int, end: int): * * @returns the value of the first element in the array or undefined */ -export function find(self: FixedArray, predicate: (value: byte, index: number, array: FixedArray) => boolean): Byte | undefined { +export function find(self: FixedArray, predicate: (value: byte, index: int, array: FixedArray) => boolean): Byte | undefined { const res = findIndex(self, predicate) if (res == -1) { return undefined @@ -1195,9 +1195,9 @@ export function find(self: FixedArray, predicate: (value: byte, index: num * * @returns found element index or -1 otherwise */ -export function findIndex(self: FixedArray, predicate: (value: byte, index: number, array: FixedArray) => boolean): number { +export function findIndex(self: FixedArray, predicate: (value: byte, index: int, array: FixedArray) => boolean): number { for (let i = 0; i < self.length; i++) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return i; } } @@ -1212,10 +1212,10 @@ export function findIndex(self: FixedArray, predicate: (value: byte, index * * @returns found element or undefined otherwise */ -export function findLast(self: FixedArray, predicate: (elem: byte, index: number, array: FixedArray) => boolean): Byte | undefined { +export function findLast(self: FixedArray, predicate: (elem: byte, index: int, array: FixedArray) => boolean): Byte | undefined { for (let i = self.length - 1; i >= 0; i--) { const val = self[i]; - if (predicate(val, i.toDouble(), self)) { + if (predicate(val, i, self)) { return val; } } @@ -1231,9 +1231,9 @@ export function findLast(self: FixedArray, predicate: (elem: byte, index: * * @returns `true` if `predicate` returns a `true` value for every array element. Otherwise, `false`. */ -export function every(self: FixedArray, predicate: (value: byte, index: number, array: FixedArray) => boolean): boolean { +export function every(self: FixedArray, predicate: (value: byte, index: int, array: FixedArray) => boolean): boolean { for (let i = 0; i < self.length; i++) { - if (!predicate(self[i], i.toDouble(), self)) { + if (!predicate(self[i], i, self)) { return false } } @@ -1249,9 +1249,9 @@ export function every(self: FixedArray, predicate: (value: byte, index: nu * * @returns `true` if `predicate` returns a `true` value for at least one array element. Otherwise, `false`. */ -export function some(self: FixedArray, predicate: (value: byte, index: number, array: FixedArray) => boolean): boolean { +export function some(self: FixedArray, predicate: (value: byte, index: int, array: FixedArray) => boolean): boolean { for (let i = 0; i < self.length; i++) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return true } } @@ -1267,9 +1267,9 @@ export function some(self: FixedArray, predicate: (value: byte, index: num * * @returns index of first element satisfying to predicate, -1 if no such element */ -export function findLastIndex(self: FixedArray, predicate: (element: byte, index: number, array: FixedArray) => boolean): number { +export function findLastIndex(self: FixedArray, predicate: (element: byte, index: int, array: FixedArray) => boolean): number { for (let i = self.length - 1; i >= 0; i--) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return i } } @@ -1283,13 +1283,13 @@ export function findLastIndex(self: FixedArray, predicate: (element: byte, * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduce(self: FixedArray, callbackfn: (previousValue: byte, currentValue: byte, index: number, array: FixedArray) => byte): byte { +export function reduce(self: FixedArray, callbackfn: (previousValue: byte, currentValue: byte, index: int, array: FixedArray) => byte): byte { if (self.length == 0) { throw new TypeError("Reduce of empty array with no initial value") } let acc: byte = self[0]; for (let i = 1; i < self.length; i++) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -1303,10 +1303,10 @@ export function reduce(self: FixedArray, callbackfn: (previousValue: byte, * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduce(self: FixedArray, callbackfn: (previousValue: U, currentValue: byte, index: number, array: FixedArray) => U, initialValue: U): U { +export function reduce(self: FixedArray, callbackfn: (previousValue: U, currentValue: byte, index: int, array: FixedArray) => U, initialValue: U): U { let acc = initialValue for (let i = 0; i < self.length; i++) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -1320,10 +1320,10 @@ export function reduce(self: FixedArray, callbackfn: (previousVa * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduceRight(self: FixedArray, callbackfn: (previousValue: U, currentValue: byte, index: number, array: FixedArray) => U, initialValue: U): U { +export function reduceRight(self: FixedArray, callbackfn: (previousValue: U, currentValue: byte, index: int, array: FixedArray) => U, initialValue: U): U { let acc = initialValue for (let i = self.length - 1; i >= 0; i--) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -1333,13 +1333,13 @@ export function reduceRight(self: FixedArray, callbackfn: (previousValu * * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. */ -export function forEach(self: FixedArray, callbackfn: (value: byte, index: number, array: FixedArray) => void): void { +export function forEach(self: FixedArray, callbackfn: (value: byte, index: int, array: FixedArray) => void): void { const len0 = self.length; for (let i = 0; i < len0; i++) { if (i >= self.length) { break } - callbackfn(self[i], i.toDouble(), self) + callbackfn(self[i], i, self) } } @@ -1731,11 +1731,11 @@ export function entries(self: FixedArray): IterableIterator<[number, byte] * * @returns `Array` instance, constructed from `this` and given function. */ -export function map(self: FixedArray, callbackfn: (value: byte, index: number, array: FixedArray) => byte): FixedArray { +export function map(self: FixedArray, callbackfn: (value: byte, index: int, array: FixedArray) => byte): FixedArray { const len = self.length; let res : FixedArray = new byte[len]; for (let i = 0; i < len; i++) { - res[i] = callbackfn(self[i], i.toDouble(), self); + res[i] = callbackfn(self[i], i, self); } return res; } @@ -1747,13 +1747,13 @@ export function map(self: FixedArray, callbackfn: (value: byte, index: num * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduceRight(self: FixedArray, callbackfn: (previousValue: byte, currentValue: byte, index: number, array: FixedArray) => byte): byte { +export function reduceRight(self: FixedArray, callbackfn: (previousValue: byte, currentValue: byte, index: int, array: FixedArray) => byte): byte { if (self.length == 0) { throw new TypeError("Reduce of empty array with no initial value") } let acc: byte = self[self.length - 1]; for (let i = self.length - 2; i >= 0; i--) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -2103,7 +2103,7 @@ export function fill(self: FixedArray, value: short, start: int, end: int * * @returns the value of the first element in the array or undefined */ -export function find(self: FixedArray, predicate: (value: short, index: number, array: FixedArray) => boolean): Short | undefined { +export function find(self: FixedArray, predicate: (value: short, index: int, array: FixedArray) => boolean): Short | undefined { const res = findIndex(self, predicate) if (res == -1) { return undefined @@ -2121,9 +2121,9 @@ export function find(self: FixedArray, predicate: (value: short, index: n * * @returns found element index or -1 otherwise */ -export function findIndex(self: FixedArray, predicate: (value: short, index: number, array: FixedArray) => boolean): number { +export function findIndex(self: FixedArray, predicate: (value: short, index: int, array: FixedArray) => boolean): number { for (let i = 0; i < self.length; i++) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return i; } } @@ -2138,10 +2138,10 @@ export function findIndex(self: FixedArray, predicate: (value: short, ind * * @returns found element or undefined otherwise */ -export function findLast(self: FixedArray, predicate: (elem: short, index: number, array: FixedArray) => boolean): Short | undefined { +export function findLast(self: FixedArray, predicate: (elem: short, index: int, array: FixedArray) => boolean): Short | undefined { for (let i = self.length - 1; i >= 0; i--) { const val = self[i]; - if (predicate(val, i.toDouble(), self)) { + if (predicate(val, i, self)) { return val; } } @@ -2157,9 +2157,9 @@ export function findLast(self: FixedArray, predicate: (elem: short, index * * @returns `true` if `predicate` returns a `true` value for every array element. Otherwise, `false`. */ -export function every(self: FixedArray, predicate: (value: short, index: number, array: FixedArray) => boolean): boolean { +export function every(self: FixedArray, predicate: (value: short, index: int, array: FixedArray) => boolean): boolean { for (let i = 0; i < self.length; i++) { - if (!predicate(self[i], i.toDouble(), self)) { + if (!predicate(self[i], i, self)) { return false } } @@ -2175,9 +2175,9 @@ export function every(self: FixedArray, predicate: (value: short, index: * * @returns `true` if `predicate` returns a `true` value for at least one array element. Otherwise, `false`. */ -export function some(self: FixedArray, predicate: (value: short, index: number, array: FixedArray) => boolean): boolean { +export function some(self: FixedArray, predicate: (value: short, index: int, array: FixedArray) => boolean): boolean { for (let i = 0; i < self.length; i++) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return true } } @@ -2193,9 +2193,9 @@ export function some(self: FixedArray, predicate: (value: short, index: n * * @returns index of first element satisfying to predicate, -1 if no such element */ -export function findLastIndex(self: FixedArray, predicate: (element: short, index: number, array: FixedArray) => boolean): number { +export function findLastIndex(self: FixedArray, predicate: (element: short, index: int, array: FixedArray) => boolean): number { for (let i = self.length - 1; i >= 0; i--) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return i } } @@ -2209,13 +2209,13 @@ export function findLastIndex(self: FixedArray, predicate: (element: shor * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduce(self: FixedArray, callbackfn: (previousValue: short, currentValue: short, index: number, array: FixedArray) => short): short { +export function reduce(self: FixedArray, callbackfn: (previousValue: short, currentValue: short, index: int, array: FixedArray) => short): short { if (self.length == 0) { throw new TypeError("Reduce of empty array with no initial value") } let acc: short = self[0]; for (let i = 1; i < self.length; i++) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -2229,10 +2229,10 @@ export function reduce(self: FixedArray, callbackfn: (previousValue: shor * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduce(self: FixedArray, callbackfn: (previousValue: U, currentValue: short, index: number, array: FixedArray) => U, initialValue: U): U { +export function reduce(self: FixedArray, callbackfn: (previousValue: U, currentValue: short, index: int, array: FixedArray) => U, initialValue: U): U { let acc = initialValue for (let i = 0; i < self.length; i++) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -2246,10 +2246,10 @@ export function reduce(self: FixedArray, callbackfn: (previous * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduceRight(self: FixedArray, callbackfn: (previousValue: U, currentValue: short, index: number, array: FixedArray) => U, initialValue: U): U { +export function reduceRight(self: FixedArray, callbackfn: (previousValue: U, currentValue: short, index: int, array: FixedArray) => U, initialValue: U): U { let acc = initialValue for (let i = self.length - 1; i >= 0; i--) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -2259,13 +2259,13 @@ export function reduceRight(self: FixedArray, callbackfn: (previousVal * * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. */ -export function forEach(self: FixedArray, callbackfn: (value: short, index: number, array: FixedArray) => void): void { +export function forEach(self: FixedArray, callbackfn: (value: short, index: int, array: FixedArray) => void): void { const len0 = self.length; for (let i = 0; i < len0; i++) { if (i >= self.length) { break } - callbackfn(self[i], i.toDouble(), self) + callbackfn(self[i], i, self) } } @@ -2657,11 +2657,11 @@ export function entries(self: FixedArray): IterableIterator<[number, shor * * @returns `Array` instance, constructed from `this` and given function. */ -export function map(self: FixedArray, callbackfn: (value: short, index: number, array: FixedArray) => short): FixedArray { +export function map(self: FixedArray, callbackfn: (value: short, index: int, array: FixedArray) => short): FixedArray { const len = self.length; let res : FixedArray = new short[len]; for (let i = 0; i < len; i++) { - res[i] = callbackfn(self[i], i.toDouble(), self); + res[i] = callbackfn(self[i], i, self); } return res; } @@ -2673,13 +2673,13 @@ export function map(self: FixedArray, callbackfn: (value: short, index: n * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduceRight(self: FixedArray, callbackfn: (previousValue: short, currentValue: short, index: number, array: FixedArray) => short): short { +export function reduceRight(self: FixedArray, callbackfn: (previousValue: short, currentValue: short, index: int, array: FixedArray) => short): short { if (self.length == 0) { throw new TypeError("Reduce of empty array with no initial value") } let acc: short = self[self.length - 1]; for (let i = self.length - 2; i >= 0; i--) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -3029,7 +3029,7 @@ export function fill(self: FixedArray, value: int, start: int, end: int): F * * @returns the value of the first element in the array or undefined */ -export function find(self: FixedArray, predicate: (value: int, index: number, array: FixedArray) => boolean): Int | undefined { +export function find(self: FixedArray, predicate: (value: int, index: int, array: FixedArray) => boolean): Int | undefined { const res = findIndex(self, predicate) if (res == -1) { return undefined @@ -3047,9 +3047,9 @@ export function find(self: FixedArray, predicate: (value: int, index: numbe * * @returns found element index or -1 otherwise */ -export function findIndex(self: FixedArray, predicate: (value: int, index: number, array: FixedArray) => boolean): number { +export function findIndex(self: FixedArray, predicate: (value: int, index: int, array: FixedArray) => boolean): number { for (let i = 0; i < self.length; i++) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return i; } } @@ -3064,10 +3064,10 @@ export function findIndex(self: FixedArray, predicate: (value: int, index: * * @returns found element or undefined otherwise */ -export function findLast(self: FixedArray, predicate: (elem: int, index: number, array: FixedArray) => boolean): Int | undefined { +export function findLast(self: FixedArray, predicate: (elem: int, index: int, array: FixedArray) => boolean): Int | undefined { for (let i = self.length - 1; i >= 0; i--) { const val = self[i]; - if (predicate(val, i.toDouble(), self)) { + if (predicate(val, i, self)) { return val; } } @@ -3083,9 +3083,9 @@ export function findLast(self: FixedArray, predicate: (elem: int, index: nu * * @returns `true` if `predicate` returns a `true` value for every array element. Otherwise, `false`. */ -export function every(self: FixedArray, predicate: (value: int, index: number, array: FixedArray) => boolean): boolean { +export function every(self: FixedArray, predicate: (value: int, index: int, array: FixedArray) => boolean): boolean { for (let i = 0; i < self.length; i++) { - if (!predicate(self[i], i.toDouble(), self)) { + if (!predicate(self[i], i, self)) { return false } } @@ -3101,9 +3101,9 @@ export function every(self: FixedArray, predicate: (value: int, index: numb * * @returns `true` if `predicate` returns a `true` value for at least one array element. Otherwise, `false`. */ -export function some(self: FixedArray, predicate: (value: int, index: number, array: FixedArray) => boolean): boolean { +export function some(self: FixedArray, predicate: (value: int, index: int, array: FixedArray) => boolean): boolean { for (let i = 0; i < self.length; i++) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return true } } @@ -3119,9 +3119,9 @@ export function some(self: FixedArray, predicate: (value: int, index: numbe * * @returns index of first element satisfying to predicate, -1 if no such element */ -export function findLastIndex(self: FixedArray, predicate: (element: int, index: number, array: FixedArray) => boolean): number { +export function findLastIndex(self: FixedArray, predicate: (element: int, index: int, array: FixedArray) => boolean): number { for (let i = self.length - 1; i >= 0; i--) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return i } } @@ -3135,13 +3135,13 @@ export function findLastIndex(self: FixedArray, predicate: (element: int, i * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduce(self: FixedArray, callbackfn: (previousValue: int, currentValue: int, index: number, array: FixedArray) => int): int { +export function reduce(self: FixedArray, callbackfn: (previousValue: int, currentValue: int, index: int, array: FixedArray) => int): int { if (self.length == 0) { throw new TypeError("Reduce of empty array with no initial value") } let acc: int = self[0]; for (let i = 1; i < self.length; i++) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -3155,10 +3155,10 @@ export function reduce(self: FixedArray, callbackfn: (previousValue: int, c * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduce(self: FixedArray, callbackfn: (previousValue: U, currentValue: int, index: number, array: FixedArray) => U, initialValue: U): U { +export function reduce(self: FixedArray, callbackfn: (previousValue: U, currentValue: int, index: int, array: FixedArray) => U, initialValue: U): U { let acc = initialValue for (let i = 0; i < self.length; i++) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -3172,10 +3172,10 @@ export function reduce(self: FixedArray, callbackfn: (previousValu * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduceRight(self: FixedArray, callbackfn: (previousValue: U, currentValue: int, index: number, array: FixedArray) => U, initialValue: U): U { +export function reduceRight(self: FixedArray, callbackfn: (previousValue: U, currentValue: int, index: int, array: FixedArray) => U, initialValue: U): U { let acc = initialValue for (let i = self.length - 1; i >= 0; i--) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -3185,13 +3185,13 @@ export function reduceRight(self: FixedArray, callbackfn: (previousValue * * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. */ -export function forEach(self: FixedArray, callbackfn: (value: int, index: number, array: FixedArray) => void): void { +export function forEach(self: FixedArray, callbackfn: (value: int, index: int, array: FixedArray) => void): void { const len0 = self.length; for (let i = 0; i < len0; i++) { if (i >= self.length) { break } - callbackfn(self[i], i.toDouble(), self) + callbackfn(self[i], i, self) } } @@ -3583,11 +3583,11 @@ export function entries(self: FixedArray): IterableIterator<[number, int]> * * @returns `Array` instance, constructed from `this` and given function. */ -export function map(self: FixedArray, callbackfn: (value: int, index: number, array: FixedArray) => int): FixedArray { +export function map(self: FixedArray, callbackfn: (value: int, index: int, array: FixedArray) => int): FixedArray { const len = self.length; let res : FixedArray = new int[len]; for (let i = 0; i < len; i++) { - res[i] = callbackfn(self[i], i.toDouble(), self); + res[i] = callbackfn(self[i], i, self); } return res; } @@ -3599,13 +3599,13 @@ export function map(self: FixedArray, callbackfn: (value: int, index: numbe * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduceRight(self: FixedArray, callbackfn: (previousValue: int, currentValue: int, index: number, array: FixedArray) => int): int { +export function reduceRight(self: FixedArray, callbackfn: (previousValue: int, currentValue: int, index: int, array: FixedArray) => int): int { if (self.length == 0) { throw new TypeError("Reduce of empty array with no initial value") } let acc: int = self[self.length - 1]; for (let i = self.length - 2; i >= 0; i--) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -3955,7 +3955,7 @@ export function fill(self: FixedArray, value: long, start: int, end: int): * * @returns the value of the first element in the array or undefined */ -export function find(self: FixedArray, predicate: (value: long, index: number, array: FixedArray) => boolean): Long | undefined { +export function find(self: FixedArray, predicate: (value: long, index: int, array: FixedArray) => boolean): Long | undefined { const res = findIndex(self, predicate) if (res == -1) { return undefined @@ -3973,9 +3973,9 @@ export function find(self: FixedArray, predicate: (value: long, index: num * * @returns found element index or -1 otherwise */ -export function findIndex(self: FixedArray, predicate: (value: long, index: number, array: FixedArray) => boolean): number { +export function findIndex(self: FixedArray, predicate: (value: long, index: int, array: FixedArray) => boolean): number { for (let i = 0; i < self.length; i++) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return i; } } @@ -3990,10 +3990,10 @@ export function findIndex(self: FixedArray, predicate: (value: long, index * * @returns found element or undefined otherwise */ -export function findLast(self: FixedArray, predicate: (elem: long, index: number, array: FixedArray) => boolean): Long | undefined { +export function findLast(self: FixedArray, predicate: (elem: long, index: int, array: FixedArray) => boolean): Long | undefined { for (let i = self.length - 1; i >= 0; i--) { const val = self[i]; - if (predicate(val, i.toDouble(), self)) { + if (predicate(val, i, self)) { return val; } } @@ -4009,9 +4009,9 @@ export function findLast(self: FixedArray, predicate: (elem: long, index: * * @returns `true` if `predicate` returns a `true` value for every array element. Otherwise, `false`. */ -export function every(self: FixedArray, predicate: (value: long, index: number, array: FixedArray) => boolean): boolean { +export function every(self: FixedArray, predicate: (value: long, index: int, array: FixedArray) => boolean): boolean { for (let i = 0; i < self.length; i++) { - if (!predicate(self[i], i.toDouble(), self)) { + if (!predicate(self[i], i, self)) { return false } } @@ -4027,9 +4027,9 @@ export function every(self: FixedArray, predicate: (value: long, index: nu * * @returns `true` if `predicate` returns a `true` value for at least one array element. Otherwise, `false`. */ -export function some(self: FixedArray, predicate: (value: long, index: number, array: FixedArray) => boolean): boolean { +export function some(self: FixedArray, predicate: (value: long, index: int, array: FixedArray) => boolean): boolean { for (let i = 0; i < self.length; i++) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return true } } @@ -4045,9 +4045,9 @@ export function some(self: FixedArray, predicate: (value: long, index: num * * @returns index of first element satisfying to predicate, -1 if no such element */ -export function findLastIndex(self: FixedArray, predicate: (element: long, index: number, array: FixedArray) => boolean): number { +export function findLastIndex(self: FixedArray, predicate: (element: long, index: int, array: FixedArray) => boolean): number { for (let i = self.length - 1; i >= 0; i--) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return i } } @@ -4061,13 +4061,13 @@ export function findLastIndex(self: FixedArray, predicate: (element: long, * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduce(self: FixedArray, callbackfn: (previousValue: long, currentValue: long, index: number, array: FixedArray) => long): long { +export function reduce(self: FixedArray, callbackfn: (previousValue: long, currentValue: long, index: int, array: FixedArray) => long): long { if (self.length == 0) { throw new TypeError("Reduce of empty array with no initial value") } let acc: long = self[0]; for (let i = 1; i < self.length; i++) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -4081,10 +4081,10 @@ export function reduce(self: FixedArray, callbackfn: (previousValue: long, * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduce(self: FixedArray, callbackfn: (previousValue: U, currentValue: long, index: number, array: FixedArray) => U, initialValue: U): U { +export function reduce(self: FixedArray, callbackfn: (previousValue: U, currentValue: long, index: int, array: FixedArray) => U, initialValue: U): U { let acc = initialValue for (let i = 0; i < self.length; i++) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -4098,10 +4098,10 @@ export function reduce(self: FixedArray, callbackfn: (previousVa * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduceRight(self: FixedArray, callbackfn: (previousValue: U, currentValue: long, index: number, array: FixedArray) => U, initialValue: U): U { +export function reduceRight(self: FixedArray, callbackfn: (previousValue: U, currentValue: long, index: int, array: FixedArray) => U, initialValue: U): U { let acc = initialValue for (let i = self.length - 1; i >= 0; i--) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -4111,13 +4111,13 @@ export function reduceRight(self: FixedArray, callbackfn: (previousValu * * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. */ -export function forEach(self: FixedArray, callbackfn: (value: long, index: number, array: FixedArray) => void): void { +export function forEach(self: FixedArray, callbackfn: (value: long, index: int, array: FixedArray) => void): void { const len0 = self.length; for (let i = 0; i < len0; i++) { if (i >= self.length) { break } - callbackfn(self[i], i.toDouble(), self) + callbackfn(self[i], i, self) } } @@ -4509,11 +4509,11 @@ export function entries(self: FixedArray): IterableIterator<[number, long] * * @returns `Array` instance, constructed from `this` and given function. */ -export function map(self: FixedArray, callbackfn: (value: long, index: number, array: FixedArray) => long): FixedArray { +export function map(self: FixedArray, callbackfn: (value: long, index: int, array: FixedArray) => long): FixedArray { const len = self.length; let res : FixedArray = new long[len]; for (let i = 0; i < len; i++) { - res[i] = callbackfn(self[i], i.toDouble(), self); + res[i] = callbackfn(self[i], i, self); } return res; } @@ -4525,13 +4525,13 @@ export function map(self: FixedArray, callbackfn: (value: long, index: num * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduceRight(self: FixedArray, callbackfn: (previousValue: long, currentValue: long, index: number, array: FixedArray) => long): long { +export function reduceRight(self: FixedArray, callbackfn: (previousValue: long, currentValue: long, index: int, array: FixedArray) => long): long { if (self.length == 0) { throw new TypeError("Reduce of empty array with no initial value") } let acc: long = self[self.length - 1]; for (let i = self.length - 2; i >= 0; i--) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -4881,7 +4881,7 @@ export function fill(self: FixedArray, value: float, start: int, end: int * * @returns the value of the first element in the array or undefined */ -export function find(self: FixedArray, predicate: (value: float, index: number, array: FixedArray) => boolean): Float | undefined { +export function find(self: FixedArray, predicate: (value: float, index: int, array: FixedArray) => boolean): Float | undefined { const res = findIndex(self, predicate) if (res == -1) { return undefined @@ -4899,9 +4899,9 @@ export function find(self: FixedArray, predicate: (value: float, index: n * * @returns found element index or -1 otherwise */ -export function findIndex(self: FixedArray, predicate: (value: float, index: number, array: FixedArray) => boolean): number { +export function findIndex(self: FixedArray, predicate: (value: float, index: int, array: FixedArray) => boolean): number { for (let i = 0; i < self.length; i++) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return i; } } @@ -4916,10 +4916,10 @@ export function findIndex(self: FixedArray, predicate: (value: float, ind * * @returns found element or undefined otherwise */ -export function findLast(self: FixedArray, predicate: (elem: float, index: number, array: FixedArray) => boolean): Float | undefined { +export function findLast(self: FixedArray, predicate: (elem: float, index: int, array: FixedArray) => boolean): Float | undefined { for (let i = self.length - 1; i >= 0; i--) { const val = self[i]; - if (predicate(val, i.toDouble(), self)) { + if (predicate(val, i, self)) { return val; } } @@ -4935,9 +4935,9 @@ export function findLast(self: FixedArray, predicate: (elem: float, index * * @returns `true` if `predicate` returns a `true` value for every array element. Otherwise, `false`. */ -export function every(self: FixedArray, predicate: (value: float, index: number, array: FixedArray) => boolean): boolean { +export function every(self: FixedArray, predicate: (value: float, index: int, array: FixedArray) => boolean): boolean { for (let i = 0; i < self.length; i++) { - if (!predicate(self[i], i.toDouble(), self)) { + if (!predicate(self[i], i, self)) { return false } } @@ -4953,9 +4953,9 @@ export function every(self: FixedArray, predicate: (value: float, index: * * @returns `true` if `predicate` returns a `true` value for at least one array element. Otherwise, `false`. */ -export function some(self: FixedArray, predicate: (value: float, index: number, array: FixedArray) => boolean): boolean { +export function some(self: FixedArray, predicate: (value: float, index: int, array: FixedArray) => boolean): boolean { for (let i = 0; i < self.length; i++) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return true } } @@ -4971,9 +4971,9 @@ export function some(self: FixedArray, predicate: (value: float, index: n * * @returns index of first element satisfying to predicate, -1 if no such element */ -export function findLastIndex(self: FixedArray, predicate: (element: float, index: number, array: FixedArray) => boolean): number { +export function findLastIndex(self: FixedArray, predicate: (element: float, index: int, array: FixedArray) => boolean): number { for (let i = self.length - 1; i >= 0; i--) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return i } } @@ -4987,13 +4987,13 @@ export function findLastIndex(self: FixedArray, predicate: (element: floa * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduce(self: FixedArray, callbackfn: (previousValue: float, currentValue: float, index: number, array: FixedArray) => float): float { +export function reduce(self: FixedArray, callbackfn: (previousValue: float, currentValue: float, index: int, array: FixedArray) => float): float { if (self.length == 0) { throw new TypeError("Reduce of empty array with no initial value") } let acc: float = self[0]; for (let i = 1; i < self.length; i++) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -5007,10 +5007,10 @@ export function reduce(self: FixedArray, callbackfn: (previousValue: floa * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduce(self: FixedArray, callbackfn: (previousValue: U, currentValue: float, index: number, array: FixedArray) => U, initialValue: U): U { +export function reduce(self: FixedArray, callbackfn: (previousValue: U, currentValue: float, index: int, array: FixedArray) => U, initialValue: U): U { let acc = initialValue for (let i = 0; i < self.length; i++) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -5024,10 +5024,10 @@ export function reduce(self: FixedArray, callbackfn: (previous * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduceRight(self: FixedArray, callbackfn: (previousValue: U, currentValue: float, index: number, array: FixedArray) => U, initialValue: U): U { +export function reduceRight(self: FixedArray, callbackfn: (previousValue: U, currentValue: float, index: int, array: FixedArray) => U, initialValue: U): U { let acc = initialValue for (let i = self.length - 1; i >= 0; i--) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -5037,13 +5037,13 @@ export function reduceRight(self: FixedArray, callbackfn: (previousVal * * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. */ -export function forEach(self: FixedArray, callbackfn: (value: float, index: number, array: FixedArray) => void): void { +export function forEach(self: FixedArray, callbackfn: (value: float, index: int, array: FixedArray) => void): void { const len0 = self.length; for (let i = 0; i < len0; i++) { if (i >= self.length) { break } - callbackfn(self[i], i.toDouble(), self) + callbackfn(self[i], i, self) } } @@ -5443,11 +5443,11 @@ export function entries(self: FixedArray): IterableIterator<[number, floa * * @returns `Array` instance, constructed from `this` and given function. */ -export function map(self: FixedArray, callbackfn: (value: float, index: number, array: FixedArray) => float): FixedArray { +export function map(self: FixedArray, callbackfn: (value: float, index: int, array: FixedArray) => float): FixedArray { const len = self.length; let res : FixedArray = new float[len]; for (let i = 0; i < len; i++) { - res[i] = callbackfn(self[i], i.toDouble(), self); + res[i] = callbackfn(self[i], i, self); } return res; } @@ -5459,13 +5459,13 @@ export function map(self: FixedArray, callbackfn: (value: float, index: n * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduceRight(self: FixedArray, callbackfn: (previousValue: float, currentValue: float, index: number, array: FixedArray) => float): float { +export function reduceRight(self: FixedArray, callbackfn: (previousValue: float, currentValue: float, index: int, array: FixedArray) => float): float { if (self.length == 0) { throw new TypeError("Reduce of empty array with no initial value") } let acc: float = self[self.length - 1]; for (let i = self.length - 2; i >= 0; i--) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -5815,7 +5815,7 @@ export function fill(self: FixedArray, value: double, start: int, end: i * * @returns the value of the first element in the array or undefined */ -export function find(self: FixedArray, predicate: (value: double, index: number, array: FixedArray) => boolean): Double | undefined { +export function find(self: FixedArray, predicate: (value: double, index: int, array: FixedArray) => boolean): Double | undefined { const res = findIndex(self, predicate) if (res == -1) { return undefined @@ -5833,9 +5833,9 @@ export function find(self: FixedArray, predicate: (value: double, index: * * @returns found element index or -1 otherwise */ -export function findIndex(self: FixedArray, predicate: (value: double, index: number, array: FixedArray) => boolean): number { +export function findIndex(self: FixedArray, predicate: (value: double, index: int, array: FixedArray) => boolean): number { for (let i = 0; i < self.length; i++) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return i; } } @@ -5850,10 +5850,10 @@ export function findIndex(self: FixedArray, predicate: (value: double, i * * @returns found element or undefined otherwise */ -export function findLast(self: FixedArray, predicate: (elem: double, index: number, array: FixedArray) => boolean): Double | undefined { +export function findLast(self: FixedArray, predicate: (elem: double, index: int, array: FixedArray) => boolean): Double | undefined { for (let i = self.length - 1; i >= 0; i--) { const val = self[i]; - if (predicate(val, i.toDouble(), self)) { + if (predicate(val, i, self)) { return val; } } @@ -5869,9 +5869,9 @@ export function findLast(self: FixedArray, predicate: (elem: double, ind * * @returns `true` if `predicate` returns a `true` value for every array element. Otherwise, `false`. */ -export function every(self: FixedArray, predicate: (value: double, index: number, array: FixedArray) => boolean): boolean { +export function every(self: FixedArray, predicate: (value: double, index: int, array: FixedArray) => boolean): boolean { for (let i = 0; i < self.length; i++) { - if (!predicate(self[i], i.toDouble(), self)) { + if (!predicate(self[i], i, self)) { return false } } @@ -5887,9 +5887,9 @@ export function every(self: FixedArray, predicate: (value: double, index * * @returns `true` if `predicate` returns a `true` value for at least one array element. Otherwise, `false`. */ -export function some(self: FixedArray, predicate: (value: double, index: number, array: FixedArray) => boolean): boolean { +export function some(self: FixedArray, predicate: (value: double, index: int, array: FixedArray) => boolean): boolean { for (let i = 0; i < self.length; i++) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return true } } @@ -5905,9 +5905,9 @@ export function some(self: FixedArray, predicate: (value: double, index: * * @returns index of first element satisfying to predicate, -1 if no such element */ -export function findLastIndex(self: FixedArray, predicate: (element: double, index: number, array: FixedArray) => boolean): number { +export function findLastIndex(self: FixedArray, predicate: (element: double, index: int, array: FixedArray) => boolean): number { for (let i = self.length - 1; i >= 0; i--) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return i } } @@ -5921,13 +5921,13 @@ export function findLastIndex(self: FixedArray, predicate: (element: dou * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduce(self: FixedArray, callbackfn: (previousValue: double, currentValue: double, index: number, array: FixedArray) => double): double { +export function reduce(self: FixedArray, callbackfn: (previousValue: double, currentValue: double, index: int, array: FixedArray) => double): double { if (self.length == 0) { throw new TypeError("Reduce of empty array with no initial value") } let acc: double = self[0]; for (let i = 1; i < self.length; i++) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -5941,10 +5941,10 @@ export function reduce(self: FixedArray, callbackfn: (previousValue: dou * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduce(self: FixedArray, callbackfn: (previousValue: U, currentValue: double, index: number, array: FixedArray) => U, initialValue: U): U { +export function reduce(self: FixedArray, callbackfn: (previousValue: U, currentValue: double, index: int, array: FixedArray) => U, initialValue: U): U { let acc = initialValue for (let i = 0; i < self.length; i++) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -5958,10 +5958,10 @@ export function reduce(self: FixedArray, callbackfn: (previo * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduceRight(self: FixedArray, callbackfn: (previousValue: U, currentValue: double, index: number, array: FixedArray) => U, initialValue: U): U { +export function reduceRight(self: FixedArray, callbackfn: (previousValue: U, currentValue: double, index: int, array: FixedArray) => U, initialValue: U): U { let acc = initialValue for (let i = self.length - 1; i >= 0; i--) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -5971,13 +5971,13 @@ export function reduceRight(self: FixedArray, callbackfn: (previousVa * * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. */ -export function forEach(self: FixedArray, callbackfn: (value: double, index: number, array: FixedArray) => void): void { +export function forEach(self: FixedArray, callbackfn: (value: double, index: int, array: FixedArray) => void): void { const len0 = self.length; for (let i = 0; i < len0; i++) { if (i >= self.length) { break } - callbackfn(self[i], i.toDouble(), self) + callbackfn(self[i], i, self) } } @@ -6377,11 +6377,11 @@ export function entries(self: FixedArray): IterableIterator<[number, dou * * @returns `Array` instance, constructed from `this` and given function. */ -export function map(self: FixedArray, callbackfn: (value: double, index: number, array: FixedArray) => double): FixedArray { +export function map(self: FixedArray, callbackfn: (value: double, index: int, array: FixedArray) => double): FixedArray { const len = self.length; let res : FixedArray = new double[len]; for (let i = 0; i < len; i++) { - res[i] = callbackfn(self[i], i.toDouble(), self); + res[i] = callbackfn(self[i], i, self); } return res; } @@ -6393,13 +6393,13 @@ export function map(self: FixedArray, callbackfn: (value: double, index: * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduceRight(self: FixedArray, callbackfn: (previousValue: double, currentValue: double, index: number, array: FixedArray) => double): double { +export function reduceRight(self: FixedArray, callbackfn: (previousValue: double, currentValue: double, index: int, array: FixedArray) => double): double { if (self.length == 0) { throw new TypeError("Reduce of empty array with no initial value") } let acc: double = self[self.length - 1]; for (let i = self.length - 2; i >= 0; i--) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -6749,7 +6749,7 @@ export function fill(self: FixedArray, value: char, start: int, end: int): * * @returns the value of the first element in the array or undefined */ -export function find(self: FixedArray, predicate: (value: char, index: number, array: FixedArray) => boolean): Char | undefined { +export function find(self: FixedArray, predicate: (value: char, index: int, array: FixedArray) => boolean): Char | undefined { const res = findIndex(self, predicate) if (res == -1) { return undefined @@ -6767,9 +6767,9 @@ export function find(self: FixedArray, predicate: (value: char, index: num * * @returns found element index or -1 otherwise */ -export function findIndex(self: FixedArray, predicate: (value: char, index: number, array: FixedArray) => boolean): number { +export function findIndex(self: FixedArray, predicate: (value: char, index: int, array: FixedArray) => boolean): number { for (let i = 0; i < self.length; i++) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return i; } } @@ -6784,10 +6784,10 @@ export function findIndex(self: FixedArray, predicate: (value: char, index * * @returns found element or undefined otherwise */ -export function findLast(self: FixedArray, predicate: (elem: char, index: number, array: FixedArray) => boolean): Char | undefined { +export function findLast(self: FixedArray, predicate: (elem: char, index: int, array: FixedArray) => boolean): Char | undefined { for (let i = self.length - 1; i >= 0; i--) { const val = self[i]; - if (predicate(val, i.toDouble(), self)) { + if (predicate(val, i, self)) { return val; } } @@ -6803,9 +6803,9 @@ export function findLast(self: FixedArray, predicate: (elem: char, index: * * @returns `true` if `predicate` returns a `true` value for every array element. Otherwise, `false`. */ -export function every(self: FixedArray, predicate: (value: char, index: number, array: FixedArray) => boolean): boolean { +export function every(self: FixedArray, predicate: (value: char, index: int, array: FixedArray) => boolean): boolean { for (let i = 0; i < self.length; i++) { - if (!predicate(self[i], i.toDouble(), self)) { + if (!predicate(self[i], i, self)) { return false } } @@ -6821,9 +6821,9 @@ export function every(self: FixedArray, predicate: (value: char, index: nu * * @returns `true` if `predicate` returns a `true` value for at least one array element. Otherwise, `false`. */ -export function some(self: FixedArray, predicate: (value: char, index: number, array: FixedArray) => boolean): boolean { +export function some(self: FixedArray, predicate: (value: char, index: int, array: FixedArray) => boolean): boolean { for (let i = 0; i < self.length; i++) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return true } } @@ -6839,9 +6839,9 @@ export function some(self: FixedArray, predicate: (value: char, index: num * * @returns index of first element satisfying to predicate, -1 if no such element */ -export function findLastIndex(self: FixedArray, predicate: (element: char, index: number, array: FixedArray) => boolean): number { +export function findLastIndex(self: FixedArray, predicate: (element: char, index: int, array: FixedArray) => boolean): number { for (let i = self.length - 1; i >= 0; i--) { - if (predicate(self[i], i.toDouble(), self)) { + if (predicate(self[i], i, self)) { return i } } @@ -6855,13 +6855,13 @@ export function findLastIndex(self: FixedArray, predicate: (element: char, * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduce(self: FixedArray, callbackfn: (previousValue: char, currentValue: char, index: number, array: FixedArray) => char): char { +export function reduce(self: FixedArray, callbackfn: (previousValue: char, currentValue: char, index: int, array: FixedArray) => char): char { if (self.length == 0) { throw new TypeError("Reduce of empty array with no initial value") } let acc: char = self[0]; for (let i = 1; i < self.length; i++) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -6875,10 +6875,10 @@ export function reduce(self: FixedArray, callbackfn: (previousValue: char, * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduce(self: FixedArray, callbackfn: (previousValue: U, currentValue: char, index: number, array: FixedArray) => U, initialValue: U): U { +export function reduce(self: FixedArray, callbackfn: (previousValue: U, currentValue: char, index: int, array: FixedArray) => U, initialValue: U): U { let acc = initialValue for (let i = 0; i < self.length; i++) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -6892,10 +6892,10 @@ export function reduce(self: FixedArray, callbackfn: (previousVa * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduceRight(self: FixedArray, callbackfn: (previousValue: U, currentValue: char, index: number, array: FixedArray) => U, initialValue: U): U { +export function reduceRight(self: FixedArray, callbackfn: (previousValue: U, currentValue: char, index: int, array: FixedArray) => U, initialValue: U): U { let acc = initialValue for (let i = self.length - 1; i >= 0; i--) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } @@ -6905,13 +6905,13 @@ export function reduceRight(self: FixedArray, callbackfn: (previousValu * * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. */ -export function forEach(self: FixedArray, callbackfn: (value: char, index: number, array: FixedArray) => void): void { +export function forEach(self: FixedArray, callbackfn: (value: char, index: int, array: FixedArray) => void): void { const len0 = self.length; for (let i = 0; i < len0; i++) { if (i >= self.length) { break } - callbackfn(self[i], i.toDouble(), self) + callbackfn(self[i], i, self) } } @@ -7303,11 +7303,11 @@ export function entries(self: FixedArray): IterableIterator<[number, char] * * @returns `Array` instance, constructed from `this` and given function. */ -export function map(self: FixedArray, callbackfn: (value: char, index: number, array: FixedArray) => char): FixedArray { +export function map(self: FixedArray, callbackfn: (value: char, index: int, array: FixedArray) => char): FixedArray { const len = self.length; let res : FixedArray = new char[len]; for (let i = 0; i < len; i++) { - res[i] = callbackfn(self[i], i.toDouble(), self); + res[i] = callbackfn(self[i], i, self); } return res; } @@ -7319,13 +7319,13 @@ export function map(self: FixedArray, callbackfn: (value: char, index: num * * @returns a result after applying callbackfn over all elements of the Array */ -export function reduceRight(self: FixedArray, callbackfn: (previousValue: char, currentValue: char, index: number, array: FixedArray) => char): char { +export function reduceRight(self: FixedArray, callbackfn: (previousValue: char, currentValue: char, index: int, array: FixedArray) => char): char { if (self.length == 0) { throw new TypeError("Reduce of empty array with no initial value") } let acc: char = self[self.length - 1]; for (let i = self.length - 2; i >= 0; i--) { - acc = callbackfn(acc, self[i], i.toDouble(), self) + acc = callbackfn(acc, self[i], i, self) } return acc } diff --git a/static_core/plugins/ets/stdlib/std/core/Proxy.ets b/static_core/plugins/ets/stdlib/std/core/Proxy.ets index 3697ed0a2458a6ec181df8e06d68e13dd0989237..10bb69dbdaef9bfce6657caef006e17ce4af2d07 100644 --- a/static_core/plugins/ets/stdlib/std/core/Proxy.ets +++ b/static_core/plugins/ets/stdlib/std/core/Proxy.ets @@ -756,7 +756,7 @@ abstract class ArrayProxy extends Array { continue } - const signatureMatch = signature.every((paramType: Type, index: number) => { + const signatureMatch = signature.every((paramType, index) => { const param = methodType.getParameter(index.toInt()) let tmp = paramType.equals(param.getType()) return tmp diff --git a/static_core/plugins/ets/stdlib/std/core/ReadonlyArrayProxy.ets b/static_core/plugins/ets/stdlib/std/core/ReadonlyArrayProxy.ets index 4f25265527254b5594c824595401c3de22fea14e..c01a42719433ec253e60208fd193d350e1d4a9a0 100644 --- a/static_core/plugins/ets/stdlib/std/core/ReadonlyArrayProxy.ets +++ b/static_core/plugins/ets/stdlib/std/core/ReadonlyArrayProxy.ets @@ -54,31 +54,31 @@ class ReadonlyArrayProxy implements ReadonlyArray { return this.target.entries() } - override every(predicate: (value: T, index: number, array: ReadonlyArray) => boolean): boolean { + override every(predicate: (value: T, index: int, array: ReadonlyArray) => boolean): boolean { return this.target.every(predicate) } - override filter(predicate: (value: T, index: number, array: ReadonlyArray) => boolean): Array { + override filter(predicate: (value: T, index: int, array: ReadonlyArray) => boolean): Array { return this.target.filter(predicate) } - override find(predicate: (value: T, index: number, obj: ReadonlyArray) => boolean): T | undefined { + override find(predicate: (value: T, index: int, obj: ReadonlyArray) => boolean): T | undefined { return this.target.find(predicate) } - override findLast(predicate: (value: T, index: number, obj: ReadonlyArray) => boolean): T | undefined { + override findLast(predicate: (value: T, index: int, obj: ReadonlyArray) => boolean): T | undefined { return this.target.findLast(predicate) } - override findIndex(predicate: (value: T, index: number, obj: ReadonlyArray) => boolean): number { + override findIndex(predicate: (value: T, index: int, obj: ReadonlyArray) => boolean): number { return this.target.findIndex(predicate) } - override findLastIndex(predicate: (value: T, index: number, obj: ReadonlyArray) => boolean): number { + override findLastIndex(predicate: (value: T, index: int, obj: ReadonlyArray) => boolean): number { return this.target.findLastIndex(predicate) } - override forEach(action: (value: T, index: number, array: ReadonlyArray) => void): void { + override forEach(action: (value: T, index: int, array: ReadonlyArray) => void): void { return this.target.forEach(action) } @@ -102,23 +102,23 @@ class ReadonlyArrayProxy implements ReadonlyArray { return this.target.lastIndexOf(searchElement, fromIndex) } - override map(mapper: (value: T, index: number, array: ReadonlyArray) => U): Array { + override map(mapper: (value: T, index: int, array: ReadonlyArray) => U): Array { return this.target.map(mapper) } - override reduce(reducer: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T): T { + override reduce(reducer: (previousValue: T, currentValue: T, currentIndex: int, array: ReadonlyArray) => T): T { return this.target.reduce(reducer) } - override reduce(reducer: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U { + override reduce(reducer: (previousValue: U, currentValue: T, currentIndex: int, array: ReadonlyArray) => U, initialValue: U): U { return this.target.reduce(reducer, initialValue) } - override reduceRight(reducer: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T): T { + override reduceRight(reducer: (previousValue: T, currentValue: T, currentIndex: int, array: ReadonlyArray) => T): T { return this.target.reduceRight(reducer) } - override reduceRight(reducer: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U { + override reduceRight(reducer: (previousValue: U, currentValue: T, currentIndex: int, array: ReadonlyArray) => U, initialValue: U): U { return this.target.reduceRight(reducer, initialValue) } @@ -126,7 +126,7 @@ class ReadonlyArrayProxy implements ReadonlyArray { return this.target.slice(start, end) } - override some(predicate: (value: T, index: number, array: ReadonlyArray) => boolean): boolean { + override some(predicate: (value: T, index: int, array: ReadonlyArray) => boolean): boolean { return this.target.some(predicate) } diff --git a/static_core/plugins/ets/templates/stdlib/Array_code.rb b/static_core/plugins/ets/templates/stdlib/Array_code.rb index cd7ff15e2bf0c2d47d8636ce9889f1bea84a3faa..10701ce37942f7089a6956df1b4672626892ce34 100644 --- a/static_core/plugins/ets/templates/stdlib/Array_code.rb +++ b/static_core/plugins/ets/templates/stdlib/Array_code.rb @@ -16,7 +16,7 @@ module TemplateData def self.get_lambda_data() [ - [2, ", i.toDouble(), #{$ctx.this}", ", index: number, array: #{$ctx.this_type}", ", index, #{$ctx.this}"], + [2, ", i, #{$ctx.this}", ", index: int, array: #{$ctx.this_type}", ", index, #{$ctx.this}"], ] end end diff --git a/static_core/plugins/ets/templates/stdlib/Array_escompat.erb b/static_core/plugins/ets/templates/stdlib/Array_escompat.erb index 85a70090687d636f66f4896011bf4322ba4014fc..2afd21bed82ef2c7660b77041dc9d7562e20550c 100644 --- a/static_core/plugins/ets/templates/stdlib/Array_escompat.erb +++ b/static_core/plugins/ets/templates/stdlib/Array_escompat.erb @@ -841,11 +841,11 @@ export class Array implements ReadonlyArray, Iterable { * * @returns New `Array` instance constructed from `this` with elements filtered using test function `predicate`. */ - public override filter(predicate: (value: T, index: number, array: Array) => boolean): Array { + public override filter(predicate: (value: T, index: int, array: Array) => boolean): Array { const res = new Array() for (let i: int = 0; i < this.actualLength; i++) { const val = this.$_get_unsafe(i) - if (predicate(val, i.toDouble(), this)) { + if (predicate(val, i, this)) { res.push(val) } } @@ -961,7 +961,7 @@ export class Array implements ReadonlyArray, Iterable { * @return new Array after map and than flat */ // NOTE(ivan-tyulyandin): TBD, flatMap may be not subset, see ReadonlyArray - public flatMap(fn: (v: T, k: number, arr: Array) => U): Array { + public flatMap(fn: (v: T, k: int, arr: Array) => U): Array { let mapped: Array = this.map(fn) return mapped.flat() } diff --git a/static_core/plugins/ets/tests/ets_es_checked/array.yaml b/static_core/plugins/ets/tests/ets_es_checked/array.yaml index 0ec83096868a350e806e052cfe1c3dd9bc2c7021..bcb4072cbaee9affd81b233efd58b17be730930b 100644 --- a/static_core/plugins/ets/tests/ets_es_checked/array.yaml +++ b/static_core/plugins/ets/tests/ets_es_checked/array.yaml @@ -31,9 +31,9 @@ sub: - | (x: number, y: number): number => x * y - | - (x: number, y: number, i: number): number => x - y + i + (x: number, y: number, i): number => x - y + i - | - (x: number, y: number, i: number, array: Array): number => y - x + i + (x: number, y: number, i, array: Array): number => y - x + i reduce_u_lamdbas: - | (): string => "1234.0" @@ -42,9 +42,9 @@ sub: - | (x: string, y: number): string => x + y - | - (x: string, y: number, i: number): string => x + y + i + (x: string, y: number, i): string => x + y + i - | - (x: string, y: number, i: number, array: Array): string => y + x + i + (x: string, y: number, i, array: Array): string => y + x + i sub: - method: "concat" rest: diff --git a/static_core/plugins/ets/tests/ets_es_checked/array_lambas.yaml b/static_core/plugins/ets/tests/ets_es_checked/array_lambas.yaml index 04fd1a984e87865f34dabc4dfe7950a6bf758a8b..952e05ae6a4a7fae0c8c6eb413c19e384c3b25df 100644 --- a/static_core/plugins/ets/tests/ets_es_checked/array_lambas.yaml +++ b/static_core/plugins/ets/tests/ets_es_checked/array_lambas.yaml @@ -41,24 +41,24 @@ sub: - | (x: number): boolean => Math.abs(x) == 1 - | - (x: number, i: number, s: Array): boolean => (x + i) > 0 + (x: number, i, s: Array): boolean => (x + i) > 0 - | - (x: number, i: number, s: Array): boolean => (x + i) % 2 == 0 + (x: number, i, s: Array): boolean => (x + i) % 2 == 0 - | - (x: number, i: number, s: Array): boolean => i % 2 == 0 + (x: number, i, s: Array): boolean => i % 2 == 0 - | - (x: number, i: number, s: Array): boolean => (x + i) < 0 + (x: number, i, s: Array): boolean => (x + i) < 0 - | - (x: number, i: number, s: Array): boolean => (x + i) == 1 + (x: number, i, s: Array): boolean => (x + i) == 1 number_lambdas: - | (): number => 1234.0 - | (x: number): number => x * 2.0 - | - (x: number, i: number): number => x + i + (x: number, i): number => x + i - | - (x: number, i: number, s: Array): number => x + i + (x: number, i, s: Array): number => x + i sub: - method: filter params: @@ -86,13 +86,13 @@ sub: params: - - | - (value: number, index: number, array: Array): void => { + (value: number, index, array: Array): void => { if (array.length < 15) { array.push(-value) } } - | - (value: number, index: number): void => { value = value + index } + (value: number, index): void => { value = value + index } - | (value: number): void => { value = value + value } - | diff --git a/static_core/plugins/ets/tests/ets_func_tests/escompat/ReadonlyArrayTest.ets b/static_core/plugins/ets/tests/ets_func_tests/escompat/ReadonlyArrayTest.ets index 9c81e2bf4c92c10cba8650576ad213b73b06e1d2..35474684195765ac97a43b975cfa2eaa50f06044 100644 --- a/static_core/plugins/ets/tests/ets_func_tests/escompat/ReadonlyArrayTest.ets +++ b/static_core/plugins/ets/tests/ets_func_tests/escompat/ReadonlyArrayTest.ets @@ -79,24 +79,24 @@ function main(): int { const RESULT_SUCCESS: int = 0; const RESULT_FAILURE: int = 1; -function filterPositiveElement(elem: Number, index: number, arr: ReadonlyArray): boolean { +function filterPositiveElement(elem: Number, index: int, arr: ReadonlyArray): boolean { return arr[index.toInt()] == elem && elem.valueOf() == 12 && index > 0; } -function filterNegativeElement(elem: Number, index: number, arr: ReadonlyArray): boolean { +function filterNegativeElement(elem: Number, index: int, arr: ReadonlyArray): boolean { return arr[index.toInt()] == elem && elem.valueOf() < 0 && index > 0; } -function filterUndefinedElement(elem: Number, index: number, arr: ReadonlyArray): boolean { +function filterUndefinedElement(elem: Number, index: int, arr: ReadonlyArray): boolean { return arr[index.toInt()] == elem && elem == undefined && index < 0; } -function filterNullElement(elem: Number, index: number, arr: ReadonlyArray) { +function filterNullElement(elem: Number, index: int, arr: ReadonlyArray) { return arr[index.toInt()] == elem && elem == null && index > 0; } function findWithFuncArg3ReadonlyArray(): int { - const fnNull = (elem: Number, index: number, obj: ReadonlyArray): boolean => { return obj[index.toInt()] == elem && elem == null && index > 0; }; + const fnNull = (elem: Number, index: int, obj: ReadonlyArray): boolean => { return obj[index.toInt()] == elem && elem == null && index > 0; }; const arr: ReadonlyArray = Arrays.copy(TEST_ARRAY); if (arr.find(filterPositiveElement) != 12) return RESULT_FAILURE; @@ -108,9 +108,9 @@ function findWithFuncArg3ReadonlyArray(): int { } function findIndexFuncArg3ReadonlyArray(): int { - let fnNegative = (elem: Number, index: number, obj: ReadonlyArray): boolean => { return obj[index.toInt()] == elem && elem.valueOf() < 0 && index > 0; }; - let fnUndefined = (elem: Number, index: number, obj: ReadonlyArray): boolean => { return obj[index.toInt()] == elem && elem == undefined && index < 0; }; - let fnNull = (elem: Number, index: number, obj: ReadonlyArray): boolean => { return obj[index.toInt()] == elem && elem == null && index > 0; }; + let fnNegative = (elem: Number, index: int, obj: ReadonlyArray): boolean => { return obj[index.toInt()] == elem && elem.valueOf() < 0 && index > 0; }; + let fnUndefined = (elem: Number, index: int, obj: ReadonlyArray): boolean => { return obj[index.toInt()] == elem && elem == undefined && index < 0; }; + let fnNull = (elem: Number, index: int, obj: ReadonlyArray): boolean => { return obj[index.toInt()] == elem && elem == null && index > 0; }; const arr: ReadonlyArray = Arrays.copy(TEST_ARRAY); if (arr.findIndex(filterPositiveElement) != 9) return RESULT_FAILURE; @@ -122,7 +122,7 @@ function findIndexFuncArg3ReadonlyArray(): int { } function mapFuncArg3ReadonlyArray(): int { - let mappingFunc = (v: Number, index: number, arr: ReadonlyArray): Number => + let mappingFunc = (v: Number, index: int, arr: ReadonlyArray): Number => (index < 4) && (index < arr.length) ? Number.valueOf(arr[index.toInt()] * arr[index.toInt()]) : Number.valueOf(0); let arrEmpty: ReadonlyArray = new Array; @@ -147,14 +147,14 @@ function everyFuncArg3ReadonlyArray(): int { if (!emptyArray.every(filterPositiveElement)) return RESULT_FAILURE; const testArray: ReadonlyArray = Arrays.copy(TEST_ARRAY); - const everyResult = testArray.every((n: Number, i: number, ns: ReadonlyArray) => n >= -5 && n <= 237); + const everyResult = testArray.every((n: Number, i: int, ns: ReadonlyArray) => n >= -5 && n <= 237); if (!everyResult) return RESULT_FAILURE; return RESULT_SUCCESS; } function filterFuncArg3ReadonlyArray(): int { - let fnTrue = (v: Number, index: number, arr: ReadonlyArray): boolean => { + let fnTrue = (v: Number, index: int, arr: ReadonlyArray): boolean => { return arr[index.toInt()].valueOf() == v.valueOf() && v.valueOf() > -1000; } let arrEmpty = new Array; @@ -165,14 +165,14 @@ function filterFuncArg3ReadonlyArray(): int { if (!Arrays.equals(res, arr)) return RESULT_FAILURE; - let fnFalse = (v: Number, index: number, arr: ReadonlyArray): boolean => { + let fnFalse = (v: Number, index: int, arr: ReadonlyArray): boolean => { return arr.at(index) == v && v == undefined; } if (arr.filter(fnFalse).length != 0) return RESULT_FAILURE; return RESULT_SUCCESS; } -function reduceFunc(a: Number, b: Number, index: number, arr: ReadonlyArray): Number { +function reduceFunc(a: Number, b: Number, index: int, arr: ReadonlyArray): Number { if (index < 0 || index >= arr.length) { return Number.valueOf(-1); } @@ -246,7 +246,7 @@ function reduceRightFuncArg4ReadonlyArrayWithInitialValue(): int { function forEachFuncArg3ReadonlyArray(): int { let s = new String; - let fn = (a: Number, index: number, arr: ReadonlyArray): void => { + let fn = (a: Number, index: int, arr: ReadonlyArray): void => { if (index < 0 && index >= arr.length) { s = ""; } else { diff --git a/static_core/plugins/ets/tests/ets_func_tests/std/containers/ArrayMapTest.ets b/static_core/plugins/ets/tests/ets_func_tests/std/containers/ArrayMapTest.ets index 1a96ad825ddbe9dc76bdec99206bbfd30fdf77d0..73450f69bbd592d1467abb9572e384d171bbadfa 100644 --- a/static_core/plugins/ets/tests/ets_func_tests/std/containers/ArrayMapTest.ets +++ b/static_core/plugins/ets/tests/ets_func_tests/std/containers/ArrayMapTest.ets @@ -19,12 +19,12 @@ function main(): int { return suite.run(); } -type FuncType = (val: number, index: number, obj: Array) => number; +type FuncType = (val: number, index: int, obj: Array) => number; class TestData { static callCnt = 0; static readonly srcArr: Array = new Array(1, 2, 3, 4, 5); - static readonly callbackfn: FuncType = (val: number, index: number, obj: Array): number => { + static readonly callbackfn: FuncType = (val: number, index: int, obj: Array): number => { TestData.srcArr.length = 2; TestData.callCnt++; return 1; diff --git a/static_core/plugins/ets/tests/ets_func_tests/std/containers/ArrayReduceRightTest.ets b/static_core/plugins/ets/tests/ets_func_tests/std/containers/ArrayReduceRightTest.ets index ae76c65d055a722cac5a85bf74b21114022c8d08..b7cbddd8e2fed26927a965fff311378bd7b61c6f 100644 --- a/static_core/plugins/ets/tests/ets_func_tests/std/containers/ArrayReduceRightTest.ets +++ b/static_core/plugins/ets/tests/ets_func_tests/std/containers/ArrayReduceRightTest.ets @@ -20,11 +20,11 @@ function main(): int { return suite.run(); } -type FuncType = (prevVal: number, curVal: number, idx: number, obj: Array) => number; +type FuncType = (prevVal: number, curVal: number, idx: int, obj: Array) => number; class TestData { static arr = new Array(1, 2, 3, 4, 5); - static readonly callbackfn: FuncType = (prevVal: number, curVal: number, idx: number, obj: Array): number => { + static readonly callbackfn: FuncType = (prevVal: number, curVal: number, idx: int, obj: Array): number => { TestData.arr.length = 2; return prevVal + curVal; } @@ -33,7 +33,7 @@ class TestData { class TestData1 { static arr = new Array(1, 2, 3, 4, 5); - static readonly callbackfn: FuncType = (prevVal: number, curVal: number, idx: number, obj: Array): number => { + static readonly callbackfn: FuncType = (prevVal: number, curVal: number, idx: int, obj: Array): number => { TestData1.arr.push(6,7,8); return prevVal + curVal; } diff --git a/static_core/plugins/ets/tests/interop_js/tests/array/ts_to_ets/test_sts_array.ets b/static_core/plugins/ets/tests/interop_js/tests/array/ts_to_ets/test_sts_array.ets index 5baf4bce437c1dfff588ce2bc707917d394f26a1..2d630844c0342ae09f941cda150240bed715e915 100644 --- a/static_core/plugins/ets/tests/interop_js/tests/array/ts_to_ets/test_sts_array.ets +++ b/static_core/plugins/ets/tests/interop_js/tests/array/ts_to_ets/test_sts_array.ets @@ -63,21 +63,21 @@ let arraySplice4: Array = arrSplice4 as Array let arrayToSorted: Array = arrToSorted as Array let arrayUnShift: Array = arrUnShift as Array -const funcPredicate1 = (num: number, index: number, array: Array): boolean => num % 2 === 0 +const funcPredicate1 = (num: number, index: int, array: Array): boolean => num % 2 === 0 -const funcPredicate2 = (num: number, index: number, array: Array): boolean => num < 6 +const funcPredicate2 = (num: number, index: int, array: Array): boolean => num < 6 -const mapAndFlatten = (num: number, k: number, arr: Array): Number => num * num +const mapAndFlatten = (num: number, k: int, arr: Array): Number => num * num const flatMapAndFlatten = (num: number): FixedArray => [num * num] -const processElement = (element: number, index: number, array: Array): void => result = (element === index + 1) +const processElement = (element: number, index: int, array: Array): void => result = (element === index + 1) -const sumReducer = (previousValue: number, currentValue: number, index: number, array: Array): number => { +const sumReducer = (previousValue: number, currentValue: number, index: int, array: Array): number => { return previousValue + currentValue } -const concatenateReducer = (previousValue: string, currentValue: string, index: number, array: Array): string => { +const concatenateReducer = (previousValue: string, currentValue: string, index: int, array: Array): string => { return previousValue + "" + currentValue } diff --git a/static_core/plugins/ets/tests/interop_js/tests/escompat/escompat.ets b/static_core/plugins/ets/tests/interop_js/tests/escompat/escompat.ets index 8fca70f49cdaa1cd8726dac9088f0141e33f789a..28e170f03f6c1f4b9504329a83a3ab25cb722e71 100644 --- a/static_core/plugins/ets/tests/interop_js/tests/escompat/escompat.ets +++ b/static_core/plugins/ets/tests/interop_js/tests/escompat/escompat.ets @@ -94,35 +94,35 @@ function Array_TestJSJoin(arr: Array): void { function Array_TestJSSome(arr: Array): void { let fnTrue: (v: FooClass) => boolean = (v: FooClass): boolean => { return true; } - let fn1True: (v: FooClass, k: number) => boolean = (v: FooClass, k: number): boolean => { return true; } + let fn1True = (v: FooClass, k: int): boolean => true; arktest.assertEQ(arr.some(fnTrue), true); arktest.assertEQ(arr.some(fn1True), true); let fnFalse: (v: FooClass) => boolean = (v: FooClass): boolean => { return false; } - let fn1False: (v: FooClass, k: number) => boolean = (v: FooClass, k: number): boolean => { return k < 0; } + let fn1False = (v: FooClass, k: int): boolean => k < 0; arktest.assertEQ(!arr.some(fnFalse), true); arktest.assertEQ(!arr.some(fn1False), true); } function Array_TestJSEvery(arr: Array): void { let fnTrue: (v: FooClass) => boolean = (v: FooClass): boolean => { return true; } - let fn1True: (v: FooClass, k: number) => boolean = (v: FooClass, k: number): boolean => { return true; } + let fn1True = (v: FooClass, k: int): boolean => true; arktest.assertEQ(arr.every(fnTrue), true); arktest.assertEQ(arr.every(fn1True), true); let fnFalse: (v: FooClass) => boolean = (v: FooClass): boolean => { return false; } - let fn1False: (v: FooClass, k: number) => boolean = (v: FooClass, k: number): boolean => { return k < 0; } + let fn1False = (v: FooClass, k: int): boolean => k < 0; arktest.assertEQ(!arr.every(fnFalse), true); arktest.assertEQ(!arr.every(fn1False), true); } function Array_TestJSFilter(arr: Array): void { let fnTrue: (v: FooClass) => boolean = (v: FooClass): boolean => { return true; } - let fn1True: (v: FooClass, k: number) => boolean = (v: FooClass, k: number): boolean => { return true; } + let fn1True = (v: FooClass, k: int): boolean => true; let filter = arr.filter(fnTrue); let filter1 = arr.filter(fn1True); arktest.assertEQ(arr.at(0), filter.at(0)); arktest.assertEQ(arr.at(0), filter1.at(0)); let fnFalse: (v: FooClass) => boolean = (v: FooClass): boolean => { return false; } - let fn1False: (v: FooClass, k: number) => boolean = (v: FooClass, k: number): boolean => { return k < 0; } + let fn1False = (v: FooClass, k: int): boolean => k < 0; let filterFalse = arr.filter(fnFalse); let filter1False = arr.filter(fn1False); arktest.assertNE(arr.at(0), filterFalse.at(0)); diff --git a/static_core/plugins/ets/tests/stdlib-templates/escompat/escompat_Array_single.ets b/static_core/plugins/ets/tests/stdlib-templates/escompat/escompat_Array_single.ets index e852b8260fc1f3c481e749716f99c3e5e8924945..0e5dbcf1add89eaaeaf765a639851a85acdb658c 100644 --- a/static_core/plugins/ets/tests/stdlib-templates/escompat/escompat_Array_single.ets +++ b/static_core/plugins/ets/tests/stdlib-templates/escompat/escompat_Array_single.ets @@ -89,7 +89,7 @@ function testCreateFromString2(): int { function testFiltered(): int { let src: String = "HHeelllloo"; let exp: String = "Hello"; - let test = Array.from(src, (c: string, i: number): string => c).filter((v: String, k: number): boolean => k%2 == 0); + let test = Array.from(src, (c: string, i: number): string => c).filter((v: String, k: int): boolean => k%2 == 0); if(test.length != exp.length) { console.println("Array size mismatch"); diff --git a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_array_foreach.yaml b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_array_foreach.yaml index 2ad788da33ff5b63ea2389cfeddba69e73acccb7..03d2ab6995a763e5ddf11ff54e0cc94cdfdd937a 100644 --- a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_array_foreach.yaml +++ b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_array_foreach.yaml @@ -17,7 +17,7 @@ result: arr, result_nature: array, result_type: "FixedArray", - method_signature: { arr: "FixedArray", fn : "(value:boolean,index:number,self:FixedArray)=>void" }, + method_signature: { arr: "FixedArray", fn : "(value:boolean,index:int,self:FixedArray)=>void" }, method_throws: "false", method_signature_desc: {arr: "boolean_array", fn: "func_boolean_int_boolean_array"}, method_test_index_data: @@ -25,12 +25,12 @@ test1: { arr: "[false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false]", - fn: '(value:boolean,index:number,self:FixedArray): void => {self[index.toInt()] = !value}', + fn: '(value:boolean,index:int,self:FixedArray): void => {self[index.toInt()] = !value}', }, test2: { arr: "[]", - fn: '(value:boolean,index:number,self:FixedArray): void => {self[index.toInt()] = !value}', + fn: '(value:boolean,index:int,self:FixedArray): void => {self[index.toInt()] = !value}', }, }, @@ -46,7 +46,7 @@ result: arr, result_nature: array, result_type: "FixedArray", - method_signature: { arr: "FixedArray", fn : "(value:byte,index:number,self:FixedArray)=>void" }, + method_signature: { arr: "FixedArray", fn : "(value:byte,index:int,self:FixedArray)=>void" }, method_throws: "false", method_signature_desc: {arr: "byte_array", fn: "func_byte_int_byte_array"}, method_test_index_data: @@ -54,17 +54,17 @@ test1: { arr: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:byte,index:number,self:FixedArray): void => {self[index.toInt()] = ((value * 2).toByte())}', + fn: '(value:byte,index:int,self:FixedArray): void => {self[index.toInt()] = ((value * 2).toByte())}', }, test2: { arr: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:byte,index:number,self:FixedArray): void => {self[index.toInt()] = ((value + index.toInt()).toByte())}', + fn: '(value:byte,index:int,self:FixedArray): void => {self[index.toInt()] = ((value + index.toInt()).toByte())}', }, test3: { arr: "[]", - fn: '(value:byte,index:number,self:FixedArray): void => {self[index.toInt()] = ((value + index.toInt()).toByte())}', + fn: '(value:byte,index:int,self:FixedArray): void => {self[index.toInt()] = ((value + index.toInt()).toByte())}', }, }, method_expected_data: @@ -80,7 +80,7 @@ result: arr, result_nature: array, result_type: "FixedArray", - method_signature: { arr: "FixedArray", fn : "(value:short,index:number,self:FixedArray)=>void" }, + method_signature: { arr: "FixedArray", fn : "(value:short,index:int,self:FixedArray)=>void" }, method_throws: "false", method_signature_desc: {arr: "short_array", fn: "func_short_int_short_array"}, method_test_index_data: @@ -88,17 +88,17 @@ test1: { arr: "[0 ,1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:short,index:number,self:FixedArray): void => {self[index.toInt()] = ((value * 2).toShort())}', + fn: '(value:short,index:int,self:FixedArray): void => {self[index.toInt()] = ((value * 2).toShort())}', }, test2: { arr: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:short,index:number,self:FixedArray): void => {self[index.toInt()] = ((value + index.toInt()).toShort())}', + fn: '(value:short,index:int,self:FixedArray): void => {self[index.toInt()] = ((value + index.toInt()).toShort())}', }, test3: { arr: "[]", - fn: '(value:short,index:number,self:FixedArray): void => {self[index.toInt()] = ((value + index.toInt()).toShort())}', + fn: '(value:short,index:int,self:FixedArray): void => {self[index.toInt()] = ((value + index.toInt()).toShort())}', }, }, method_expected_data: @@ -114,7 +114,7 @@ result: arr, result_nature: array, result_type: "FixedArray", - method_signature: { arr: "FixedArray", fn : "(value:int,index:number,self:FixedArray)=>void" }, + method_signature: { arr: "FixedArray", fn : "(value:int,index:int,self:FixedArray)=>void" }, method_throws: "false", method_signature_desc: {arr: "int_array", fn: "func_int_int_int_array"}, method_test_index_data: @@ -122,17 +122,17 @@ test1: { arr: "[0 ,1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:int,index:number,self:FixedArray): void => {self[index.toInt()] = value * 2}', + fn: '(value:int,index:int,self:FixedArray): void => {self[index.toInt()] = value * 2}', }, test2: { arr: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:int,index:number,self:FixedArray): void => {self[index.toInt()] = value + index.toInt()}', + fn: '(value:int,index:int,self:FixedArray): void => {self[index.toInt()] = value + index.toInt()}', }, test3: { arr: "[]", - fn: '(value:int,index:number,self:FixedArray): void => {self[index.toInt()] = value + index.toInt()}', + fn: '(value:int,index:int,self:FixedArray): void => {self[index.toInt()] = value + index.toInt()}', }, }, method_expected_data: @@ -148,7 +148,7 @@ result: arr, result_nature: array, result_type: "FixedArray", - method_signature: { arr: "FixedArray", fn : "(value:long,index:number,self:FixedArray)=>void" }, + method_signature: { arr: "FixedArray", fn : "(value:long,index:int,self:FixedArray)=>void" }, method_throws: "false", method_signature_desc: {arr: "long_array", fn: "func_long_int_long_array"}, method_test_index_data: @@ -156,17 +156,17 @@ test1: { arr: "[0 ,1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:long,index:number,self:FixedArray): void => {self[index.toInt()] = value * 2}', + fn: '(value:long,index:int,self:FixedArray): void => {self[index.toInt()] = value * 2}', }, test2: { arr: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:long,index:number,self:FixedArray): void => {self[index.toInt()] = value + index.toInt()}', + fn: '(value:long,index:int,self:FixedArray): void => {self[index.toInt()] = value + index.toInt()}', }, test3: { arr: "[]", - fn: '(value:long,index:number,self:FixedArray): void => {self[index.toInt()] = value + index.toInt()}', + fn: '(value:long,index:int,self:FixedArray): void => {self[index.toInt()] = value + index.toInt()}', }, }, method_expected_data: @@ -182,7 +182,7 @@ result: arr, result_nature: array, result_type: "FixedArray", - method_signature: { arr: "FixedArray", fn : "(value:float,index:number,self:FixedArray)=>void" }, + method_signature: { arr: "FixedArray", fn : "(value:float,index:int,self:FixedArray)=>void" }, method_throws: "false", method_signature_desc: {arr: "float_array", fn: "func_float_int_float_array"}, method_test_index_data: @@ -190,17 +190,17 @@ test1: { arr: "[0 ,1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:float,index:number,self:FixedArray): void => {self[index.toInt()] = value * 2}', + fn: '(value:float,index:int,self:FixedArray): void => {self[index.toInt()] = value * 2}', }, test2: { arr: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:float,index:number,self:FixedArray): void => {self[index.toInt()] = value + index.toInt()}', + fn: '(value:float,index:int,self:FixedArray): void => {self[index.toInt()] = value + index.toInt()}', }, test3: { arr: "[]", - fn: '(value:float,index:number,self:FixedArray): void => {self[index.toInt()] = value + index.toInt()}', + fn: '(value:float,index:int,self:FixedArray): void => {self[index.toInt()] = value + index.toInt()}', }, }, method_expected_data: @@ -216,7 +216,7 @@ result: arr, result_nature: array, result_type: "FixedArray", - method_signature: { arr: "FixedArray", fn : "(value:double,index:number,self:FixedArray)=>void" }, + method_signature: { arr: "FixedArray", fn : "(value:double,index:int,self:FixedArray)=>void" }, method_throws: "false", method_signature_desc: {arr: "double_array", fn: "func_double_int_double_array"}, method_test_index_data: @@ -224,17 +224,17 @@ test1: { arr: "[0 ,1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:double,index:number,self:FixedArray): void => {self[index.toInt()] = value * 2}', + fn: '(value:double,index:int,self:FixedArray): void => {self[index.toInt()] = value * 2}', }, test2: { arr: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:double,index:number,self:FixedArray): void => {self[index.toInt()] = value + index.toInt()}', + fn: '(value:double,index:int,self:FixedArray): void => {self[index.toInt()] = value + index.toInt()}', }, test3: { arr: "[]", - fn: '(value:double,index:number,self:FixedArray): void => {self[index.toInt()] = value + index.toInt()}', + fn: '(value:double,index:int,self:FixedArray): void => {self[index.toInt()] = value + index.toInt()}', }, }, method_expected_data: @@ -250,7 +250,7 @@ result: arr, result_nature: array, result_type: "FixedArray", - method_signature: { arr: "FixedArray", fn : "(value:char,index:number,self:FixedArray)=>void" }, + method_signature: { arr: "FixedArray", fn : "(value:char,index:int,self:FixedArray)=>void" }, method_throws: "false", method_signature_desc: {arr: "char_array", fn: "func_char_int_char_array"}, method_test_index_data: @@ -258,17 +258,17 @@ test1: { arr: "[c'\\x00', c'\\x01', c'\\x02', c'\\x03', c'\\x04', c'\\x05', c'\\x06', c'\\x07', c'\\x08', c'\\x09', c'\\x0A', c'\\x0B', c'\\x0C', c'\\x0D', c'\\x0E', c'\\x0F']", - fn: '(value:char,index:number,self:FixedArray): void => {self[index.toInt()] = (value.toInt() * 2).toChar()}', + fn: '(value:char,index:int,self:FixedArray): void => {self[index.toInt()] = (value.toInt() * 2).toChar()}', }, test2: { arr: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:char,index:number,self:FixedArray): void => {self[index.toInt()] = (value.toInt() + index.toInt()).toChar()}', + fn: '(value:char,index:int,self:FixedArray): void => {self[index.toInt()] = (value.toInt() + index.toInt()).toChar()}', }, test3: { arr: "[]", - fn: '(value:char,index:number,self:FixedArray): void => {self[index.toInt()] = (value.toInt() + index.toInt()).toChar(0}', + fn: '(value:char,index:int,self:FixedArray): void => {self[index.toInt()] = (value.toInt() + index.toInt()).toChar(0}', }, }, method_expected_data: diff --git a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_array_map.yaml b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_array_map.yaml index df7260a5901d50bcb518a9860d1d71bcd2187d06..5a1907275d18e648fcec57667dc92f50d1f270d9 100644 --- a/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_array_map.yaml +++ b/static_core/plugins/ets/tests/stdlib-templates/std/core/list.std_core_array_map.yaml @@ -16,7 +16,7 @@ method_nature: function, result_nature: array, result_type: "FixedArray", - method_signature: { arr: "FixedArray", fn : "(value:boolean,index:number,self:FixedArray)=>boolean" }, + method_signature: { arr: "FixedArray", fn : "(value:boolean,index:int,self:FixedArray)=>boolean" }, method_throws: "false", method_signature_desc: {arr: "boolean_array", fn: "func_boolean_int_boolean_array"}, method_test_index_data: @@ -24,12 +24,12 @@ test1: { arr: "[true, true, true, true, true, true, true, true, true, true, true, true, true, true, true, true]", - fn: '(value:boolean,index:number,self:FixedArray): boolean => {return !value}', + fn: '(value:boolean,index:int,self:FixedArray): boolean => {return !value}', }, test1: { arr: "[]", - fn: '(value:boolean,index:number,self:FixedArray): boolean => {return !value}', + fn: '(value:boolean,index:int,self:FixedArray): boolean => {return !value}', }, }, method_expected_data: @@ -43,7 +43,7 @@ method_nature: function, result_nature: array, result_type: "FixedArray", - method_signature: { arr: "FixedArray", fn : "(value:byte,index:number,self:FixedArray)=>byte" }, + method_signature: { arr: "FixedArray", fn : "(value:byte,index:int,self:FixedArray)=>byte" }, method_throws: "false", method_signature_desc: {arr: "byte_array", fn: "func_byte_int_byte_array"}, method_test_index_data: @@ -51,17 +51,17 @@ test1: { arr: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:byte,index:number,self:FixedArray): byte => {return ((value * 2).toByte())}', + fn: '(value:byte,index:int,self:FixedArray): byte => {return ((value * 2).toByte())}', }, test2: { arr: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:byte,index:number,self:FixedArray): byte => {return ((value + index).toByte())}', + fn: '(value:byte,index:int,self:FixedArray): byte => {return ((value + index).toByte())}', }, test3: { arr: "[]", - fn: '(value:byte,index:number,self:FixedArray): byte => {return ((value + index).toByte())}', + fn: '(value:byte,index:int,self:FixedArray): byte => {return ((value + index).toByte())}', }, }, method_expected_data: @@ -76,7 +76,7 @@ method_nature: function, result_nature: array, result_type: "FixedArray", - method_signature: { arr: "FixedArray", fn : "(value:short,index:number,self:FixedArray)=>short" }, + method_signature: { arr: "FixedArray", fn : "(value:short,index:int,self:FixedArray)=>short" }, method_throws: "false", method_signature_desc: {arr: "short_array", fn: "func_short_int_short_array"}, method_test_index_data: @@ -84,17 +84,17 @@ test1: { arr: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:short,index:number,self:FixedArray): short => {return ((value * 2).toShort())}', + fn: '(value:short,index:int,self:FixedArray): short => {return ((value * 2).toShort())}', }, test2: { arr: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:short,index:number,self:FixedArray): short => {return ((value + index).toShort())}', + fn: '(value:short,index:int,self:FixedArray): short => {return ((value + index).toShort())}', }, test3: { arr: "[]", - fn: '(value:short,index:number,self:FixedArray): short => {return ((value + index).toShort())}', + fn: '(value:short,index:int,self:FixedArray): short => {return ((value + index).toShort())}', }, }, method_expected_data: @@ -109,7 +109,7 @@ method_nature: function, result_nature: array, result_type: "FixedArray", - method_signature: { arr: "FixedArray", fn : "(value:int,index:number,self:FixedArray)=>int" }, + method_signature: { arr: "FixedArray", fn : "(value:int,index:int,self:FixedArray)=>int" }, method_throws: "false", method_signature_desc: {arr: "int_array", fn: "func_int_int_int_array"}, method_test_index_data: @@ -117,17 +117,17 @@ test1: { arr: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:int,index:number,self:FixedArray): int => {return value * 2}', + fn: '(value:int,index:int,self:FixedArray): int => {return value * 2}', }, test2: { arr: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:int,index:number,self:FixedArray): int => {return (value + index).toInt()}', + fn: '(value:int,index:int,self:FixedArray): int => {return (value + index).toInt()}', }, test3: { arr: "[]", - fn: '(value:int,index:number,self:FixedArray): int => {return (value + index).toInt()}', + fn: '(value:int,index:int,self:FixedArray): int => {return (value + index).toInt()}', }, }, @@ -143,7 +143,7 @@ method_nature: function, result_nature: array, result_type: "FixedArray", - method_signature: { arr: "FixedArray", fn : "(value:long,index:number,self:FixedArray)=>long" }, + method_signature: { arr: "FixedArray", fn : "(value:long,index:int,self:FixedArray)=>long" }, method_throws: "false", method_signature_desc: {arr: "long_array", fn: "func_long_int_long_array"}, method_test_index_data: @@ -151,17 +151,17 @@ test1: { arr: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:long,index:number,self:FixedArray): long => {return value * 2}', + fn: '(value:long,index:int,self:FixedArray): long => {return value * 2}', }, test2: { arr: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:long,index:number,self:FixedArray): long => {return (value + index).toLong()}', + fn: '(value:long,index:int,self:FixedArray): long => {return (value + index).toLong()}', }, test3: { arr: "[]", - fn: '(value:long,index:number,self:FixedArray): long => {return (value + index).toLong()}', + fn: '(value:long,index:int,self:FixedArray): long => {return (value + index).toLong()}', }, }, @@ -177,7 +177,7 @@ method_nature: function, result_nature: array, result_type: "FixedArray", - method_signature: { arr: "FixedArray", fn : "(value:float,index:number,self:FixedArray)=>float" }, + method_signature: { arr: "FixedArray", fn : "(value:float,index:int,self:FixedArray)=>float" }, method_throws: "false", method_signature_desc: {arr: "float_array", fn: "func_float_int_float_array"}, method_test_index_data: @@ -185,17 +185,17 @@ test1: { arr: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:float,index:number,self:FixedArray): float => {return value * 2}', + fn: '(value:float,index:int,self:FixedArray): float => {return value * 2}', }, test2: { arr: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:float,index:number,self:FixedArray): float => {return (value + index).toFloat()}', + fn: '(value:float,index:int,self:FixedArray): float => {return (value + index).toFloat()}', }, test3: { arr: "[]", - fn: '(value:float,index:number,self:FixedArray): float => {return (value + index).toFloat()}', + fn: '(value:float,index:int,self:FixedArray): float => {return (value + index).toFloat()}', }, }, @@ -211,7 +211,7 @@ method_nature: function, result_nature: array, result_type: "FixedArray", - method_signature: { arr: "FixedArray", fn : "(value:double,index:number,self:FixedArray)=>double" }, + method_signature: { arr: "FixedArray", fn : "(value:double,index:int,self:FixedArray)=>double" }, method_throws: "false", method_signature_desc: {arr: "double_array", fn: "func_double_int_double_array"}, method_test_index_data: @@ -219,17 +219,17 @@ test1: { arr: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:double,index:number,self:FixedArray): double => {return value * 2}', + fn: '(value:double,index:int,self:FixedArray): double => {return value * 2}', }, test2: { arr: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]", - fn: '(value:double,index:number,self:FixedArray): double => {return (value + index)}', + fn: '(value:double,index:int,self:FixedArray): double => {return (value + index)}', }, test3: { arr: "[]", - fn: '(value:double,index:number,self:FixedArray): double => {return (value + index)}', + fn: '(value:double,index:int,self:FixedArray): double => {return (value + index)}', }, }, method_expected_data: