2016-10-10 03:43:44 +02:00
|
|
|
// ie9- setTimeout & setInterval additional parameters fix
|
2017-08-14 05:01:11 +02:00
|
|
|
var global = require('./_global');
|
|
|
|
var $export = require('./_export');
|
|
|
|
var invoke = require('./_invoke');
|
|
|
|
var partial = require('./_partial');
|
|
|
|
var navigator = global.navigator;
|
|
|
|
var MSIE = !!navigator && /MSIE .\./.test(navigator.userAgent); // <- dirty ie9- check
|
|
|
|
var wrap = function (set) {
|
|
|
|
return MSIE ? function (fn, time /* , ...args */) {
|
2016-10-10 03:43:44 +02:00
|
|
|
return set(invoke(
|
|
|
|
partial,
|
|
|
|
[].slice.call(arguments, 2),
|
2017-08-14 05:01:11 +02:00
|
|
|
// eslint-disable-next-line no-new-func
|
2016-10-10 03:43:44 +02:00
|
|
|
typeof fn == 'function' ? fn : Function(fn)
|
|
|
|
), time);
|
|
|
|
} : set;
|
|
|
|
};
|
|
|
|
$export($export.G + $export.B + $export.F * MSIE, {
|
2017-08-14 05:01:11 +02:00
|
|
|
setTimeout: wrap(global.setTimeout),
|
2016-10-10 03:43:44 +02:00
|
|
|
setInterval: wrap(global.setInterval)
|
2017-08-14 05:01:11 +02:00
|
|
|
});
|