MCPcopy
hub / github.com/jquery/esprima / scanUnicodeCodePointEscape

Method scanUnicodeCodePointEscape

src/scanner.ts:401–423  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

399 }
400
401 private scanUnicodeCodePointEscape(): string {
402 let ch = this.source[this.index];
403 let code = 0;
404
405 // At least, one hex digit is required.
406 if (ch === '}') {
407 this.throwUnexpectedToken();
408 }
409
410 while (!this.eof()) {
411 ch = this.source[this.index++];
412 if (!Character.isHexDigit(ch.charCodeAt(0))) {
413 break;
414 }
415 code = code * 16 + hexValue(ch);
416 }
417
418 if (code > 0x10FFFF || ch !== '}') {
419 this.throwUnexpectedToken();
420 }
421
422 return Character.fromCodePoint(code);
423 }
424
425 private getIdentifier(): string {
426 const start = this.index++;

Callers 3

getComplexIdentifierMethod · 0.95
scanStringLiteralMethod · 0.95
scanTemplateMethod · 0.95

Calls 3

throwUnexpectedTokenMethod · 0.95
eofMethod · 0.95
hexValueFunction · 0.85

Tested by

no test coverage detected