var l = obj.length;
if (IS_UNDEFINED(l)) {
- throw MakeTypeError("invalid_argument");
+ return;
}
if (intOffset + l > this.length) {
throw MakeRangeError("typed_array_set_source_too_large");
assertArrayPrefix([1, 12], a61)
// Invalid source
-assertThrows(function() { a.set(0) })
-assertThrows(function() { a.set({}) })
+a.set(0); // does not throw
+assertArrayPrefix([1,2,3,4,5,6], a);
+a.set({}); // does not throw
+assertArrayPrefix([1,2,3,4,5,6], a);
// Test arraybuffer.slice
assertArrayPrefix([1, 12], a61)
// Invalid source
-assertThrows(function() { a.set(0) })
-assertThrows(function() { a.set({}) })
+a.set(0); // does not throw
+assertArrayPrefix([1,2,3,4,5,6], a);
+a.set({}); // does not throw
+assertArrayPrefix([1,2,3,4,5,6], a);
// Test arraybuffer.slice
// 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);
}