eval
requireJS
h5 history pjax
Promise.all()
Promise.all = function ( promises ) {
return new Promise( function ( fulfil, reject ) {
var result = [], pending, i, processPromise;
if ( !promises.length ) {
fulfil( result );
return;
}
processPromise = function ( i ) {
promises[i].then( function ( value ) {
result[i] = value;
if ( !--pending ) {
fulfil( result );
}
}, reject );
};
pending = i = promises.length;
while ( i-- ) {
processPromise( i );
}
});
};