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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 SubarrayTestCase(constructor, item, 10,0, 100, "abc", 10); | 303 SubarrayTestCase(constructor, item, 10,0, 100, "abc", 10); |
304 | 304 |
305 SubarrayTestCase(constructor, item, 10,0, 100, 0.96, 10.96); | 305 SubarrayTestCase(constructor, item, 10,0, 100, 0.96, 10.96); |
306 SubarrayTestCase(constructor, item, 10,0, 100, 0.96, 10.01); | 306 SubarrayTestCase(constructor, item, 10,0, 100, 0.96, 10.01); |
307 SubarrayTestCase(constructor, item, 10,0, 100, 0.01, 10.01); | 307 SubarrayTestCase(constructor, item, 10,0, 100, 0.01, 10.01); |
308 SubarrayTestCase(constructor, item, 10,0, 100, 0.01, 10.96); | 308 SubarrayTestCase(constructor, item, 10,0, 100, 0.01, 10.96); |
309 | 309 |
310 | 310 |
311 SubarrayTestCase(constructor, item, 10,90, 100, 90); | 311 SubarrayTestCase(constructor, item, 10,90, 100, 90); |
312 SubarrayTestCase(constructor, item, 10,90, 100, -10); | 312 SubarrayTestCase(constructor, item, 10,90, 100, -10); |
313 | |
314 var method = constructor.prototype.subarray; | |
315 method.call(new constructor(100), 0, 100); | |
316 var o = {}; | |
317 assertThrows(function() { method.call(o, 0, 100); }, TypeError); | |
318 } | 313 } |
319 | 314 |
320 TestSubArray(Uint8Array, 0xFF); | 315 TestSubArray(Uint8Array, 0xFF); |
321 TestSubArray(Int8Array, -0x7F); | 316 TestSubArray(Int8Array, -0x7F); |
322 TestSubArray(Uint16Array, 0xFFFF); | 317 TestSubArray(Uint16Array, 0xFFFF); |
323 TestSubArray(Int16Array, -0x7FFF); | 318 TestSubArray(Int16Array, -0x7FFF); |
324 TestSubArray(Uint32Array, 0xFFFFFFFF); | 319 TestSubArray(Uint32Array, 0xFFFFFFFF); |
325 TestSubArray(Int32Array, -0x7FFFFFFF); | 320 TestSubArray(Int32Array, -0x7FFFFFFF); |
326 TestSubArray(Float32Array, 0.5); | 321 TestSubArray(Float32Array, 0.5); |
327 TestSubArray(Float64Array, 0.5); | 322 TestSubArray(Float64Array, 0.5); |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 TestArbitrary(new ArrayBuffer(256)); | 575 TestArbitrary(new ArrayBuffer(256)); |
581 for(i = 0; i < typedArrayConstructors.lenght; i++) { | 576 for(i = 0; i < typedArrayConstructors.lenght; i++) { |
582 TestArbitary(new typedArrayConstructors[i](10)); | 577 TestArbitary(new typedArrayConstructors[i](10)); |
583 } | 578 } |
584 TestArbitrary(new DataView(new ArrayBuffer(256))); | 579 TestArbitrary(new DataView(new ArrayBuffer(256))); |
585 | 580 |
586 | 581 |
587 // Test direct constructor call | 582 // Test direct constructor call |
588 assertThrows(function() { ArrayBuffer(); }, TypeError); | 583 assertThrows(function() { ArrayBuffer(); }, TypeError); |
589 assertThrows(function() { DataView(new ArrayBuffer()); }, TypeError); | 584 assertThrows(function() { DataView(new ArrayBuffer()); }, TypeError); |
OLD | NEW |