1Object.getOwnPropertyDescriptors ( O )#
When the getOwnPropertyDescriptors
function is called, the following steps are taken:
- Let obj be ?
ToObject(O).
- Let ownKeys be ? obj.[[OwnPropertyKeys]]().
- Let descriptors be !
ObjectCreate(
%ObjectPrototype%).
- Repeat, for each element key of ownKeys in
List order,
- Let desc be ? obj.[[GetOwnProperty]](key).
- Let descriptor be !
FromPropertyDescriptor(desc).
- Perform !
CreateDataProperty(descriptors, key, descriptor).
- Return descriptors.