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

Side by Side Diff: test/mjsunit/external-array-no-sse2.js

Issue 19210002: Throw if first argument to TypedArray.set is a number. (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 599
600 // Mixed types of same size. 600 // Mixed types of same size.
601 var a61 = new Float32Array([1.2, 12.3]) 601 var a61 = new Float32Array([1.2, 12.3])
602 var a62 = new Int32Array(2) 602 var a62 = new Int32Array(2)
603 a62.set(a61) 603 a62.set(a61)
604 assertArrayPrefix([1, 12], a62) 604 assertArrayPrefix([1, 12], a62)
605 a61.set(a62) 605 a61.set(a62)
606 assertArrayPrefix([1, 12], a61) 606 assertArrayPrefix([1, 12], a61)
607 607
608 // Invalid source 608 // Invalid source
609 a.set(0); // does not throw 609 assertThrows(function() { a.set(0); }, TypeError);
610 assertArrayPrefix([1,2,3,4,5,6], a); 610 assertArrayPrefix([1,2,3,4,5,6], a);
611 a.set({}); // does not throw 611 a.set({}); // does not throw
612 assertArrayPrefix([1,2,3,4,5,6], a); 612 assertArrayPrefix([1,2,3,4,5,6], a);
613 613
614 614
615 // Test arraybuffer.slice 615 // Test arraybuffer.slice
616 616
617 var a0 = new Int8Array([1, 2, 3, 4, 5, 6]) 617 var a0 = new Int8Array([1, 2, 3, 4, 5, 6])
618 var b0 = a0.buffer 618 var b0 = a0.buffer
619 619
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 672
673 built_in_array = new Array(1.5, 2, 3, 4, 5, 6); 673 built_in_array = new Array(1.5, 2, 3, 4, 5, 6);
674 assertEquals(1.5, goo(built_in_array, 0)); 674 assertEquals(1.5, goo(built_in_array, 0));
675 assertEquals(1.5, goo(built_in_array, 0)); 675 assertEquals(1.5, goo(built_in_array, 0));
676 %OptimizeFunctionOnNextCall(goo); 676 %OptimizeFunctionOnNextCall(goo);
677 %OptimizeFunctionOnNextCall(boo); 677 %OptimizeFunctionOnNextCall(boo);
678 boo(built_in_array, 0, 2.5); 678 boo(built_in_array, 0, 2.5);
679 assertEquals(2.5, goo(built_in_array, 0)); 679 assertEquals(2.5, goo(built_in_array, 0));
680 %ClearFunctionTypeFeedback(goo); 680 %ClearFunctionTypeFeedback(goo);
681 %ClearFunctionTypeFeedback(boo); 681 %ClearFunctionTypeFeedback(boo);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698