When the getOwnPropertyDescriptors function is called, the following steps are taken:
- Let obj be ToObject(O).
- ReturnIfAbrupt(obj).
- Let keys be the result of calling the [[OwnPropertyKeys]] internal method of obj.
- ReturnIfAbrupt(keys).
- Let descriptors be the result of ObjectCreate(null).
- Let gotAllNames be false.
- Repeat while gotAllNames is false,
1. Let next be the result of IteratorStep(keys).
1. ReturnIfAbrupt( next ).
1. If next is false, then let gotAllNames be true.
1. Else,
- Let nextKey be IteratorValue(next).
- Let nextKey be ToPropertyKey(nextKey).
- ReturnIfAbrupt(nextKey).
- Let desc be the result of calling the [[GetOwnProperty]] internal method of obj with argument nextKey.
- ReturnIfAbrupt(desc).
- Let descriptor be FromPropertyDescriptor(desc).
- ReturnIfAbrupt(descriptor).
- Let status be the result of CreateDataProperty(descriptors, nextKey, descriptor).
- Assert: status is not an abrupt completion.
- Return descriptors.
ok, this version should be a no-brainer and the simpler I could think of for such specification. Thanks again, feel free to let me know if I forgot something