3
Vote

Tests 10.6-13-b-3-s and 10.6-13-c-3-s reference nonexistent property "put"

description

The tests 10.6-13-b-3-s and 10.6-13-c-3-s call Object.getOwnPropertyDescriptor to determine whether "arguments.callee" and "arguments.caller" are configurable. However, they check for the existence of the property "put". The correct property to check for is "set".

file attachments

comments

jwalden wrote Jan 1, 2011 at 9:30 PM

This patch fixes this issue, among many, many more. (I think it's near-complete as far as fixing broken tests goes -- with fixes in my tree we pass all but fourteen tests, and a number of those are due to bugs not fixed in my tree.) It would be better to attach a patch to every relevant item, but it's a large enough list I'm not really motivated to do so. ;-) I'll add comments to the issues pointing to this patch instead.

paulbartrum wrote Jan 2, 2011 at 12:06 PM

Thanks Jeff. With your patch applied my ES5 implementation (http://jurassic.codeplex.com) fails 13 tests (down from 45). Two are known bugs with my implementation - the rest are currently outstanding issues on this issue tracker (6 issues covering 11 tests). By the way, your patch exposed a bug in my strict mode implementation, so thanks for your hard work!

In case you are interested, here are the eleven tests that I believe are still buggy (of course I am only picking up false negatives, not false positives):
11.4.1-4.a-4-s // assumes this refers to global object - http://es5conform.codeplex.com/workitem/29151
11.4.1-5-1-s // assumes delete var produces ReferenceError - http://es5conform.codeplex.com/workitem/29084
11.4.1-5-2-s // assumes delete var produces ReferenceError - http://es5conform.codeplex.com/workitem/29084
11.4.1-5-3-s // assumes delete var produces ReferenceError - http://es5conform.codeplex.com/workitem/29084
11.13.1-1-7-s // assumes this is undefined - http://es5conform.codeplex.com/workitem/29152
11.13.1-4-2-s // gets global object incorrectly - http://es5conform.codeplex.com/workitem/29087
11.13.1-4-27-s // gets global object incorrectly - http://es5conform.codeplex.com/workitem/29087
11.13.1-4-3-s // gets global object incorrectly - http://es5conform.codeplex.com/workitem/29087
11.13.1-4-4-s // gets global object incorrectly - http://es5conform.codeplex.com/workitem/29087
15.2.3.3-4-188 // assumes Function.prototype.name does not exist - http://es5conform.codeplex.com/workitem/28594
15.4.4.14-9.a-1 // placeholder test - http://es5conform.codeplex.com/workitem/29102

jwalden wrote Jan 3, 2011 at 8:10 PM

Here are SpiderMonkey's results, for what it's worth, with all my patches (all attached to bugs, most waiting to be reviewed, one almost at the ready-to-attach stage, one very hackish patch that probably needs more work):

We fail these valid tests (tho I believe there's a patch, awaiting my review, to fix all these):

FAIL: 15.4.4.14-1-1 Array.prototype.indexOf applied to undefined throws a TypeError
FAIL: 15.4.4.14-1-2 Array.prototype.indexOf applied to null throws a TypeError
FAIL: 15.5.4.20-1-2 String.prototype.trim throws TypeError when string is null
FAIL: 15.5.4.20-1-1 String.prototype.trim throws TypeError when string is undefined

These tests seem invalid to me if you don't extend ES5:

FAIL: 15.2.3.3-4-188 Object.getOwnPropertyDescriptor returns undefined for non-existent properties on built-ins (Function (instance).name)
FAIL: 15.2.3.3-4-184 Object.getOwnPropertyDescriptor returns undefined for non-existent properties on built-ins (Function.caller)
FAIL: 15.2.3.3-4-183 Object.getOwnPropertyDescriptor returns undefined for non-existent properties on built-ins (Function.arguments)

These tests are nearly-valid, but I just didn't fix them in the patch:

FAIL: 11.4.1-4.a-4-s delete operator throws TypeError when when deleting a non-configurable data property in strict mode (Global.NaN)
FAIL: 11.13.1-4-2-s simple assignment throws TypeError if LeftHandSide is a readonly property in strict mode (Global.NaN)
FAIL: 11.13.1-4-3-s simple assignment throws TypeError if LeftHandSide is a readonly property in strict mode (Global.Infinity)
FAIL: 11.13.1-4-4-s simple assignment throws TypeError if LeftHandSide is a readonly property in strict mode (Global.length)
FAIL: 11.13.1-1-7-s simple assignment throws TypeError if LeftHandSide is a property reference with a primitive base value (this is undefined)
FAIL: 11.13.1-4-27-s simple assignment throws TypeError if LeftHandSide is a readonly property in strict mode (Global.undefined)
PRECONDITION FAILED: 15.4.4.14-9.a-1 Need to define a quality of implementation test that makes sure that it doesn't take forever to process very large but very sparse arrays

These tests are the delete-name-is-early-error disagreement:

TestCases/chapter11/11.4/11.4.1/11.4.1-5-2-s.js<span style="color:red"> Missing test: either misidentifed or could not load because of unexpected syntax error</span>
TestCases/chapter11/11.4/11.4.1/11.4.1-5-3-s.js<span style="color:red"> Missing test: either misidentifed or could not load because of unexpected syntax error</span>
TestCases/chapter11/11.4/11.4.1/11.4.1-5-1-s.js<span style="color:red"> Missing test: either misidentifed or could not load because of unexpected syntax error</span>

This test probably works in a browser, but I generally don't test browser until I have a working patch for a much smaller, less hairy shell environment (plus browser takes a lot longer to build):

FAILED WITH EXCEPTION: WINDOW IS NOT DEFINED: 11.13.1-4-1 simple assignment creates property on the global object if LeftHandSide is an unresolvable reference

So aside from the two tests that expect no Function.caller/Function.arguments (this is outside the spec, which permits additional properties here and doesn't specify that these exist, as Function is not a function created through 13.something), we are in agreement as to what tests are bad and what tests are good. Or, rather, our implementations plus a little manual testing are in agreement.

wrote Feb 4, 2011 at 9:34 PM

wrote Feb 13, 2013 at 2:09 AM