Skip to content

Commit

Permalink
feat: update to V8 9.7 (denoland#12685)
Browse files Browse the repository at this point in the history
This commit updates the rusty_v8 to 0.34.0. This commit also adds
the required typings for the new Array#findLast and Array#findIndexLast
methods.
  • Loading branch information
lucacasonato committed Nov 8, 2021
1 parent c91da12 commit 80d3a5f
Show file tree
Hide file tree
Showing 5 changed files with 296 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

291 changes: 290 additions & 1 deletion cli/dts/lib.esnext.array.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,60 @@ interface Array<T> {
* @param index index to access.
*/
at(index: number): T | undefined;
}

/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* immediately returns that element value. Otherwise, find returns undefined.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findLast<S extends T>(predicate: (this: void, value: T, index: number, obj: T[]) => value is S, thisArg?: any): S | undefined;
findLast(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): T | undefined;

/**
* Returns the index of the last element in the array where predicate is true, and -1
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findLastIndex(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): number;
}

interface ReadonlyArray<T> {
/**
* Access item by relative indexing.
* @param index index to access.
*/
at(index: number): T | undefined;

/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* immediately returns that element value. Otherwise, find returns undefined.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findLast<S extends T>(predicate: (this: void, value: T, index: number, obj: T[]) => value is S, thisArg?: any): S | undefined;
findLast(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): T | undefined;

/**
* Returns the index of the last element in the array where predicate is true, and -1
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findLastIndex(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): number;
}

interface Int8Array {
Expand All @@ -37,6 +83,28 @@ interface Int8Array {
* @param index index to access.
*/
at(index: number): number | undefined;

/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* immediately returns that element value. Otherwise, find returns undefined.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findLast(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number | undefined;

/**
* Returns the index of the last element in the array where predicate is true, and -1
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findLastIndex(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number;
}

interface Uint8Array {
Expand All @@ -45,6 +113,28 @@ interface Uint8Array {
* @param index index to access.
*/
at(index: number): number | undefined;

/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* immediately returns that element value. Otherwise, find returns undefined.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findLast(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number | undefined;

/**
* Returns the index of the last element in the array where predicate is true, and -1
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findLastIndex(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number;
}

interface Uint8ClampedArray {
Expand All @@ -53,14 +143,59 @@ interface Uint8ClampedArray {
* @param index index to access.
*/
at(index: number): number | undefined;

/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* immediately returns that element value. Otherwise, find returns undefined.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findLast(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number | undefined;

/**
* Returns the index of the last element in the array where predicate is true, and -1
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndexLast(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number;
}


interface Int16Array {
/**
* Access item by relative indexing.
* @param index index to access.
*/
at(index: number): number | undefined;

/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* immediately returns that element value. Otherwise, find returns undefined.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findLast(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number | undefined;

/**
* Returns the index of the last element in the array where predicate is true, and -1
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndexLast(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number;
}

interface Uint16Array {
Expand All @@ -69,6 +204,28 @@ interface Uint16Array {
* @param index index to access.
*/
at(index: number): number | undefined;

/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* immediately returns that element value. Otherwise, find returns undefined.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findLast(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number | undefined;

/**
* Returns the index of the last element in the array where predicate is true, and -1
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndexLast(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number;
}

interface Int32Array {
Expand All @@ -77,6 +234,28 @@ interface Int32Array {
* @param index index to access.
*/
at(index: number): number | undefined;

/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* immediately returns that element value. Otherwise, find returns undefined.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findLast(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number | undefined;

/**
* Returns the index of the last element in the array where predicate is true, and -1
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndexLast(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number;
}

interface Uint32Array {
Expand All @@ -85,6 +264,28 @@ interface Uint32Array {
* @param index index to access.
*/
at(index: number): number | undefined;

/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* immediately returns that element value. Otherwise, find returns undefined.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findLast(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number | undefined;

/**
* Returns the index of the last element in the array where predicate is true, and -1
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndexLast(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number;
}

interface Float32Array {
Expand All @@ -93,6 +294,28 @@ interface Float32Array {
* @param index index to access.
*/
at(index: number): number | undefined;

/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* immediately returns that element value. Otherwise, find returns undefined.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findLast(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number | undefined;

/**
* Returns the index of the last element in the array where predicate is true, and -1
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndexLast(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number;
}

interface Float64Array {
Expand All @@ -101,6 +324,28 @@ interface Float64Array {
* @param index index to access.
*/
at(index: number): number | undefined;

/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* immediately returns that element value. Otherwise, find returns undefined.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findLast(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number | undefined;

/**
* Returns the index of the last element in the array where predicate is true, and -1
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndexLast(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number;
}

interface BigInt64Array {
Expand All @@ -109,6 +354,28 @@ interface BigInt64Array {
* @param index index to access.
*/
at(index: number): bigint | undefined;

/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* immediately returns that element value. Otherwise, find returns undefined.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findLast(predicate: (value: bigint, index: number, obj: BigInt64Array) => boolean, thisArg?: any): bigint | undefined;

/**
* Returns the index of the last element in the array where predicate is true, and -1
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndexLast(predicate: (value: bigint, index: number, obj: BigInt64Array) => boolean, thisArg?: any): bigint;
}

interface BigUint64Array {
Expand All @@ -117,4 +384,26 @@ interface BigUint64Array {
* @param index index to access.
*/
at(index: number): bigint | undefined;

/**
* Returns the value of the last element in the array where predicate is true, and undefined
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found, find
* immediately returns that element value. Otherwise, find returns undefined.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findLast(predicate: (value: bigint, index: number, obj: BigUint64Array) => boolean, thisArg?: any): bigint | undefined;

/**
* Returns the index of the last element in the array where predicate is true, and -1
* otherwise.
* @param predicate find calls predicate once for each element of the array, in ascending
* order, until it finds one where predicate returns true. If such an element is found,
* findIndex immediately returns that element index. Otherwise, findIndex returns -1.
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndexLast(predicate: (value: bigint, index: number, obj: BigUint64Array) => boolean, thisArg?: any): bigint;
}
Loading

0 comments on commit 80d3a5f

Please sign in to comment.