Skip to content

Commit de313ff

Browse files
avchugaevmhegazy
authored andcommitted
Object.getOwnPropertyDescriptor() returns 'undefined' if property descriptor not found. (#18148)
1 parent c1f2afd commit de313ff

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/lib/es2015.core.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ interface ObjectConstructor {
327327
* @param o Object that contains the property.
328328
* @param p Name of the property.
329329
*/
330-
getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor;
330+
getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor | undefined;
331331

332332
/**
333333
* Adds a property to an object, or modifies attributes of an existing property.

src/lib/es2015.reflect.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ declare namespace Reflect {
44
function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
55
function deleteProperty(target: object, propertyKey: PropertyKey): boolean;
66
function get(target: object, propertyKey: PropertyKey, receiver?: any): any;
7-
function getOwnPropertyDescriptor(target: object, propertyKey: PropertyKey): PropertyDescriptor;
7+
function getOwnPropertyDescriptor(target: object, propertyKey: PropertyKey): PropertyDescriptor | undefined;
88
function getPrototypeOf(target: object): object;
99
function has(target: object, propertyKey: PropertyKey): boolean;
1010
function isExtensible(target: object): boolean;

src/lib/es5.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ interface ObjectConstructor {
127127
* @param o Object that contains the property.
128128
* @param p Name of the property.
129129
*/
130-
getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor;
130+
getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor | undefined;
131131

132132
/**
133133
* Returns the names of the own properties of an object. The own properties of an object are those that are defined directly

0 commit comments

Comments
 (0)