Skip to content

Commit ccec13a

Browse files
authored
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 #14923 and #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)
1 parent 9a62db2 commit ccec13a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/es2015.proxy.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ interface ProxyHandler<T> {
33
setPrototypeOf? (target: T, v: any): boolean;
44
isExtensible? (target: T): boolean;
55
preventExtensions? (target: T): boolean;
6-
getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor;
6+
getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor | undefined;
77
has? (target: T, p: PropertyKey): boolean;
88
get? (target: T, p: PropertyKey, receiver: any): any;
99
set? (target: T, p: PropertyKey, value: any, receiver: any): boolean;

0 commit comments

Comments
 (0)