MCPcopy Create free account
hub / github.com/idank/explainshell / funescape

Function funescape

explainshell/web/static/js/jquery.js:3811–3821  ·  view source on GitHub ↗
( _, escaped )

Source from the content-addressed store, hash-verified

3809 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
3810 runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
3811 funescape = function( _, escaped ) {
3812 var high = "0x" + escaped - 0x10000;
3813 // NaN means non-codepoint
3814 return high !== high ?
3815 escaped :
3816 // BMP codepoint
3817 high < 0 ?
3818 String.fromCharCode( high + 0x10000 ) :
3819 // Supplemental Plane codepoint (surrogate pair)
3820 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
3821 };
3822
3823// Use a stripped-down slice if we can't use a native one
3824try {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected