diff --git a/README.md b/README.md index a50d586..e2512ea 100644 --- a/README.md +++ b/README.md @@ -100,9 +100,10 @@ __Math realted:__ __Others:__ -* generator -* let -* const +* generator. +* let. +* const. +* Promise. ## Test diff --git a/index.js b/index.js index ee8b87a..67010f2 100644 --- a/index.js +++ b/index.js @@ -104,4 +104,7 @@ exports.Math = { trunc: isFunction(Math.trunc), fround: isFunction(Math.fround), cbrt: isFunction(Math.cbrt) -} \ No newline at end of file +}; + +exports.Promise = typeof Promise !== 'undefined' && isFunction(Promise.all); + diff --git a/test/enable.test.js b/test/enable.test.js index 44a722d..54701c1 100644 --- a/test/enable.test.js +++ b/test/enable.test.js @@ -6,6 +6,7 @@ * * Authors: * fengmk2 (http://fengmk2.github.com) + * hemanth (http://h3manth.com) */ "use strict"; @@ -387,4 +388,14 @@ describe('enable.test.js', function () { } }); + it("should detect Promise", function(){ + enable.Promise.should.be.a.Boolean; + if (process.version.indexOf('v0.10.') === 0) { + enable.Promise.should.equal(false); + } + if (process.version.indexOf('v0.11.') === 0) { + enable.Promise.should.equal(true); + } + }); + });