Re: Iterating over the properties of an ECMAScript object

Hi Rick,

Thank you very much for your mail.

(2014/04/18 3:08), Rick Waldron wrote:
 > ...
> Agreed, and a step further would be to specify that only valid
> properties are recognized. Here's a naive hack to illustrate:

I might have misunderstood this point.

The algorithm in 5.15.2[1] begins by creating a list of supported 
property names and only calling [[Get]] on properties in the input 
object whose property name is in the list of supported property names.

It still iterates over the list of properties in the input object (not 
the list of supported property names) for performance reasons: in the 
common case, the input object only has one or two properties whilst the 
list of supported property names is long and is expected to grow over time.

Does that match what you had in mind?

Thanks again,

Brian

[1] http://dev.w3.org/fxtf/web-animations/#processing-a-keyframe-object
(Unfortunately, named anchors don't currently work very well but it's 
section 5.15.2, Processing a Keyframe object)

Received on Friday, 18 April 2014 04:05:05 UTC