()
| 2944 | } |
| 2945 | |
| 2946 | function scanUnicodeCodePointEscape() { |
| 2947 | var ch, code, cu1, cu2; |
| 2948 | |
| 2949 | ch = source[index]; |
| 2950 | code = 0; |
| 2951 | |
| 2952 | // At least, one hex digit is required. |
| 2953 | if (ch === '}') { |
| 2954 | throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); |
| 2955 | } |
| 2956 | |
| 2957 | while (index < length) { |
| 2958 | ch = source[index++]; |
| 2959 | if (!isHexDigit(ch)) { |
| 2960 | break; |
| 2961 | } |
| 2962 | code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase()); |
| 2963 | } |
| 2964 | |
| 2965 | if (code > 0x10FFFF || ch !== '}') { |
| 2966 | throwError({}, Messages.UnexpectedToken, 'ILLEGAL'); |
| 2967 | } |
| 2968 | |
| 2969 | // UTF-16 Encoding |
| 2970 | if (code <= 0xFFFF) { |
| 2971 | return String.fromCharCode(code); |
| 2972 | } |
| 2973 | cu1 = ((code - 0x10000) >> 10) + 0xD800; |
| 2974 | cu2 = ((code - 0x10000) & 1023) + 0xDC00; |
| 2975 | return String.fromCharCode(cu1, cu2); |
| 2976 | } |
| 2977 | |
| 2978 | function getEscapedIdentifier() { |
| 2979 | var ch, id; |
no test coverage detected