Maybe we need a reflect API to iterate over instance members

Domenic Denicola d at domenic.me
Mon Jun 1 06:38:15 UTC 2015


From: es-discuss [mailto:es-discuss-bounces at mozilla.org] On Behalf Of Gray Zhang

> I’m just wondering is there any reason that Reflect API is not suitable to provide such functionality?

Reflect currently contains only methods which correspond to proxy traps. There has been talk of extending it beyond that, but making that first step is going to be a hurdle for whoever’s proposing it to extend it. A better place for such methods might be Object.* or some new module or global.

However, in the end, what you need to do to get something into the language is to prove that it's a common enough need that it's worth adding complexity to the spec and implementations. This thread is very far from doing that. A better start would be surveying open-source code to find usages of this kind of functionality.
 


More information about the es-discuss mailing list