增加判断浏览器是否支持Async和Await的方法
This commit is contained in:
parent
17d50089a3
commit
82354af6a9
10
js/asyncSupport
Normal file
10
js/asyncSupport
Normal file
|
@ -0,0 +1,10 @@
|
|||
//判断浏览器是否支持Async和Await
|
||||
function isAsyncAwaitSupport() {
|
||||
let func;
|
||||
try {
|
||||
eval("func = async function(){};");
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
return Object.getPrototypeOf(func).constructor != null;
|
||||
}
|
Loading…
Reference in New Issue
Block a user