Skip to content
This repository has been archived by the owner on Dec 31, 2017. It is now read-only.

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

Open
wkeese opened this issue Jun 20, 2012 · 3 comments

Comments

@wkeese
Copy link
Collaborator

wkeese commented Jun 20, 2012

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
Copy link
Collaborator Author

wkeese commented Jun 20, 2012

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.

@csnover
Copy link
Owner

csnover commented Jun 23, 2012

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

@wkeese
Copy link
Collaborator Author

wkeese commented Jun 24, 2012

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants