For simple "flat" collections of properties we want to enabling enumerating over them using the array functions instead of for-in but also to ensure that the processing order would be the same regardless of which technique was used. Use in conjunction with the "Array extras" was contemplated.
We wanted to provide a function for use in application code that was guaranteed to order the own property names of an object in the same implementation specific order used by for-in. Nice theory, but not the way it actually went down. And I assumed that it was ported as is only because to support compatibility with the Prototype.js. It was just ported "as is", though, IMO, when it was porting, it with the same success could accept this additional parameter. No, I just explained from where the roots of Object.keys() - from Prototype.js.
On Sep 7, 2011, at 11:27 AM, Dmitry Soshnikov wrote: > NOTE Implementations that add additional capabilities to the set of built-in functions are encouraged to do so by adding new functions rather than adding new parameters to existing functions. > If you mean that an ES5-conforming implementation could add an optional boolean parameter to Object.keys, to get inherited enumerable properties too, then please, no: that is against the NOTE in Clause 15 (quoting from ES5.1): But IMO, yes, native implementation could provide at least an option for this case (if needed). I guess it was ported "as is" for compatibility with the library. > Because it's the same version that is from Prototype.js. > Why does Object.keys() not allow, as an option, iterating through inherited properties?
> On Sep 7, 2011, at 9:29 AM, Dmitry Soshnikov wrote: Yes, of course, I think it's way it should be. NOTE Implementations that add additional capabilities to the set of built-in functions are encouraged to do so by adding new functions rather than adding new parameters to existing functions. Support compatibility with the Prototype.js. And I assumed that it was ported as is only because to Porting, it with the same success could accept this additional It was just ported "as is", though, IMO, when it was No, I just explained from where the roots of Object.keys() - from If you mean that an ES5-conforming implementation could add an optional boolean parameter to Object.keys, to get inherited enumerable properties too, then please, no: that is against the NOTE in Clause 15 (quoting from ES5.1): Why does Object.keys() not allow, as an option, iterating through inherited properties?īecause it's the same version that is from Prototype.js. On Sep 7, 2011, at 9:29 AM, Dmitry Soshnikov wrote: > I think we should make this a normative restriction in ES6. > than adding new parameters to existing functions. > built-in functions are encouraged to do so by adding new functions rather > NOTE Implementations that add additional capabilities to the set of In this case, it is precisely the mapping of suchĪbilities onto capabilities that is at stake ). Restricted somehow, these two are still a great start.ītw, to avoid terminology confusion, I use "abilities" in sentences like I'm sure this list is incomplete, and the Ch16 exemptions need to be further I believe these two constraints together are equivalent to the constraintsĮnumerated at /p/es-lab/wiki/SecureableES5. To normative status, so that such whitelisting mechanisms are possible. We should also promote the recommendation at If implementors might still enable new abilities by, e.g., type-based
InĪddition to removing everything absent from our whitelist, we'd have to wrapĮverything present on our whitelist. While weĬould instead whitelist by name+arity, it would be a too expensive. Only protects under the assumption that this restriction is upheld. The SES whitelisting mechanism, where we remove all non-standard properties I think we should make this a normative restriction in ES6. Than adding new parameters to existing functions. NOTE Implementations that add additional capabilities to the set ofīuilt-in functions are encouraged to do so by adding new functions rather