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 13:04:35 +0900
Message-ID: <5350A453.9080104@mozilla.com>
To: Rick Waldron <waldron.rick@gmail.com>, David Bruant <bruant.d@gmail.com>
CC: "public-script-coord@w3.org" <public-script-coord@w3.org>
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

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