by syspec · 8y ago · 0 comments
The polyfill for async, converts those calls to generator functions - however i'm not aware of any browsers which support generator functions, but DO NOT support async/await
If it supports async, it stays on modern.html, otherwise it redirects to legacy.html. There's also the ability to do some server detection for what payload to deliver. It's just async support is the only feature I test for.
client test;
try {
eval('(function() { async _ => _; })();');
} catch (e) {
window.location.replace('/legacy.html');
}
server test: import * as capabilities from 'browser-capabilities';
export default userAgent =>
capabilities
.browserCapabilities(userAgent)
.has('es2017');