Skip to content

Conversation

@mhegazy
Copy link
Contributor

@mhegazy mhegazy commented Jun 2, 2017

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

> node built\local\tsc.js --diagnostics --p src\compiler\tsconfig.json
Files:            34
Lines:         90626
Nodes:        443548
Identifiers:  167732
Symbols:       93831
Types:         37620
Memory used: 390453K
I/O read:      0.00s
I/O write:     0.05s
Parse time:    0.88s
Bind time:     0.86s
Check time:    4.31s
Emit time:     3.11s
Total time:    9.16s

after:

>node built\local\tsc.js --diagnostics --p src\compiler\tsconfig.json
Files:            34
Lines:         90421
Nodes:        438317
Identifiers:  165477
Symbols:       63565
Types:         27751
Memory used: 376816K
I/O read:      0.00s
I/O write:     0.05s
Parse time:    0.88s
Bind time:     0.97s
Check time:    3.69s
Emit time:     2.34s
Total time:    7.87s

Also fixes #13840

src/lib/es5.d.ts Outdated
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;
Copy link
Member

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).

@ahejlsberg
Copy link
Member

ahejlsberg commented Jun 3, 2017

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.

@mhegazy mhegazy merged commit a76b4b1 into master Jun 4, 2017
mhegazy added a commit that referenced this pull request Aug 29, 2017
@ghost ghost deleted the arrayCleanup branch August 30, 2017 14:40
mhegazy added a commit that referenced this pull request Aug 30, 2017
* Follow up on #16223, Remove generic signatures from Array, ReadOnlyArray and TypedArrays

* Remove test

* Accept baselines

* Remove invalid `this: void` in callbacks

* accept baselines
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

map on tuples with more than 5 elements

4 participants