Throw if first argument to TypedArray.set is a number.
authordslomov@chromium.org <dslomov@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 16 Jul 2013 08:11:30 +0000 (08:11 +0000)
committerdslomov@chromium.org <dslomov@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 16 Jul 2013 08:11:30 +0000 (08:11 +0000)
commit11a38ed875261707b760233f40f8d213451312c0
tree273ab282b7a6aeaed6b1fbdab2502e2561edb5d1
parentc0637c1828fdadd7c1b49d71d39c9d5070ea0d7c
Throw if first argument to TypedArray.set is a number.

Further refinement to semantics that I have missed in previous change.
Both Blink and Firefox are permissive with arguments to .set method.
However, when first argument to "set" is a number, all implementations
throw, so that users know that
   a.set(0,27)
does not assign 27 to 0th element of a, not 0 to 27th element of a.

R=bmeurer@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15684 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
src/typedarray.js
test/mjsunit/external-array-no-sse2.js
test/mjsunit/external-array.js
test/mjsunit/harmony/typedarrays.js