webpack/test/helpers/supportsBlockScoping.js

11 lines
215 B
JavaScript
Raw Normal View History

module.exports = function supportsBlockScoping() {
try {
2025-04-22 18:49:30 +08:00
const f = eval(
2019-08-22 19:26:45 +08:00
"(function f() { const x = 1; if (true) { const x = 2; } return x; })"
);
return f() === 1;
2024-07-31 15:37:05 +08:00
} catch (_err) {
return false;
}
};