Permalink
Browse files

Parse will warn instead of fail and stop when a class tag has no name

  • Loading branch information...
1 parent 8328d21 commit 98591260f8daafe522613405b5e9dc9fdbd40e3f Diogenes Brito committed Nov 1, 2011
Showing with 17 additions and 13 deletions.
  1. +17 −13 lib/docparser.js
View
@@ -460,25 +460,29 @@ Y.log('param name/type/descript missing: ' + stringlog(block), 'warn', 'docparse
return host;
},
- // A key bock type for declaring classes, subsequent
+ // A key block type for declaring classes, subsequent
// member blocks will be assigned to this class
'class': function(tagname, value, target, block) {
- //console.log('Setting current class: ', value);
+ // console.log('Setting current class: ', value);
this.set(CURRENT_CLASS, value);
var fullname = this.get(CURRENT_CLASS);
var host = this.classes[fullname],
parent = this.get(CURRENT_MODULE);
- if (parent) {
- host.module = parent;
- }
- //Merge host and target in case the class was defined in a "for" tag
- //before it was defined in a "class" tag
- host = Y.merge(host, target);
- this.classes[fullname] = host;
- parent = this.get(CURRENT_SUBMODULE);
- if (parent) {
- //this.set(CURRENT_SUBMODULE, parent);
- host.submodule = parent;
+ if (host) {
+ if (parent) {
+ host.module = parent;
+ }
+ //Merge host and target in case the class was defined in a "for" tag
+ //before it was defined in a "class" tag
+ host = Y.merge(host, target);
+ this.classes[fullname] = host;
+ parent = this.get(CURRENT_SUBMODULE);
+ if (parent) {
+ //this.set(CURRENT_SUBMODULE, parent);
+ host.submodule = parent;
+ }
+ } else {
+ Y.log('found class tag with no name' + stringlog(block), 'warn', 'docparser');
}
return host;
},

0 comments on commit 9859126

Please sign in to comment.