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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 assertEquals(10, a["-1e2"]); | 556 assertEquals(10, a["-1e2"]); |
557 assertEquals(undefined, a[-1e2]); | 557 assertEquals(undefined, a[-1e2]); |
558 | 558 |
559 a["-0"] = 256; | 559 a["-0"] = 256; |
560 var s2 = " -0"; | 560 var s2 = " -0"; |
561 a[s2] = 255; | 561 a[s2] = 255; |
562 assertEquals(undefined, a["-0"]); | 562 assertEquals(undefined, a["-0"]); |
563 assertEquals(255, a[s2]); | 563 assertEquals(255, a[s2]); |
564 assertEquals(0, a[-0]); | 564 assertEquals(0, a[-0]); |
565 | 565 |
566 /* Chromium bug: 424619 | 566 a[-Infinity] = 50; |
567 * a[-Infinity] = 50; | 567 assertEquals(undefined, a[-Infinity]); |
568 * assertEquals(undefined, a[-Infinity]); | 568 |
569 */ | |
570 a[1.5] = 10; | 569 a[1.5] = 10; |
571 assertEquals(undefined, a[1.5]); | 570 assertEquals(undefined, a[1.5]); |
572 var nan = Math.sqrt(-1); | 571 var nan = Math.sqrt(-1); |
573 a[nan] = 5; | 572 a[nan] = 5; |
574 assertEquals(undefined, a[nan]); | 573 assertEquals(undefined, a[nan]); |
575 | 574 |
576 var x = 0; | 575 var x = 0; |
577 var y = -0; | 576 var y = -0; |
578 assertEquals(Infinity, 1/x); | 577 assertEquals(Infinity, 1/x); |
579 assertEquals(-Infinity, 1/y); | 578 assertEquals(-Infinity, 1/y); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 | 759 |
761 function TestNonConfigurableProperties(constructor) { | 760 function TestNonConfigurableProperties(constructor) { |
762 var arr = new constructor([100]) | 761 var arr = new constructor([100]) |
763 assertFalse(Object.getOwnPropertyDescriptor(arr,"0").configurable) | 762 assertFalse(Object.getOwnPropertyDescriptor(arr,"0").configurable) |
764 assertFalse(delete arr[0]) | 763 assertFalse(delete arr[0]) |
765 } | 764 } |
766 | 765 |
767 for(i = 0; i < typedArrayConstructors.length; i++) { | 766 for(i = 0; i < typedArrayConstructors.length; i++) { |
768 TestNonConfigurableProperties(typedArrayConstructors[i]); | 767 TestNonConfigurableProperties(typedArrayConstructors[i]); |
769 } | 768 } |
OLD | NEW |