Skip to content

Commit

Permalink
Use native Promise instead of setTimeout as it is not vulnerable to b…
Browse files Browse the repository at this point in the history
…rowser throttling (#51)
  • Loading branch information
gtanczyk authored and ysmood committed Sep 18, 2017
1 parent cc7bc0d commit 950101f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/yaku.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@

, Symbol = root[$Symbol] || {}
, nextTick = isBrowser ?
function (fn) { setTimeout(fn); } :
function (fn) {
window.Promise ? new window.Promise(function (resolve) { resolve(); }).then(fn) : setTimeout(fn);
} :
process.nextTick
, speciesConstructor = function (O, D) {
var C = O.constructor;
Expand Down

0 comments on commit 950101f

Please sign in to comment.