@@ -93,3 +93,55 @@ if (!Array.from) {
9393 } ( ) ) ;
9494}
9595
96+ if ( ! String . fromCodePoint ) ( function ( stringFromCharCode ) {
97+ var fromCodePoint = function ( _ ) {
98+ var codeUnits = [ ] , codeLen = 0 , result = "" ;
99+ for ( var index = 0 , len = arguments . length ; index !== len ; ++ index ) {
100+ var codePoint = + arguments [ index ] ;
101+ // correctly handles all cases including `NaN`, `-Infinity`, `+Infinity`
102+ // The surrounding `!(...)` is required to correctly handle `NaN` cases
103+ // The (codePoint>>>0) === codePoint clause handles decimals and negatives
104+ if ( ! ( codePoint < 0x10FFFF && ( codePoint >>> 0 ) === codePoint ) )
105+ throw RangeError ( "Invalid code point: " + codePoint ) ;
106+ if ( codePoint <= 0xFFFF ) { // BMP code point
107+ codeLen = codeUnits . push ( codePoint ) ;
108+ } else { // Astral code point; split in surrogate halves
109+ // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
110+ codePoint -= 0x10000 ;
111+ codeLen = codeUnits . push (
112+ ( codePoint >> 10 ) + 0xD800 , // highSurrogate
113+ ( codePoint % 0x400 ) + 0xDC00 // lowSurrogate
114+ ) ;
115+ }
116+ if ( codeLen >= 0x3fff ) {
117+ result += stringFromCharCode . apply ( null , codeUnits ) ;
118+ codeUnits . length = 0 ;
119+ }
120+ }
121+ return result + stringFromCharCode . apply ( null , codeUnits ) ;
122+ } ;
123+ try { // IE 8 only supports `Object.defineProperty` on DOM elements
124+ Object . defineProperty ( String , "fromCodePoint" , {
125+ "value" : fromCodePoint , "configurable" : true , "writable" : true
126+ } ) ;
127+ } catch ( e ) {
128+ String . fromCodePoint = fromCodePoint ;
129+ }
130+ } ( String . fromCharCode ) ) ;
131+
132+ if ( ! Object . is ) {
133+ Object . is = function ( x , y ) {
134+ // SameValue algorithm
135+ if ( x === y ) { // Steps 1-5, 7-10
136+ // Steps 6.b-6.e: +0 != -0
137+ return x !== 0 || 1 / x === 1 / y ;
138+ } else {
139+ // Step 6.a: NaN == NaN
140+ return x !== x && y !== y ;
141+ }
142+ } ;
143+ }
144+
145+ Math . log10 = Math . log10 || function ( x ) {
146+ return Math . log ( x ) * Math . LOG10E ;
147+ } ;
0 commit comments