diff --git a/jsdoc.conf.json b/jsdoc.conf.json index 7647c39..55b83c9 100644 --- a/jsdoc.conf.json +++ b/jsdoc.conf.json @@ -18,7 +18,7 @@ "dateFormat" : "DD / MM / YYYY", "outputSourceFiles": false, "outputSourcePath" : false, - "systemName" : "ES5Class", + "systemName" : "Prototypal class inheritance for Node.js and the browser", "footer" : "", "copyright" : "", "navType" : "inline", diff --git a/test/class-test.js b/test/class-test.js index c92ddd2..7e36040 100644 --- a/test/class-test.js +++ b/test/class-test.js @@ -1578,6 +1578,33 @@ describe('ES5Class', function (){ }); + it('toString and valueOf', function(){ + var Cls = ES5Class.$define('Cls', { + toString: function(){ + return 'prototype'; + } + }, { + toString: function(){ + return 'static'; + } + }); + + expect('' + Cls()).to.be('prototype'); + expect('' + Cls).to.be('static'); + Cls.$implement({ + valueOf: function(){ + return 'static valueOf'; + } + }); + Cls.$include({ + valueOf: function(){ + return 'prototype valueOf'; + } + }); + expect('' + Cls()).to.be('prototype valueOf'); + expect('' + Cls).to.be('static valueOf'); + }); + it('constructor', function (){ expect(typeof Bird).to.be('function'); expect(Bird.$create).to.be.a('function');