最近、jQuery ソース (最終バージョン 1.9.1、Sizzle パッケージ、129 行目のfunescape
関数)に奇妙な行が 1 つ見つかりました。
funescape = function( _, escaped ) {
var high = "0x" + escaped - 0x10000;
// NaN means non-codepoint
return high !== high ? // <--- LINE 129
escaped :
// BMP codepoint
high < 0 ?
String.fromCharCode( high + 0x10000 ) :
// Supplemental Plane codepoint (surrogate pair)
String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
};
high !== high
比較する理由は何ですか?return escaped
実行されることはないようです。それとも何かが恋しいですか?
参考: jQuery シズル