Skip to content

Commit ff23420

Browse files
author
Diogo Franco (Kovensky)
committed
Add a filter to issue-2895
Skips the test in Node 0.12, which doesn't support const.
1 parent e92cbef commit ff23420

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var supportsBlockScoping = require("../../../helpers/supportsBlockScoping");
2+
3+
module.exports = function(config) {
4+
return !config.minimize && supportsBlockScoping();
5+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = function supportsBlockScoping() {
2+
try {
3+
var f = eval("(function f() { const x = 1; if (true) { const x = 2; } return x; })");
4+
return f() === 1;
5+
} catch(e) {
6+
return false;
7+
}
8+
};

0 commit comments

Comments
 (0)