PublicDoc/js/asyncSupport

10 lines
250 B
Plaintext

//判断浏览器是否支持Async和Await
function isAsyncAwaitSupport() {
let func;
try {
eval("func = async function(){};");
} catch (e) {
return false;
}
return Object.getPrototypeOf(func).constructor != null;
}