From ccec13aaf151d444defe42fde6860ffddb8cc6f1 Mon Sep 17 00:00:00 2001 From: Andrew Stegmaier Date: Mon, 8 May 2017 23:56:29 -0700 Subject: [PATCH] getOwnPropertyDescriptor return should allow undefined getOwnPropertyDescriptor _should_ return undefined in certain situations. This is documented here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler/getOwnPropertyDescriptor This change addresses https://github.com/Microsoft/TypeScript/issues/14923 and https://github.com/Microsoft/TypeScript/issues/10904. The original fix to 14923 was to the /lib/lib.es2015.proxy.d.ts file instead of /src/lib/lib.es2015.proxy.d.ts (see: https://github.com/Microsoft/TypeScript/pull/10550/commits). I think this meant that the change got over-written by a generation script (see note here: https://github.com/Microsoft/TypeScript/tree/master/lib) --- src/lib/es2015.proxy.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/es2015.proxy.d.ts b/src/lib/es2015.proxy.d.ts index 34aedce0128..67595021346 100644 --- a/src/lib/es2015.proxy.d.ts +++ b/src/lib/es2015.proxy.d.ts @@ -3,7 +3,7 @@ interface ProxyHandler { setPrototypeOf? (target: T, v: any): boolean; isExtensible? (target: T): boolean; preventExtensions? (target: T): boolean; - getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor; + getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor | undefined; has? (target: T, p: PropertyKey): boolean; get? (target: T, p: PropertyKey, receiver: any): any; set? (target: T, p: PropertyKey, value: any, receiver: any): boolean;