webpack/test/helpers/supportsAsync.js

18 lines
271 B
JavaScript
Raw Normal View History

"use strict";
2025-04-06 22:53:09 +08:00
module.exports = function supportsAsync() {
// Node.js@10 has a bug with nested async/await
if (process.version.startsWith("v10.")) {
return false;
}
try {
eval("async () => {}");
return true;
} catch (_err) {
// Ignore
}
return false;
};