MCPcopy Create free account
hub / github.com/JsAaron/jQuery / funescape

Function funescape

2.1.1/test/jquery-1.11.1.js:730–742  ·  view source on GitHub ↗
( _, escaped, escapedWhitespace )

Source from the content-addressed store, hash-verified

728 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
729 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
730 funescape = function( _, escaped, escapedWhitespace ) {
731 var high = "0x" + escaped - 0x10000;
732 // NaN means non-codepoint
733 // Support: Firefox<24
734 // Workaround erroneous numeric interpretation of +"0x"
735 return high !== high || escapedWhitespace ?
736 escaped :
737 high < 0 ?
738 // BMP codepoint
739 String.fromCharCode( high + 0x10000 ) :
740 // Supplemental Plane codepoint (surrogate pair)
741 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
742 };
743
744// Optimize for push.apply( _, NodeList )
745try {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected