wallet-core/node_modules/core-js/modules/web.timers.js

20 lines
706 B
JavaScript
Raw Normal View History

2016-10-10 03:43:44 +02:00
// ie9- setTimeout & setInterval additional parameters fix
var global = require('./$.global')
, $export = require('./$.export')
, invoke = require('./$.invoke')
, partial = require('./$.partial')
2016-10-10 03:43:44 +02:00
, navigator = global.navigator
, MSIE = !!navigator && /MSIE .\./.test(navigator.userAgent); // <- dirty ie9- check
var wrap = function(set){
return MSIE ? function(fn, time /*, ...args */){
return set(invoke(
partial,
[].slice.call(arguments, 2),
typeof fn == 'function' ? fn : Function(fn)
), time);
} : set;
};
$export($export.G + $export.B + $export.F * MSIE, {
setTimeout: wrap(global.setTimeout),
setInterval: wrap(global.setInterval)
});