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

Side by Side Diff: test/mjsunit/harmony/typedarrays.js

Issue 1038313004: fix special index parsing (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: NaN test Created 5 years, 8 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 | « test/cctest/test-conversions.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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 a[s2] = 255; 523 a[s2] = 255;
524 assertEquals(undefined, a["-0"]); 524 assertEquals(undefined, a["-0"]);
525 assertEquals(255, a[s2]); 525 assertEquals(255, a[s2]);
526 assertEquals(0, a[-0]); 526 assertEquals(0, a[-0]);
527 527
528 /* Chromium bug: 424619 528 /* Chromium bug: 424619
529 * a[-Infinity] = 50; 529 * a[-Infinity] = 50;
530 * assertEquals(undefined, a[-Infinity]); 530 * assertEquals(undefined, a[-Infinity]);
531 */ 531 */
532 a[1.5] = 10; 532 a[1.5] = 10;
533 assertEquals(10, a[1.5]); 533 assertEquals(undefined, a[1.5]);
534 var nan = Math.sqrt(-1); 534 var nan = Math.sqrt(-1);
535 a[nan] = 5; 535 a[nan] = 5;
536 assertEquals(5, a[nan]); 536 assertEquals(undefined, a[nan]);
537 537
538 var x = 0; 538 var x = 0;
539 var y = -0; 539 var y = -0;
540 assertEquals(Infinity, 1/x); 540 assertEquals(Infinity, 1/x);
541 assertEquals(-Infinity, 1/y); 541 assertEquals(-Infinity, 1/y);
542 a[x] = 5; 542 a[x] = 5;
543 a[y] = 27; 543 a[y] = 27;
544 assertEquals(27, a[x]); 544 assertEquals(27, a[x]);
545 assertEquals(27, a[y]); 545 assertEquals(27, a[y]);
546 } 546 }
(...skipping 25 matching lines...) Expand all
572 a[s2] = 255; 572 a[s2] = 255;
573 assertEquals(undefined, a["-0"]); 573 assertEquals(undefined, a["-0"]);
574 assertEquals(255, a[s2]); 574 assertEquals(255, a[s2]);
575 assertEquals(0, a[-0]); 575 assertEquals(0, a[-0]);
576 576
577 /* Chromium bug: 424619 577 /* Chromium bug: 424619
578 * a[-Infinity] = 50; 578 * a[-Infinity] = 50;
579 * assertEquals(undefined, a[-Infinity]); 579 * assertEquals(undefined, a[-Infinity]);
580 */ 580 */
581 a[1.5] = 10; 581 a[1.5] = 10;
582 assertEquals(10, a[1.5]); 582 assertEquals(undefined, a[1.5]);
583 var nan = Math.sqrt(-1); 583 var nan = Math.sqrt(-1);
584 a[nan] = 5; 584 a[nan] = 5;
585 assertEquals(5, a[nan]); 585 assertEquals(undefined, a[nan]);
586 586
587 var x = 0; 587 var x = 0;
588 var y = -0; 588 var y = -0;
589 assertEquals(Infinity, 1/x); 589 assertEquals(Infinity, 1/x);
590 assertEquals(-Infinity, 1/y); 590 assertEquals(-Infinity, 1/y);
591 a[x] = 5; 591 a[x] = 5;
592 a[y] = 27; 592 a[y] = 27;
593 assertEquals(27, a[x]); 593 assertEquals(27, a[x]);
594 assertEquals(27, a[y]); 594 assertEquals(27, a[y]);
595 } 595 }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 TestArbitrary(new ArrayBuffer(256)); 712 TestArbitrary(new ArrayBuffer(256));
713 for(i = 0; i < typedArrayConstructors.length; i++) { 713 for(i = 0; i < typedArrayConstructors.length; i++) {
714 TestArbitrary(new typedArrayConstructors[i](10)); 714 TestArbitrary(new typedArrayConstructors[i](10));
715 } 715 }
716 TestArbitrary(new DataView(new ArrayBuffer(256))); 716 TestArbitrary(new DataView(new ArrayBuffer(256)));
717 717
718 718
719 // Test direct constructor call 719 // Test direct constructor call
720 assertThrows(function() { ArrayBuffer(); }, TypeError); 720 assertThrows(function() { ArrayBuffer(); }, TypeError);
721 assertThrows(function() { DataView(new ArrayBuffer()); }, TypeError); 721 assertThrows(function() { DataView(new ArrayBuffer()); }, TypeError);
OLDNEW
« no previous file with comments | « test/cctest/test-conversions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698