js-doc-parse
js-doc-parse copied to clipboard
lang.extend({}, stuff) puts stuff in Object.prototype, thus appearing everywhere
When running parse.sh on the dojo/ directory (dojo core code), it gets confused about which methods belong to which objects. For example, AdapterRegistry is listed as having the animation functions:
<object location="dojo/AdapterRegistry" type="function">
<properties>...</properties>
<methods>
<method name="_anim" scope="prototype" type="function" from="dojo/NodeList-fx">...</method>
<method name="wipeIn" scope="prototype" type="function" from="dojo/NodeList-fx">
<parameters>
OK, I managed to work around the problem by cleaning up the usage of NodeList, see http://bugs.dojotoolkit.org/changeset/28941/dojo.
It was partially caused by the module-level-summary workarounds where files like NodeList-fx.js have
/*=====
return {
// summary:
// ...
};
=====*/
...
return NodeList;
So, not sure if there's a bug here or not, you can just close it if you like.
The way that prototypes are set for non-Function values is a bit wrong right now, which means that if someone does lang.extend({}, stuff) the keys from stuff will get set on Object.prototype even though {} does not have a prototype (only __proto__).
Ha ha, OK yes that explains the bizarre behavior. Anyway this isn't blocking the release, you can set it to milestone future.