OLD | NEW |
1 Exercise WebIDL type conversions. | 1 Exercise WebIDL type conversions. |
2 | 2 |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". |
4 | 4 |
5 | 5 |
6 converter = window.internals.typeConversions() | 6 converter = window.internals.typeConversions() |
7 | 7 |
8 PASS 'testLong' in converter is true | 8 PASS 'testLong' in converter is true |
9 PASS typeof converter.testLong === 'number' is true | 9 PASS typeof converter.testLong === 'number' is true |
10 converter.testLong = 0 | 10 converter.testLong = 0 |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 converter.testEnforceRangeUnsignedLongLong = '' | 539 converter.testEnforceRangeUnsignedLongLong = '' |
540 PASS converter.testEnforceRangeUnsignedLongLong is 0 | 540 PASS converter.testEnforceRangeUnsignedLongLong is 0 |
541 converter.testEnforceRangeUnsignedLongLong = '1' | 541 converter.testEnforceRangeUnsignedLongLong = '1' |
542 PASS converter.testEnforceRangeUnsignedLongLong is 1 | 542 PASS converter.testEnforceRangeUnsignedLongLong is 1 |
543 PASS converter.testEnforceRangeUnsignedLongLong = 'abc' threw exception TypeErro
r: Type error. | 543 PASS converter.testEnforceRangeUnsignedLongLong = 'abc' threw exception TypeErro
r: Type error. |
544 converter.testEnforceRangeUnsignedLongLong = null | 544 converter.testEnforceRangeUnsignedLongLong = null |
545 PASS converter.testEnforceRangeUnsignedLongLong is 0 | 545 PASS converter.testEnforceRangeUnsignedLongLong is 0 |
546 PASS converter.testEnforceRangeUnsignedLongLong = undefined threw exception Type
Error: Type error. | 546 PASS converter.testEnforceRangeUnsignedLongLong = undefined threw exception Type
Error: Type error. |
547 PASS converter.testEnforceRangeUnsignedLongLong = {valueOf:function(){throw new
Error('custom');}} threw exception Error: custom. | 547 PASS converter.testEnforceRangeUnsignedLongLong = {valueOf:function(){throw new
Error('custom');}} threw exception Error: custom. |
548 | 548 |
| 549 PASS 'testByte' in converter is true |
| 550 PASS typeof converter.testByte === 'number' is true |
| 551 converter.testByte = 0 |
| 552 PASS converter.testByte is 0 |
| 553 converter.testByte = -1 |
| 554 PASS converter.testByte is -1 |
| 555 converter.testByte = 1 |
| 556 PASS converter.testByte is 1 |
| 557 converter.testByte = 0x7F |
| 558 PASS converter.testByte is 0x7F |
| 559 converter.testByte = 0x80 |
| 560 PASS converter.testByte is -0x80 |
| 561 converter.testByte = -0x7F |
| 562 PASS converter.testByte is -0x7F |
| 563 converter.testByte = -0x80 |
| 564 PASS converter.testByte is -0x80 |
| 565 converter.testByte = -0x81 |
| 566 PASS converter.testByte is 0x7F |
| 567 converter.testByte = 0x1234 |
| 568 PASS converter.testByte is 0x34 |
| 569 converter.testByte = Number.MIN_VALUE |
| 570 PASS converter.testByte is 0 |
| 571 converter.testByte = -Number.MIN_VALUE |
| 572 PASS converter.testByte is 0 |
| 573 converter.testByte = Number.MAX_VALUE |
| 574 PASS converter.testByte is 0 |
| 575 converter.testByte = -Number.MAX_VALUE |
| 576 PASS converter.testByte is 0 |
| 577 converter.testByte = 1.99 |
| 578 PASS converter.testByte is 1 |
| 579 converter.testByte = -1.99 |
| 580 PASS converter.testByte is -1 |
| 581 converter.testByte = 4660.99 |
| 582 PASS converter.testByte is 0x34 |
| 583 converter.testByte = Infinity |
| 584 PASS converter.testByte is 0 |
| 585 converter.testByte = -Infinity |
| 586 PASS converter.testByte is 0 |
| 587 converter.testByte = NaN |
| 588 PASS converter.testByte is 0 |
| 589 converter.testByte = false |
| 590 PASS converter.testByte is 0 |
| 591 converter.testByte = true |
| 592 PASS converter.testByte is 1 |
| 593 converter.testByte = '' |
| 594 PASS converter.testByte is 0 |
| 595 converter.testByte = '1' |
| 596 PASS converter.testByte is 1 |
| 597 converter.testByte = 'abc' |
| 598 PASS converter.testByte is 0 |
| 599 converter.testByte = null |
| 600 PASS converter.testByte is 0 |
| 601 converter.testByte = undefined |
| 602 PASS converter.testByte is 0 |
| 603 PASS converter.testByte = {valueOf:function(){throw new Error('custom');}} threw
exception Error: custom. |
| 604 |
| 605 PASS 'testEnforceRangeByte' in converter is true |
| 606 PASS typeof converter.testEnforceRangeByte === 'number' is true |
| 607 converter.testEnforceRangeByte = 0 |
| 608 PASS converter.testEnforceRangeByte is 0 |
| 609 converter.testEnforceRangeByte = -1 |
| 610 PASS converter.testEnforceRangeByte is -1 |
| 611 converter.testEnforceRangeByte = 1 |
| 612 PASS converter.testEnforceRangeByte is 1 |
| 613 converter.testEnforceRangeByte = 0x7F |
| 614 PASS converter.testEnforceRangeByte is 0x7F |
| 615 PASS converter.testEnforceRangeByte = 0x80 threw exception TypeError: Type error
. |
| 616 converter.testEnforceRangeByte = -0x7F |
| 617 PASS converter.testEnforceRangeByte is -0x7F |
| 618 converter.testEnforceRangeByte = -0x80 |
| 619 PASS converter.testEnforceRangeByte is -0x80 |
| 620 PASS converter.testEnforceRangeByte = -0x81 threw exception TypeError: Type erro
r. |
| 621 PASS converter.testEnforceRangeByte = 0x1234 threw exception TypeError: Type err
or. |
| 622 converter.testEnforceRangeByte = Number.MIN_VALUE |
| 623 PASS converter.testEnforceRangeByte is 0 |
| 624 converter.testEnforceRangeByte = -Number.MIN_VALUE |
| 625 PASS converter.testEnforceRangeByte is 0 |
| 626 PASS converter.testEnforceRangeByte = Number.MAX_VALUE threw exception TypeError
: Type error. |
| 627 PASS converter.testEnforceRangeByte = -Number.MAX_VALUE threw exception TypeErro
r: Type error. |
| 628 converter.testEnforceRangeByte = 1.99 |
| 629 PASS converter.testEnforceRangeByte is 1 |
| 630 converter.testEnforceRangeByte = -1.99 |
| 631 PASS converter.testEnforceRangeByte is -1 |
| 632 PASS converter.testEnforceRangeByte = 4660.99 threw exception TypeError: Type er
ror. |
| 633 PASS converter.testEnforceRangeByte = Infinity threw exception TypeError: Type e
rror. |
| 634 PASS converter.testEnforceRangeByte = -Infinity threw exception TypeError: Type
error. |
| 635 PASS converter.testEnforceRangeByte = NaN threw exception TypeError: Type error. |
| 636 converter.testEnforceRangeByte = false |
| 637 PASS converter.testEnforceRangeByte is 0 |
| 638 converter.testEnforceRangeByte = true |
| 639 PASS converter.testEnforceRangeByte is 1 |
| 640 converter.testEnforceRangeByte = '' |
| 641 PASS converter.testEnforceRangeByte is 0 |
| 642 converter.testEnforceRangeByte = '1' |
| 643 PASS converter.testEnforceRangeByte is 1 |
| 644 PASS converter.testEnforceRangeByte = 'abc' threw exception TypeError: Type erro
r. |
| 645 converter.testEnforceRangeByte = null |
| 646 PASS converter.testEnforceRangeByte is 0 |
| 647 PASS converter.testEnforceRangeByte = undefined threw exception TypeError: Type
error. |
| 648 PASS converter.testEnforceRangeByte = {valueOf:function(){throw new Error('custo
m');}} threw exception Error: custom. |
| 649 |
| 650 PASS 'testOctet' in converter is true |
| 651 PASS typeof converter.testOctet === 'number' is true |
| 652 converter.testOctet = 0 |
| 653 PASS converter.testOctet is 0 |
| 654 converter.testOctet = -1 |
| 655 PASS converter.testOctet is 0xFF |
| 656 converter.testOctet = 1 |
| 657 PASS converter.testOctet is 1 |
| 658 converter.testOctet = 0x7F |
| 659 PASS converter.testOctet is 0x7F |
| 660 converter.testOctet = 0x80 |
| 661 PASS converter.testOctet is 0x80 |
| 662 converter.testOctet = 0xFF |
| 663 PASS converter.testOctet is 0xFF |
| 664 converter.testOctet = 0x100 |
| 665 PASS converter.testOctet is 0 |
| 666 converter.testOctet = 0x101 |
| 667 PASS converter.testOctet is 1 |
| 668 converter.testOctet = -0x80 |
| 669 PASS converter.testOctet is 0x80 |
| 670 converter.testOctet = -0x81 |
| 671 PASS converter.testOctet is 0x7F |
| 672 converter.testOctet = 0x1234 |
| 673 PASS converter.testOctet is 0x34 |
| 674 converter.testOctet = Number.MAX_VALUE |
| 675 PASS converter.testOctet is 0 |
| 676 converter.testOctet = Number.MIN_VALUE |
| 677 PASS converter.testOctet is 0 |
| 678 converter.testOctet = -Number.MAX_VALUE |
| 679 PASS converter.testOctet is 0 |
| 680 converter.testOctet = -Number.MIN_VALUE |
| 681 PASS converter.testOctet is 0 |
| 682 converter.testOctet = 1.99 |
| 683 PASS converter.testOctet is 1 |
| 684 converter.testOctet = -1.99 |
| 685 PASS converter.testOctet is 0xFF |
| 686 converter.testOctet = 4660.99 |
| 687 PASS converter.testOctet is 0x34 |
| 688 converter.testOctet = Infinity |
| 689 PASS converter.testOctet is 0 |
| 690 converter.testOctet = -Infinity |
| 691 PASS converter.testOctet is 0 |
| 692 converter.testOctet = NaN |
| 693 PASS converter.testOctet is 0 |
| 694 converter.testOctet = false |
| 695 PASS converter.testOctet is 0 |
| 696 converter.testOctet = true |
| 697 PASS converter.testOctet is 1 |
| 698 converter.testOctet = '' |
| 699 PASS converter.testOctet is 0 |
| 700 converter.testOctet = '1' |
| 701 PASS converter.testOctet is 1 |
| 702 converter.testOctet = 'abc' |
| 703 PASS converter.testOctet is 0 |
| 704 converter.testOctet = null |
| 705 PASS converter.testOctet is 0 |
| 706 converter.testOctet = undefined |
| 707 PASS converter.testOctet is 0 |
| 708 PASS converter.testOctet = {valueOf:function(){throw new Error('custom');}} thre
w exception Error: custom. |
| 709 |
| 710 PASS 'testEnforceRangeOctet' in converter is true |
| 711 PASS typeof converter.testEnforceRangeOctet === 'number' is true |
| 712 converter.testEnforceRangeOctet = 0 |
| 713 PASS converter.testEnforceRangeOctet is 0 |
| 714 PASS converter.testEnforceRangeOctet = -1 threw exception TypeError: Type error. |
| 715 converter.testEnforceRangeOctet = 1 |
| 716 PASS converter.testEnforceRangeOctet is 1 |
| 717 converter.testEnforceRangeOctet = 0x7F |
| 718 PASS converter.testEnforceRangeOctet is 0x7F |
| 719 converter.testEnforceRangeOctet = 0x80 |
| 720 PASS converter.testEnforceRangeOctet is 0x80 |
| 721 converter.testEnforceRangeOctet = 0xFF |
| 722 PASS converter.testEnforceRangeOctet is 0xFF |
| 723 PASS converter.testEnforceRangeOctet = 0x100 threw exception TypeError: Type err
or. |
| 724 PASS converter.testEnforceRangeOctet = 0x101 threw exception TypeError: Type err
or. |
| 725 PASS converter.testEnforceRangeOctet = -0x80 threw exception TypeError: Type err
or. |
| 726 PASS converter.testEnforceRangeOctet = -0x81 threw exception TypeError: Type err
or. |
| 727 PASS converter.testEnforceRangeOctet = 0x1234 threw exception TypeError: Type er
ror. |
| 728 PASS converter.testEnforceRangeOctet = Number.MAX_VALUE threw exception TypeErro
r: Type error. |
| 729 converter.testEnforceRangeOctet = Number.MIN_VALUE |
| 730 PASS converter.testEnforceRangeOctet is 0 |
| 731 PASS converter.testEnforceRangeOctet = -Number.MAX_VALUE threw exception TypeErr
or: Type error. |
| 732 converter.testEnforceRangeOctet = -Number.MIN_VALUE |
| 733 PASS converter.testEnforceRangeOctet is 0 |
| 734 converter.testEnforceRangeOctet = 1.99 |
| 735 PASS converter.testEnforceRangeOctet is 1 |
| 736 PASS converter.testEnforceRangeOctet = -1.99 threw exception TypeError: Type err
or. |
| 737 PASS converter.testEnforceRangeOctet = 4660.99 threw exception TypeError: Type e
rror. |
| 738 PASS converter.testEnforceRangeOctet = Infinity threw exception TypeError: Type
error. |
| 739 PASS converter.testEnforceRangeOctet = -Infinity threw exception TypeError: Type
error. |
| 740 PASS converter.testEnforceRangeOctet = NaN threw exception TypeError: Type error
. |
| 741 converter.testEnforceRangeOctet = false |
| 742 PASS converter.testEnforceRangeOctet is 0 |
| 743 converter.testEnforceRangeOctet = true |
| 744 PASS converter.testEnforceRangeOctet is 1 |
| 745 converter.testEnforceRangeOctet = '' |
| 746 PASS converter.testEnforceRangeOctet is 0 |
| 747 converter.testEnforceRangeOctet = '1' |
| 748 PASS converter.testEnforceRangeOctet is 1 |
| 749 PASS converter.testEnforceRangeOctet = 'abc' threw exception TypeError: Type err
or. |
| 750 converter.testEnforceRangeOctet = null |
| 751 PASS converter.testEnforceRangeOctet is 0 |
| 752 PASS converter.testEnforceRangeOctet = undefined threw exception TypeError: Type
error. |
| 753 PASS converter.testEnforceRangeOctet = {valueOf:function(){throw new Error('cust
om');}} threw exception Error: custom. |
| 754 |
549 PASS successfullyParsed is true | 755 PASS successfullyParsed is true |
550 | 756 |
551 TEST COMPLETE | 757 TEST COMPLETE |
552 | 758 |
OLD | NEW |