MCPcopy Create free account
hub / github.com/frank-lam/fullstack-tutorial / funescape

Function funescape

notes/docsify/unpkg/gotop/jquery-2.1.0.js:690–702  ·  view source on GitHub ↗
( _, escaped, escapedWhitespace )

Source from the content-addressed store, hash-verified

688 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
689 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
690 funescape = function( _, escaped, escapedWhitespace ) {
691 var high = "0x" + escaped - 0x10000;
692 // NaN means non-codepoint
693 // Support: Firefox
694 // Workaround erroneous numeric interpretation of +"0x"
695 return high !== high || escapedWhitespace ?
696 escaped :
697 high < 0 ?
698 // BMP codepoint
699 String.fromCharCode( high + 0x10000 ) :
700 // Supplemental Plane codepoint (surrogate pair)
701 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
702 };
703
704// Optimize for push.apply( _, NodeList )
705try {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected