Properties of Function instances

Allen Wirfs-Brock allen at wirfs-brock.com
Sat Feb 12 17:01:06 PST 2011


(we should probably start pushing test262 conversations to test262-discuss)


I'm pretty sure that this test is a leftover from Pratap's original ES3.1 test suite and at the time it was written Function.prototype.name was still in the draft.

Tests 15.2.3.3-4-4 through 15.2.3.3-4-228 are of probably assigned to section 15.2.3.3.  They test using getOwnPropertyDescriptor the attribute of every built-in function.  It would probably be easier to manage them built-in are added by associating such tests with the specification section for each function.

As as I pointed out to server different test writers, it is sufficient to just use getOwnPropertyDescriptor to verify the specified attributes.  It could report the correct attribute values even though the attribute settings aren't  being respected by the implementation.   This is an example where a parameterized set of tests would be useful.

 Allen




On Feb 12, 2011, at 4:29 PM, Brendan Eich wrote:

> On Feb 12, 2011, at 1:28 AM, David Bruant wrote:
> 
>> Hi,
>> 
>> Test 15.2.3.3-4-188 (http://hg.ecmascript.org/tests/test262/file/f25942ef2292/test/suite/ietestcenter/chapter15/15.2/15.2.3/15.2.3.3/15.2.3.3-4-188.js) assumes that a function object having 'name' property is forbidden. The spec doesn't say a word on implementation-defined properties for functions (or any other objects ?).
> 
> In fact Clause 16 says:
> 
> "An implementation may provide additional types, values, objects, properties, and functions beyond those described in this specification."
> 
> 
>> Can implementations had any implementation-defined property?
> 
> See above. In the modern era, it's frowned upon. The name property of function objects is ancient, it predates ES1 if my aging memory is accurate. So it's more of a de-facto standard. It is being considered for Harmony:
> 
> http://wiki.ecmascript.org/doku.php?id=strawman:name_property_of_functions
> 
> 
>> The underlying question being: is this test valid?
> 
> The test is not testing anything required by the spec. It would be good to hear from someone involved in creating this test, in case the spec has unclear language that could be improved.
> 
> /be
> _______________________________________________
> es5-discuss mailing list
> es5-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es5-discuss



More information about the test262-discuss mailing list