Fix #13932: Change the order of overloads and allow union for Object.create

This commit is contained in:
Mohamed Hegazy
2017-02-07 14:07:55 -08:00
parent a7728f8fa1
commit ab60d319b2
12 changed files with 518 additions and 8 deletions
+8 -8
View File
@@ -137,17 +137,17 @@ interface ObjectConstructor {
getOwnPropertyNames(o: any): string[];
/**
* Creates an object that has null prototype.
* @param o Object to use as a prototype. May be null
*/
create(o: null): any;
/**
* Creates an object that has the specified prototype, and that optionally contains specified properties.
* @param o Object to use as a prototype. May be null
* Creates an object that has the specified prototype.
* @param o Object to use as a prototype.
*/
create<T extends object>(o: T): T;
/**
* Creates an object that has the specified prototype or that has null prototype.
* @param o Object to use as a prototype. May be null.
*/
create<T extends object>(o: T | null): T | object;
/**
* Creates an object that has the specified prototype, and that optionally contains specified properties.
* @param o Object to use as a prototype. May be null