diff --git a/changes.md b/changes.md index 6457f250..4bdd0900 100644 --- a/changes.md +++ b/changes.md @@ -30,3 +30,10 @@ uninterpretted, atomic string in the namepath. @name chat."#channel".open */ chat['#channel'].open = true; + +Support For E4X +--- + +[new] As a benefit of using Rhino's own JavaScript parser, JSDoc has inherited +the ability to parse any source code that Rhino can parse, including the latest +syntax patterns like E4X (ECMAScript for XML). \ No newline at end of file diff --git a/modules/jsdoc/tagdictionary.js b/modules/jsdoc/tagdictionary.js index 95cf26ed..e7d3c433 100644 --- a/modules/jsdoc/tagdictionary.js +++ b/modules/jsdoc/tagdictionary.js @@ -14,7 +14,7 @@ /*synonym => canonical*/ 'description': 'desc', 'function': 'method', - 'variable': 'property', + 'var': 'property', 'field': 'property', 'return': 'returns', 'member': 'memberof', diff --git a/test/samples/etc_e4x.js b/test/samples/etc_e4x.js new file mode 100644 index 00000000..b91951df --- /dev/null +++ b/test/samples/etc_e4x.js @@ -0,0 +1,10 @@ +/** @var */ +var exampleDocs = <> +/** @function */ function foo(){} +/** @var */ var x = 1; +; + +/** @function */ +function show() { + alert(example.length()); // shows 2 +} \ No newline at end of file diff --git a/test/samples/jsdoc_resolvevar.js b/test/samples/jsdoc_resolvevar.js index 89942da9..0ab67e5d 100644 --- a/test/samples/jsdoc_resolvevar.js +++ b/test/samples/jsdoc_resolvevar.js @@ -16,13 +16,13 @@ this.globalprop = { })(mylib); var go = { - /** @variable */ + /** @var */ gp: true }; -/** @variable */ +/** @var */ var foo, - /** @variable */ + /** @var */ bar; diff --git a/test/tests/12_tag_property.js b/test/tests/12_tag_property.js index 0e6296c0..391612e4 100644 --- a/test/tests/12_tag_property.js +++ b/test/tests/12_tag_property.js @@ -69,7 +69,7 @@ }); }); - describe('A doclet with a named @variable tag and a description', function() { + describe('A doclet with a named @var tag and a description', function() { it('should have an `isa` property set to "property"', function() { var doclet = doclets[5].toObject(); expect(doclet).to(have_property, 'isa'); @@ -127,7 +127,7 @@ @property {string} zip */ - /** @variable zub - The description here. */ + /** @var zub - The description here. */ /** @property {Function} */ onShow = callbacks[0];