-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Array cleanup #16223
Array cleanup #16223
Conversation
src/lib/es5.d.ts
Outdated
@@ -1597,7 +1549,7 @@ interface Int8Array { | |||
*/ | |||
every(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean): boolean; | |||
every(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean, thisArg: undefined): boolean; | |||
every<Z>(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => boolean, thisArg: Z): boolean; | |||
every<Z>(callbackfn: ( value: number, index: number, array: Int8Array) => boolean, thisArg: Z): boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something isn't right here. All of the native array types still have three overloads per method, all that changed was that the this
parameter disappeared from the last overload (and got replaced with a blank).
Maybe add a description that explains why we're simplifying this and include links to the issues that introduced the overloads in the first place. |
* Follow up on #16223, Remove generic signatures from Array, ReadOnlyArray and TypedArrays * Remove test * Accept baselines * Remove invalid `this: void` in callbacks * accept baselines
This change unifies ReadOnlyArray and Array interface methods; it also removes generic signatures from both interfaces that were only used to propagate the type of
thisArg
parameter. This reverts the changes in #12784, and unfixes #12548; the removal of the generic signatures saves a good chunk of time of building the compiler and some 30 K symbols created.before
after:
Also fixes #13840