archives

« Bugzilla Issues Index

#1578 — Add some tests for frozen arrays and non-extensible objects.


Created attachment 67
Tests for frozen arrays and non-extensible objects

Adds tests:
* to S8.6.2 that non-extensible objects cannot be mutated using defineProperty.
* to S15.4.4.6 that a frozen array cannot be modified by pop().

Patch also uploaded to http://codereview.appspot.com/11249043 for easier review.


LGTM. See my comments on the codereview site.


LGTM, although the location of the __proto__ tests is suspicious. Should the __proto__ tests be put into an AnnexB folder maybe?


(In reply to comment #2)
> LGTM, although the location of the __proto__ tests is suspicious. Should the
> __proto__ tests be put into an AnnexB folder maybe?

As of ES5 the existence of __proto__ is non-normative, so this would seem attractive. However, the requirement that non-extensible objects cannot have their [[Prototype]] mutated is normative. This test tests for a violation of that requirement, so I think it is in the right place.


Ok, I agree that makes sense Mark. In that case, please make these tests strict-mode only (add "use strict" directive, and there's also an @onlyStrict attribute). Non-strict assignment to non-extensible object shouldn't throw I believe.


Good point about non-strict. Yes, these tests should be @onlyStrict.


As of 2014-Jul-18, these tests are not in test262.

I would be willing to convert the patch into a github pull request.