Skip to content

Commit

Permalink
Revert everything but change to parameter types
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Hanson committed Jan 8, 2018
1 parent 8a045b7 commit 4bb3c90
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 51 deletions.
15 changes: 13 additions & 2 deletions src/lib/es2017.object.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,25 @@ interface ObjectConstructor {
* Returns an array of values of the enumerable properties of an object
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
*/
values<T extends object>(o: T): T[keyof T][];
values<T>(o: { [s: string]: T } | { [n: number]: T }): T[];

/**
* Returns an array of values of the enumerable properties of an object
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
*/
values(o: {}): any[];

/**
* Returns an array of key/values of the enumerable properties of an object
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
*/
entries<T>(o: { [s: string]: T } | { [n: number]: T }): [string, T][];

/**
* Returns an array of key/values of the enumerable properties of an object
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
*/
entries<T extends object>(o: T): [string, T[keyof T]][];
entries(o: {}): [string, any][];

/**
* Returns an object containing all own property descriptors of an object
Expand Down
17 changes: 0 additions & 17 deletions tests/baselines/reference/useObjectValuesAndEntries1.errors.txt

This file was deleted.

20 changes: 10 additions & 10 deletions tests/baselines/reference/useObjectValuesAndEntries1.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ var o = { a: 1, b: 2 };

for (var x of Object.values(o)) {
>x : Symbol(x, Decl(useObjectValuesAndEntries1.ts, 2, 8))
>Object.values : Symbol(ObjectConstructor.values, Decl(lib.es2017.object.d.ts, --, --))
>Object.values : Symbol(ObjectConstructor.values, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --))
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>values : Symbol(ObjectConstructor.values, Decl(lib.es2017.object.d.ts, --, --))
>values : Symbol(ObjectConstructor.values, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --))
>o : Symbol(o, Decl(useObjectValuesAndEntries1.ts, 0, 3))

let y = x;
Expand All @@ -18,28 +18,28 @@ for (var x of Object.values(o)) {

var entries = Object.entries(o);
>entries : Symbol(entries, Decl(useObjectValuesAndEntries1.ts, 6, 3))
>Object.entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --))
>Object.entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --))
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --))
>entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --))
>o : Symbol(o, Decl(useObjectValuesAndEntries1.ts, 0, 3))

var entries1 = Object.entries(1);
>entries1 : Symbol(entries1, Decl(useObjectValuesAndEntries1.ts, 7, 3))
>Object.entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --))
>Object.entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --))
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --))
>entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --))

var entries2 = Object.entries({a: true, b: 2})
>entries2 : Symbol(entries2, Decl(useObjectValuesAndEntries1.ts, 8, 3))
>Object.entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --))
>Object.entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --))
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --))
>entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --))
>a : Symbol(a, Decl(useObjectValuesAndEntries1.ts, 8, 31))
>b : Symbol(b, Decl(useObjectValuesAndEntries1.ts, 8, 39))

var entries3 = Object.entries({})
>entries3 : Symbol(entries3, Decl(useObjectValuesAndEntries1.ts, 9, 3))
>Object.entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --))
>Object.entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --))
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
>entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --))
>entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --))

28 changes: 14 additions & 14 deletions tests/baselines/reference/useObjectValuesAndEntries1.types
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ var o = { a: 1, b: 2 };
for (var x of Object.values(o)) {
>x : number
>Object.values(o) : number[]
>Object.values : <T extends object>(o: T) => T[keyof T][]
>Object.values : { <T>(o: { [s: string]: T; } | { [n: number]: T; }): T[]; (o: {}): any[]; }
>Object : ObjectConstructor
>values : <T extends object>(o: T) => T[keyof T][]
>values : { <T>(o: { [s: string]: T; } | { [n: number]: T; }): T[]; (o: {}): any[]; }
>o : { a: number; b: number; }

let y = x;
Expand All @@ -23,36 +23,36 @@ for (var x of Object.values(o)) {
var entries = Object.entries(o);
>entries : [string, number][]
>Object.entries(o) : [string, number][]
>Object.entries : <T extends object>(o: T) => [string, T[keyof T]][]
>Object.entries : { <T>(o: { [s: string]: T; } | { [n: number]: T; }): [string, T][]; (o: {}): [string, any][]; }
>Object : ObjectConstructor
>entries : <T extends object>(o: T) => [string, T[keyof T]][]
>entries : { <T>(o: { [s: string]: T; } | { [n: number]: T; }): [string, T][]; (o: {}): [string, any][]; }
>o : { a: number; b: number; }

var entries1 = Object.entries(1);
>entries1 : any
>Object.entries(1) : any
>Object.entries : <T extends object>(o: T) => [string, T[keyof T]][]
>entries1 : [string, any][]
>Object.entries(1) : [string, any][]
>Object.entries : { <T>(o: { [s: string]: T; } | { [n: number]: T; }): [string, T][]; (o: {}): [string, any][]; }
>Object : ObjectConstructor
>entries : <T extends object>(o: T) => [string, T[keyof T]][]
>entries : { <T>(o: { [s: string]: T; } | { [n: number]: T; }): [string, T][]; (o: {}): [string, any][]; }
>1 : 1

var entries2 = Object.entries({a: true, b: 2})
>entries2 : [string, number | boolean][]
>Object.entries({a: true, b: 2}) : [string, number | boolean][]
>Object.entries : <T extends object>(o: T) => [string, T[keyof T]][]
>Object.entries : { <T>(o: { [s: string]: T; } | { [n: number]: T; }): [string, T][]; (o: {}): [string, any][]; }
>Object : ObjectConstructor
>entries : <T extends object>(o: T) => [string, T[keyof T]][]
>entries : { <T>(o: { [s: string]: T; } | { [n: number]: T; }): [string, T][]; (o: {}): [string, any][]; }
>{a: true, b: 2} : { a: boolean; b: number; }
>a : boolean
>true : true
>b : number
>2 : 2

var entries3 = Object.entries({})
>entries3 : [string, any][]
>Object.entries({}) : [string, any][]
>Object.entries : <T extends object>(o: T) => [string, T[keyof T]][]
>entries3 : [string, {}][]
>Object.entries({}) : [string, {}][]
>Object.entries : { <T>(o: { [s: string]: T; } | { [n: number]: T; }): [string, T][]; (o: {}): [string, any][]; }
>Object : ObjectConstructor
>entries : <T extends object>(o: T) => [string, T[keyof T]][]
>entries : { <T>(o: { [s: string]: T; } | { [n: number]: T; }): [string, T][]; (o: {}): [string, any][]; }
>{} : {}

8 changes: 4 additions & 4 deletions tests/baselines/reference/useObjectValuesAndEntries4.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ var o = { a: 1, b: 2 };

for (var x of Object.values(o)) {
>x : Symbol(x, Decl(useObjectValuesAndEntries4.ts, 2, 8))
>Object.values : Symbol(ObjectConstructor.values, Decl(lib.es2017.object.d.ts, --, --))
>Object.values : Symbol(ObjectConstructor.values, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --))
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --))
>values : Symbol(ObjectConstructor.values, Decl(lib.es2017.object.d.ts, --, --))
>values : Symbol(ObjectConstructor.values, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --))
>o : Symbol(o, Decl(useObjectValuesAndEntries4.ts, 0, 3))

let y = x;
Expand All @@ -18,8 +18,8 @@ for (var x of Object.values(o)) {

var entries = Object.entries(o);
>entries : Symbol(entries, Decl(useObjectValuesAndEntries4.ts, 6, 3))
>Object.entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --))
>Object.entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --))
>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --))
>entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --))
>entries : Symbol(ObjectConstructor.entries, Decl(lib.es2017.object.d.ts, --, --), Decl(lib.es2017.object.d.ts, --, --))
>o : Symbol(o, Decl(useObjectValuesAndEntries4.ts, 0, 3))

8 changes: 4 additions & 4 deletions tests/baselines/reference/useObjectValuesAndEntries4.types
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ var o = { a: 1, b: 2 };
for (var x of Object.values(o)) {
>x : number
>Object.values(o) : number[]
>Object.values : <T extends object>(o: T) => T[keyof T][]
>Object.values : { <T>(o: { [s: string]: T; } | { [n: number]: T; }): T[]; (o: {}): any[]; }
>Object : ObjectConstructor
>values : <T extends object>(o: T) => T[keyof T][]
>values : { <T>(o: { [s: string]: T; } | { [n: number]: T; }): T[]; (o: {}): any[]; }
>o : { a: number; b: number; }

let y = x;
Expand All @@ -23,8 +23,8 @@ for (var x of Object.values(o)) {
var entries = Object.entries(o);
>entries : [string, number][]
>Object.entries(o) : [string, number][]
>Object.entries : <T extends object>(o: T) => [string, T[keyof T]][]
>Object.entries : { <T>(o: { [s: string]: T; } | { [n: number]: T; }): [string, T][]; (o: {}): [string, any][]; }
>Object : ObjectConstructor
>entries : <T extends object>(o: T) => [string, T[keyof T]][]
>entries : { <T>(o: { [s: string]: T; } | { [n: number]: T; }): [string, T][]; (o: {}): [string, any][]; }
>o : { a: number; b: number; }

0 comments on commit 4bb3c90

Please sign in to comment.