W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2014

Re: Iterating over the properties of an ECMAScript object

From: Brian Birtles <bbirtles@mozilla.com>
Date: Fri, 18 Apr 2014 12:58:11 +0900
Message-ID: <5350A2D3.6040205@mozilla.com>
To: David Bruant <bruant.d@gmail.com>, public-script-coord@w3.org
Hi David,

(2014/04/17 17:13), David Bruant wrote:
 > ...
> I think that for this sort of cases, it makes sense to visit inherited
> properties (so authors can define a default set of properties and
> override via prototype shadowing creating an object with
> `Object.create(defaultObj)`)
> ES6 defines an internal [[Enumerate]] operation for all objects
> http://people.mozilla.org/~jorendorff/es6-draft.html#sec-ordinary-object-internal-methods-and-internal-slots-enumerate
>
> It's what is used by for-in loops (enumerate over own and inherited
> enumerable properties). Maybe that's what you should use.

Thanks David! That makes sense. I've updated the spec to use 
[[Enumerate]] instead of Object.keys().

Thanks again,

Brian
Received on Friday, 18 April 2014 03:58:43 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:21 UTC