webpack/test/helpers/supportsNullishCoalescing.js

11 lines
193 B
JavaScript
Raw Permalink Normal View History

"use strict";
module.exports = function supportsNullishCoalescing() {
2020-07-20 17:38:32 +08:00
try {
2025-04-22 18:49:30 +08:00
const f = eval("(function f() { return null ?? true; })");
2020-07-20 17:38:32 +08:00
return f();
2024-07-31 15:37:05 +08:00
} catch (_err) {
2020-07-20 17:38:32 +08:00
return false;
}
};