in src/scanner.ts [390:402]
private scanHexEscape(prefix: string): string | null {
const len = (prefix === 'u') ? 4 : 2;
let code = 0;
for (let i = 0; i < len; ++i) {
if (!this.eof() && Character.isHexDigit(this.source.charCodeAt(this.index))) {
code = code * 16 + hexValue(this.source[this.index++]);
} else {
return null;
}
}
return String.fromCharCode(code);
}