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

Side by Side Diff: test/mjsunit/es6/typedarray.js

Issue 1712163002: [builtins] Migrate the DataView constructor to C++. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « src/runtime/runtime-typedarray.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 assertSame(0, d3c.byteLength); 667 assertSame(0, d3c.byteLength);
668 668
669 var d4 = new DataView(ab, 1, 3.1415926); 669 var d4 = new DataView(ab, 1, 3.1415926);
670 assertSame(ab, d4.buffer); 670 assertSame(ab, d4.buffer);
671 assertSame(1, d4.byteOffset); 671 assertSame(1, d4.byteOffset);
672 assertSame(3, d4.byteLength); 672 assertSame(3, d4.byteLength);
673 673
674 674
675 // error cases 675 // error cases
676 assertThrows(function() { new DataView(ab, -1); }, RangeError); 676 assertThrows(function() { new DataView(ab, -1); }, RangeError);
677 assertThrows(function() { new DataView(ab, 1, -1); }, RangeError);
678 assertThrows(function() { new DataView(); }, TypeError); 677 assertThrows(function() { new DataView(); }, TypeError);
679 assertThrows(function() { new DataView([]); }, TypeError); 678 assertThrows(function() { new DataView([]); }, TypeError);
680 assertThrows(function() { new DataView(ab, 257); }, RangeError); 679 assertThrows(function() { new DataView(ab, 257); }, RangeError);
681 assertThrows(function() { new DataView(ab, 1, 1024); }, RangeError); 680 assertThrows(function() { new DataView(ab, 1, 1024); }, RangeError);
682 } 681 }
683 682
684 TestDataViewConstructor(); 683 TestDataViewConstructor();
685 684
686 function TestDataViewPropertyTypeChecks() { 685 function TestDataViewPropertyTypeChecks() {
687 var a = new DataView(new ArrayBuffer(10)); 686 var a = new DataView(new ArrayBuffer(10));
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 769
771 function TestNonConfigurableProperties(constructor) { 770 function TestNonConfigurableProperties(constructor) {
772 var arr = new constructor([100]) 771 var arr = new constructor([100])
773 assertFalse(Object.getOwnPropertyDescriptor(arr,"0").configurable) 772 assertFalse(Object.getOwnPropertyDescriptor(arr,"0").configurable)
774 assertFalse(delete arr[0]) 773 assertFalse(delete arr[0])
775 } 774 }
776 775
777 for(i = 0; i < typedArrayConstructors.length; i++) { 776 for(i = 0; i < typedArrayConstructors.length; i++) {
778 TestNonConfigurableProperties(typedArrayConstructors[i]); 777 TestNonConfigurableProperties(typedArrayConstructors[i]);
779 } 778 }
OLDNEW
« no previous file with comments | « src/runtime/runtime-typedarray.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698