MCPcopy Create free account
hub / github.com/socketstream/socketstream / decodeEscape

Function decodeEscape

docs/js/google-code-prettify.js:266–282  ·  view source on GitHub ↗
(charsetPart)

Source from the content-addressed store, hash-verified

264 };
265
266 function decodeEscape(charsetPart) {
267 var cc0 = charsetPart.charCodeAt(0);
268 if (cc0 !== 92 /* \\ */) {
269 return cc0;
270 }
271 var c1 = charsetPart.charAt(1);
272 cc0 = escapeCharToCodeUnit[c1];
273 if (cc0) {
274 return cc0;
275 } else if ('0' <= c1 && c1 <= '7') {
276 return parseInt(charsetPart.substring(1), 8);
277 } else if (c1 === 'u' || c1 === 'x') {
278 return parseInt(charsetPart.substring(2), 16);
279 } else {
280 return charsetPart.charCodeAt(1);
281 }
282 }
283
284 function encodeEscape(charCode) {
285 if (charCode < 0x20) {

Callers 1

caseFoldCharsetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected