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

Function funescape

2.0.3/2.0.3.js:1010–1022  ·  view source on GitHub ↗
( _, escaped, escapedWhitespace )

Source from the content-addressed store, hash-verified

1008 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
1009 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
1010 funescape = function( _, escaped, escapedWhitespace ) {
1011 var high = "0x" + escaped - 0x10000;
1012 // NaN means non-codepoint
1013 // Support: Firefox
1014 // Workaround erroneous numeric interpretation of +"0x"
1015 return high !== high || escapedWhitespace ?
1016 escaped :
1017 // BMP codepoint
1018 high < 0 ?
1019 String.fromCharCode( high + 0x10000 ) :
1020 // Supplemental Plane codepoint (surrogate pair)
1021 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
1022 };
1023
1024// Optimize for push.apply( _, NodeList )
1025 try {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected