Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1026)

Unified Diff: test/mjsunit/harmony/typedarrays.js

Issue 19086003: TypedArray.set function should ignore non-array-like arguments instead of throwing. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/external-array-no-sse2.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/typedarrays.js
diff --git a/test/mjsunit/harmony/typedarrays.js b/test/mjsunit/harmony/typedarrays.js
index 99364c8101757a2b3b178807e3a88e22664adbd4..8e8ec5748b472a9c47061da7546c713103992b5f 100644
--- a/test/mjsunit/harmony/typedarrays.js
+++ b/test/mjsunit/harmony/typedarrays.js
@@ -453,8 +453,15 @@ function TestTypedArraySet() {
// Invalid source
var a = new Uint16Array(50);
- assertThrows(function() { a.set(0) }, TypeError);
- assertThrows(function() { a.set({}) }, TypeError);
+ var expected = [];
+ for (i = 0; i < 50; i++) {
+ a[i] = i;
+ expected.push(i);
+ }
+ a.set(0);
+ assertArrayPrefix(expected, a);
+ a.set({});
+ assertArrayPrefix(expected, a);
assertThrows(function() { a.set.call({}) }, TypeError);
assertThrows(function() { a.set.call([]) }, TypeError);
}
« no previous file with comments | « test/mjsunit/external-array-no-sse2.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698