(start)
| 788 | // 7.8.3 Numeric Literals |
| 789 | |
| 790 | function scanHexLiteral(start) { |
| 791 | var number = ''; |
| 792 | |
| 793 | while (index < length) { |
| 794 | if (!isHexDigit(source[index])) { |
| 795 | break; |
| 796 | } |
| 797 | number += source[index++]; |
| 798 | } |
| 799 | |
| 800 | if (number.length === 0) { |
| 801 | throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); |
| 802 | } |
| 803 | |
| 804 | if (isIdentifierStart(source.charCodeAt(index))) { |
| 805 | throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); |
| 806 | } |
| 807 | |
| 808 | return { |
| 809 | type: Token.NumericLiteral, |
| 810 | value: parseInt('0x' + number, 16), |
| 811 | lineNumber: lineNumber, |
| 812 | lineStart: lineStart, |
| 813 | start: start, |
| 814 | end: index |
| 815 | }; |
| 816 | } |
| 817 | |
| 818 | function scanOctalLiteral(start) { |
| 819 | var number = '0' + source[index++]; |
no test coverage detected