Skip to content

Commit

Permalink
Merge 364bf1d into 689a01d
Browse files Browse the repository at this point in the history
  • Loading branch information
hemanth committed Oct 30, 2014
2 parents 689a01d + 364bf1d commit 2fa3acd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
9 changes: 9 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,12 @@ try {
} catch (_) {
exports.let = false;
}

// const
try {
eval('(function () { const fubar = 42; return typeof fubar === "number"; }())');
exports.const = true;
} catch (_) {
exports.const = false;
}

7 changes: 7 additions & 0 deletions test/enable.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,11 @@ describe('enable.test.js', function () {
enable.let.should.equal(true);
}
});

it("should detect const", function() {
enable.const.should.be.a.Boolean;
if (process.version.indexOf('v0.10.') === 0) {
enable.const.should.equal(true);
}
});
});

0 comments on commit 2fa3acd

Please sign in to comment.