OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 } |
OLD | NEW |