Add ToObject call in Array.prototype.sort
authordehrenberg <dehrenberg@chromium.org>
Thu, 11 Jun 2015 21:43:08 +0000 (14:43 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 11 Jun 2015 21:43:21 +0000 (21:43 +0000)
commitcbf9137707edcc6c4e09b2a680667a52c3226621
treefd69d030a0f7f998f05fa04b32be9786c8bddb8d
parent5f72593d166e1d604d6061573bd220da5ce64db4
Add ToObject call in Array.prototype.sort

The spec says ToObject is called on the receiver, and this is
observable if you call sort on a primitive. This patch trivially
adds the call and a test.

BUG=v8:4125
R=adamk
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#28972}
src/array.js
test/mjsunit/array-sort.js