webpack/test/helpers/supportsBlockScoping.js

9 lines
202 B
JavaScript
Raw Normal View History

module.exports = function supportsBlockScoping() {
try {
var f = eval("(function f() { const x = 1; if (true) { const x = 2; } return x; })");
return f() === 1;
} catch(e) {
return false;
}
};