Merge pull request #436 from Microsoft/improvedArrayErrors

Rearranging members of Array<T> to improve error reporting.
This commit is contained in:
Anders Hejlsberg
2014-08-12 13:07:00 -07:00
22 changed files with 48 additions and 55 deletions

27
src/lib/core.d.ts vendored
View File

@@ -941,11 +941,24 @@ declare var JSON: JSON;
/////////////////////////////
interface Array<T> {
/**
* Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.
*/
length: number;
/**
* Returns a string representation of an array.
*/
toString(): string;
toLocaleString(): string;
/**
* Appends new elements to an array, and returns the new length of the array.
* @param items New elements of the Array.
*/
push(...items: T[]): number;
/**
* Removes the last element from an array and returns it.
*/
pop(): T;
/**
* Combines two or more arrays.
* @param items Additional items to add to the end of array1.
@@ -961,15 +974,6 @@ interface Array<T> {
* @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
*/
join(separator?: string): string;
/**
* Removes the last element from an array and returns it.
*/
pop(): T;
/**
* Appends new elements to an array, and returns the new length of the array.
* @param items New elements of the Array.
*/
push(...items: T[]): number;
/**
* Reverses the elements in an Array.
*/
@@ -1086,11 +1090,6 @@ interface Array<T> {
*/
reduceRight<U>(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;
/**
* Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.
*/
length: number;
[n: number]: T;
}
declare var Array: {