diff --git a/rhino_modules/jsdoc/tag.js b/rhino_modules/jsdoc/tag.js index 2254017e..349b15c5 100644 --- a/rhino_modules/jsdoc/tag.js +++ b/rhino_modules/jsdoc/tag.js @@ -72,7 +72,7 @@ exports.Tag = function(tagTitle, tagBody, meta) { this.value.optional = tagType.optional; this.value.nullable = tagType.nullable; this.value.variable = tagType.variable; - this.value['default'] = tagType['default']; + this.value.defaultvalue = tagType.defaultvalue; } if (tagType.text && tagType.text.length) { diff --git a/rhino_modules/jsdoc/tag/type.js b/rhino_modules/jsdoc/tag/type.js index d8d04250..8c053006 100644 --- a/rhino_modules/jsdoc/tag/type.js +++ b/rhino_modules/jsdoc/tag/type.js @@ -71,7 +71,7 @@ var getTagInfo = exports.getTagInfo = function(tagValue, canHaveName, canHaveTyp @param {string} tagValue @param {boolean} canHaveName @param {boolean} canHaveType - @returns {object} Hash with name, type, text, optional, nullable, variable, and default properties + @returns {object} Hash with name, type, text, optional, nullable, variable, and defaultvalue properties */ exports.parse = function(tagValue, canHaveName, canHaveType) { if (typeof tagValue !== 'string') { tagValue = ''; } @@ -89,6 +89,6 @@ exports.parse = function(tagValue, canHaveName, canHaveType) { optional: tagInfo.optional, nullable: tagInfo.nullable, variable: tagInfo.variable, - 'default': tagInfo['default'] + defaultvalue: tagInfo['default'] }; }; diff --git a/test/specs/jsdoc/tag/type/jsdocType.js b/test/specs/jsdoc/tag/type/jsdocType.js index 2e3adcc7..d62a6fe8 100644 --- a/test/specs/jsdoc/tag/type/jsdocType.js +++ b/test/specs/jsdoc/tag/type/jsdocType.js @@ -20,27 +20,27 @@ describe("jsdoc/tag/type/jsdocType", function() { var info = jsdocType.parse( { name: "[foo]" } ); expect(info.name).toEqual("foo"); expect(info.optional).toEqual(true); - expect( info['default'] ).toEqual(null); + expect( info.defaultvalue ).toEqual(null); info = jsdocType.parse( { name: "[ bar ]" } ); expect(info.name).toEqual("bar"); expect(info.optional).toEqual(true); - expect( info['default'] ).toEqual(null); + expect( info.defaultvalue ).toEqual(null); }); it("should recognize optional properties with default values", function() { var info = jsdocType.parse( { name: "[foo=bar]" } ); expect(info.name).toEqual("foo"); expect(info.optional).toEqual(true); - expect( info['default'] ).toEqual("bar"); + expect( info.defaultvalue ).toEqual("bar"); info = jsdocType.parse( { name: "[ baz = qux ]" } ); expect(info.name).toEqual("baz"); expect(info.optional).toEqual(true); - expect( info['default'] ).toEqual("qux"); + expect( info.defaultvalue ).toEqual("qux"); }); - it("should only change the `name`, `optional`, and `default` properties", function() { + it("should only change the `name`, `optional`, and `defaultvalue` properties", function() { var obj = { name: "[foo=bar]", type: "boolean|string", @@ -48,9 +48,9 @@ describe("jsdoc/tag/type/jsdocType", function() { optional: null, nullable: null, variable: null, - 'default': null + defaultvalue: null }; - var shouldChange = [ "name", "optional", "default" ]; + var shouldChange = [ "name", "optional", "defaultvalue" ]; var info = jsdocType.parse(obj); for (var key in info) {