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

Method codePointAt

src/scanner.ts:373–385  ·  view source on GitHub ↗
(i: number)

Source from the content-addressed store, hash-verified

371 }
372
373 private codePointAt(i: number): number {
374 let cp = this.source.charCodeAt(i);
375
376 if (cp >= 0xD800 && cp <= 0xDBFF) {
377 const second = this.source.charCodeAt(i + 1);
378 if (second >= 0xDC00 && second <= 0xDFFF) {
379 const first = cp;
380 cp = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
381 }
382 }
383
384 return cp;
385 }
386
387 private scanHexEscape(prefix: string): string | null {
388 const len = (prefix === 'u') ? 4 : 2;

Callers 2

getComplexIdentifierMethod · 0.95
lexMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected