(Object o)
| 662 | } |
| 663 | |
| 664 | public static String type(Object o) { |
| 665 | // 11.4.3 |
| 666 | if (o == UNDEFINED) { |
| 667 | return "undefined"; |
| 668 | } |
| 669 | |
| 670 | if (o == NULL) { |
| 671 | return "object"; |
| 672 | } |
| 673 | |
| 674 | if (o instanceof Boolean) { |
| 675 | return "boolean"; |
| 676 | } |
| 677 | |
| 678 | if (o instanceof Number) { |
| 679 | return "number"; |
| 680 | } |
| 681 | |
| 682 | if (o instanceof JSFunction) { |
| 683 | return "function"; |
| 684 | } |
| 685 | |
| 686 | if (o instanceof JSObject) { |
| 687 | return "object"; |
| 688 | } |
| 689 | |
| 690 | if (o instanceof String) { |
| 691 | return "string"; |
| 692 | } |
| 693 | |
| 694 | return o.getClass().getName(); |
| 695 | |
| 696 | } |
| 697 | |
| 698 | // ---------------------------------------------------------------------- |
| 699 |
no test coverage detected