MCPcopy
hub / github.com/BloombergGraphics/whatiscode / scanHexEscape

Function scanHexEscape

scripts/libs/esprima.js:525–538  ·  view source on GitHub ↗
(prefix)

Source from the content-addressed store, hash-verified

523 }
524
525 function scanHexEscape(prefix) {
526 var i, len, ch, code = 0;
527
528 len = (prefix === 'u') ? 4 : 2;
529 for (i = 0; i < len; ++i) {
530 if (index < length && isHexDigit(source[index])) {
531 ch = source[index++];
532 code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());
533 } else {
534 return '';
535 }
536 }
537 return String.fromCharCode(code);
538 }
539
540 function scanUnicodeCodePointEscape() {
541 var ch, code, cu1, cu2;

Callers 3

getEscapedIdentifierFunction · 0.85
scanStringLiteralFunction · 0.85
scanRegExpFlagsFunction · 0.85

Calls 1

isHexDigitFunction · 0.85

Tested by

no test coverage detected