Merge pull request #12434 from Microsoft/Fix12377

Add special handeling for function and array in Object.freeze
This commit is contained in:
Mohamed Hegazy
2016-11-23 13:26:36 -08:00
committed by GitHub
4 changed files with 75 additions and 0 deletions

12
src/lib/es5.d.ts vendored
View File

@@ -176,6 +176,18 @@ interface ObjectConstructor {
*/
seal<T>(o: T): T;
/**
* Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
* @param o Object on which to lock the attributes.
*/
freeze<T>(a: T[]): ReadonlyArray<T>;
/**
* Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
* @param o Object on which to lock the attributes.
*/
freeze<T extends Function>(f: T): T;
/**
* Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
* @param o Object on which to lock the attributes.