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

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

Issue 2090353003: Amend DataView, ArrayBuffer, and TypedArray methods to use ToIndex. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: enable test Created 4 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
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 26 matching lines...) Expand all
37 TestByteLength(256, 256); 37 TestByteLength(256, 256);
38 TestByteLength(2.567, 2); 38 TestByteLength(2.567, 2);
39 39
40 TestByteLength("abc", 0); 40 TestByteLength("abc", 0);
41 41
42 TestByteLength(0, 0); 42 TestByteLength(0, 0);
43 43
44 assertThrows(function() { new ArrayBuffer(-10); }, RangeError); 44 assertThrows(function() { new ArrayBuffer(-10); }, RangeError);
45 assertThrows(function() { new ArrayBuffer(-2.567); }, RangeError); 45 assertThrows(function() { new ArrayBuffer(-2.567); }, RangeError);
46 46
47 /* TODO[dslomov]: Reenable the test
48 assertThrows(function() { 47 assertThrows(function() {
49 var ab1 = new ArrayBuffer(0xFFFFFFFFFFFF) 48 var ab1 = new ArrayBuffer(0xFFFFFFFFFFFF)
50 }, RangeError); 49 }, RangeError);
Dan Ehrenberg 2016/06/23 21:45:32 Eh, can you run this with msan or something before
bakkot 2016/06/28 23:41:07 Yes indeed; fails with "MemorySanitizer failed to
51 */
52 50
53 var ab = new ArrayBuffer(); 51 var ab = new ArrayBuffer();
54 assertSame(0, ab.byteLength); 52 assertSame(0, ab.byteLength);
55 assertEquals("[object ArrayBuffer]", 53 assertEquals("[object ArrayBuffer]",
56 Object.prototype.toString.call(ab)); 54 Object.prototype.toString.call(ab));
57 } 55 }
58 56
59 TestArrayBufferCreation(); 57 TestArrayBufferCreation();
60 58
61 function TestByteLengthNotWritable() { 59 function TestByteLengthNotWritable() {
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 765
768 function TestNonConfigurableProperties(constructor) { 766 function TestNonConfigurableProperties(constructor) {
769 var arr = new constructor([100]) 767 var arr = new constructor([100])
770 assertFalse(Object.getOwnPropertyDescriptor(arr,"0").configurable) 768 assertFalse(Object.getOwnPropertyDescriptor(arr,"0").configurable)
771 assertFalse(delete arr[0]) 769 assertFalse(delete arr[0])
772 } 770 }
773 771
774 for(i = 0; i < typedArrayConstructors.length; i++) { 772 for(i = 0; i < typedArrayConstructors.length; i++) {
775 TestNonConfigurableProperties(typedArrayConstructors[i]); 773 TestNonConfigurableProperties(typedArrayConstructors[i]);
776 } 774 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698