YUILibrary - Open source JavaScript and CSS for building richly interactive software.
Fork YUI on GitHub

YUI 2.x

Ticket #2173343 (checkedin defect)

Reporter


Peter Foti
Opened: 12/4/09
Last modified: 12/7/09
Status: checkedin
Type: defect
Resolution: fixed

Owner


Adam Moore
Target Release:
Priority:
Summary: Can't @extend namespaced base class that has @config
Description:

I have a base class that is not a top level class. That is, it is defined as "MyNamespace.BaseClass", with a "." separating the namespace from classname. This base class contains an @config property.
I have a subclass that does @extend MyNamespace.BaseClass, but the YUIDoc throws a KeyError:

C:yuidocbin>api.bat
C:yuidocbinyuidoc_generate.py:17: DeprecationWarning: the sets module is deprecated
from sets import Set
INFO: -------------------------------------------------------
INFO: parsing api.js
INFO: deferred module file: api.js
INFO:

tokenMap:

{'description': [u'Test module that contains a base class and subclass, with config properties.'], 'module': ['mymodule']}

INFO: -------------------------------------------------------
INFO: highlighting api.js
INFO: -------------------------------------------------------
INFO: Writing raw.json
INFO: Generating module splash for mymodule
INFO: Generating API page for MyNamespace.BaseClass
INFO: Generating API page for MyNamespace.SubClass
Traceback (most recent call last):
File "C:yuidocbinyuidoc.py", line 104, in <module>
main()
File "C:yuidocbinyuidoc.py", line 99, in main
gen.process()
File "C:yuidocbinyuidoc_generate.py", line 576, in process
self.write("%s.html" %(self.classname), t)
File "C:yuidocbinyuidoc_generate.py", line 104, in write
out.writelines(str(data))
File "C:ProgramsPython26libsite-packagescheetah-2.2.1-py2.6.eggCheetahTemplate.py", line 997, in __str__
return getattr(self, mainMethName)()
File "_yuidoc_template_main_tmpl.py", line 1187, in respond
KeyError: 'MyNamespace.BaseClass'

Note, if @config is changed to @property, it works fine.
Here is a simple test case:

/**
* Test module that contains a base class and subclass, with config properties.
* @module mymodule
* @namespace MyNamespace
*/
/**
* This is the Base class
* @class BaseClass
*/
/**
* The config property to inherit. Note, if this is changed to property it works
* @config foo
* @type String
*/
/**
* This is a subclass
* @class SubClass
* @constructor
* @extends MyNamespace.BaseClass
* @param o {object} The configuration object. See configuration attributes.
*/
/**
* Blah blah blah
* @config bar
* @type String
*/

Type: defect Observed in Version: 1.0.0b1
Component: YUIDoc Severity: S3 (normal)
Assigned To: Adam Moore Target Release:
Location: Priority:
Tags: @config, @extend Relates To:
Browsers: N/A
URL:
Test Information:

Put the following into a .js file of it's own and then attempt to generate the docs:

/**
* Test module that contains a base class and subclass, with config properties.
* @module mymodule
* @namespace MyNamespace
*/
/**
* This is the Base class
* @class BaseClass
*/
/**
* The config property to inherit. Note, if this is changed to property it works
* @config foo
* @type String
*/
/**
* This is a subclass
* @class SubClass
* @constructor
* @extends MyNamespace.BaseClass
* @param o {object} The configuration object. See configuration attributes.
*/
/**
* Blah blah blah
* @config bar
* @type String
*/

Change History

Adam Moore

YUI Developer

Posted: 12/7/09
  • resolution changed to fixed
  • status changed from new to checkedin

Fixed incorrect index for inherited configuration attributes [fixes #2173343].
View Commit: