Make Array.prototype.pop throw if the last element is not configurable.
authoryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 23 Oct 2013 16:19:24 +0000 (16:19 +0000)
committeryangguo@chromium.org <yangguo@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 23 Oct 2013 16:19:24 +0000 (16:19 +0000)
commite25920da19353ff83f3ad235461dec45e8f5d277
treeeb50ada0f7d1280e95c3cb1e9d1c04eadb6cf1bc
parent8259439ae88bdb078a3786c03c2a134c14aa22a6
Make Array.prototype.pop throw if the last element is not configurable.
Popping an element from an array should call [[Delete]] internal method
and pass true as the second argument (ECMA-262/5.1/#sec-15.4.4.6).
When the last element can't be deleted, throw a Type Error.
Not throwing the error would result in endless loop in the following test.

TEST=var a=[];Object.defineProperty(a,0,{});while(a.length)a.pop();

By the way fix another bug, or else i can't post any issues.
"presubmit.py" throw a "missing a correct copyright header" on windows.
Both the slash and the backslash are valid path separator on windows.

R=yangguo@chromium.org

Review URL: https://codereview.chromium.org/29513004

Patch from Yanagi <admin@web-tinker.com>.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17346 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
src/array.js
test/mjsunit/regress/regress-array-pop-nonconfigurable.js [new file with mode: 0644]
tools/presubmit.py