Properties of Function instances
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 22.214.171.124-4-4 through 126.96.36.199-4-228 are of probably assigned to section 188.8.131.52. 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.
On Feb 12, 2011, at 4:29 PM, Brendan Eich wrote:
> On Feb 12, 2011, at 1:28 AM, David Bruant wrote:
>> Test 184.108.40.206-4-188 (http://hg.ecmascript.org/tests/test262/file/f25942ef2292/test/suite/ietestcenter/chapter15/15.2/15.2.3/220.127.116.11/18.104.22.168-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:
>> 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.
> es5-discuss mailing list
> es5-discuss at mozilla.org
More information about the test262-discuss