This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Promise = window[ 'Promise' ] || function(executor) { | |
var pState = 0; | |
var pValue; | |
var pResolve; | |
var pReject; | |
this.then = function(onResolve, onReject) { | |
return new Promise( function(resolve, reject) { | |
pResolve = function(value) { result( value, onResolve, resolve, reject, onReject ) }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @const {boolean} */ | |
var ie = ( function() { | |
var ua = window.navigator.userAgent; | |
var o = /(?:Edge\/|MSIE\s+)(\d+)/.exec( ua ); | |
if ( o ) return parseInt( o[ 1 ] ); | |
else if ( /Trident\//.test( ua ) ) return 11; | |
else return 0; | |
}() ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @type {function((Function|string), ...*):number} */ | |
var setImmediate = window.setImmediate || ( function() { | |
var id = Math.random(); | |
var queue = []; | |
var FunctionCall = Function.prototype.call; | |
window.addEventListener( 'message', function(event) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param {function((Function|string), number=, ...*):number} setTimeout | |
* @returns {function((Function|string), number=, ...*):number} | |
*/ | |
var getTimeout = function(setTimeout) { | |
return ( ie && ie <= 9 | |
? function(func, delay) { | |
var f, a = arguments; | |
if ( a.length > 2 ) { | |
f = func; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var performance = window.performance; | |
/** @type {function():number} */ | |
var now = ( performance && performance.now | |
? performance.now.bind( performance ) | |
: Date.now | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var FunctionPrototype = Function.prototype; | |
/** @type {function(Object, ...*):*} */ | |
var FunctionCall = FunctionPrototype.call; | |
/** @type {function(Object):Function} */ | |
var FunctionBind = FunctionPrototype.bind; | |
/** @type {function(Function, Object):Function} */ | |
var bind = ( FunctionBind | |
? FunctionCall.bind( FunctionBind ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @type {function(Array|Uint8Array):string} */ | |
var md5 = function( self ) { | |
"use strict"; | |
var Array = self.Array; | |
var ArrayBuffer = self.ArrayBuffer; | |
var Uint8Array = self.Uint8Array; | |
var Uint32Array = self.Uint32Array; | |
var TextEncoder = self.TextEncoder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @type {function(String):String} */ | |
var canonicalize = ( function() { | |
function replace(m) { | |
return replacers[ m ]; | |
} | |
var chars = { | |
'a': 'àáâãäåāăąаӑӓѧѩ', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var crypto = window.crypto; | |
var Uint32Array = window.Uint32Array; | |
/** @type {function():String} */ | |
var generate = ( crypto && Uint32Array | |
? ( function() { | |
var buf = new Uint32Array( 1 ); | |
return function() { | |
crypto.getRandomValues( buf ); | |
return String( buf[ 0 ] ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @type {function((Function|string)):number} */ | |
var requestAnimationFrame = window.requestAnimationFrame || ( function() { | |
/** @type {Array.<Function>} */ | |
var queue = []; | |
/** @type {number} */ | |
var last = Date.now() - 100 / 6; | |
( function frame() { |
NewerOlder