MCPcopy Create free account
hub / github.com/nodejs/node / peekUnicodeEscape

Function peekUnicodeEscape

test/fixtures/snapshot/typescript.js:11291–11300  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11289 // Current character is known to be a backslash. Check for Unicode escape of the form '\uXXXX'
11290 // and return code point value if valid Unicode escape is found. Otherwise return -1.
11291 function peekUnicodeEscape() {
11292 if (pos + 5 < end && text.charCodeAt(pos + 1) === 117 /* CharacterCodes.u */) {
11293 var start_1 = pos;
11294 pos += 2;
11295 var value = scanExactNumberOfHexDigits(4, /*canHaveSeparators*/ false);
11296 pos = start_1;
11297 return value;
11298 }
11299 return -1;
11300 }
11301 function peekExtendedUnicodeEscape() {
11302 if (languageVersion >= 2 /* ScriptTarget.ES2015 */ && codePointAt(text, pos + 1) === 117 /* CharacterCodes.u */ && codePointAt(text, pos + 2) === 123 /* CharacterCodes.openBrace */) {
11303 var start_2 = pos;

Callers 3

scanIdentifierPartsFunction · 0.85
scanFunction · 0.85
scanJsDocTokenFunction · 0.85

Calls 1

Tested by

no test coverage detected