if(typeof Promise !=='undefined'&&isNative(Promise)){
}
function runMicrotask(func){
if(typeof Promise==='function'){
Promise.resolve().then(func)
return
}
if(typeof MutationObserver==='function'){
var ob=new MutationObserver(func)
var node=document.createTextNode('')
ob.observe(node,{characterData:true})
node.data=1;
}
if(process&&typeof process.nextTick==='function'){
process.nextTick(func)
return
}
if(typeof setImmediate==='function'){
setImmediate(func)
return
}
setTimeout(func)
}
标签:function,node,process,api,Promise,typeof,func,对应,模拟
From: https://www.cnblogs.com/7c89/p/18169633