Fix issue 720 making Object.defineProperty handle existing writable flags correctly.
authorricow@chromium.org <ricow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 26 May 2010 08:31:57 +0000 (08:31 +0000)
committerricow@chromium.org <ricow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 26 May 2010 08:31:57 +0000 (08:31 +0000)
commit95939ada294a20707a851cae3c8a86a9a5e9d507
treed8b5d59196570be51132018740eb96e4d5b788e6
parent909a447b100ec5d1beaf6bf97dea3f75d1b89c97
Fix issue 720 making Object.defineProperty handle existing writable flags correctly.

The existing version will overwrite the existing writable flag with
false even in the case where no new value is given and the existing
writable flag is true.

The reason for the issue is that there is no check to see if the
provided descriptor actually has a writable attribute. This causes us
to use the default value (false) even in the case where nothing was
provided. In addition, the existing tests makes wrong assumptions (that writable is always set to false if not provided) and has been changed to follow the specification.

Review URL: http://codereview.chromium.org/2271001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4720 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
src/v8natives.js
test/mjsunit/object-define-property.js
test/mjsunit/regress/regress-720.js [new file with mode: 0644]