js-doc-parse icon indicating copy to clipboard operation
js-doc-parse copied to clipboard

lang.extend({}, stuff) puts stuff in Object.prototype, thus appearing everywhere

Open wkeese opened this issue 13 years ago • 3 comments

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>

wkeese avatar Jun 20 '12 08:06 wkeese

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.

wkeese avatar Jun 20 '12 12:06 wkeese

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__).

csnover avatar Jun 23 '12 17:06 csnover

Ha ha, OK yes that explains the bizarre behavior. Anyway this isn't blocking the release, you can set it to milestone future.

wkeese avatar Jun 24 '12 02:06 wkeese