#9407 closed defect (wontfix)
dojo.declare: allow creating constructors not bound to global module name
Reported by: | James Burke | Owned by: | James Burke |
---|---|---|---|
Priority: | high | Milestone: | future |
Component: | Core | Version: | 1.3.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
In ServerJS land: https://developer.mozilla.org/ServerJS
there is a desire to allow creating object constructors that do not bind to a global module name. We should allow dojo.declare() to just create the constructor without doing the module binding to a name.
Attachments (1)
Change History (4)
Changed 12 years ago by
Attachment: | 9407.patch added |
---|
comment:1 Changed 12 years ago by
Milestone: | 1.4 → future |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
Attached a patch, but this causes a problem for the declaredClass property. It uses className.
declaredClass is used by dijit to create instance IDs, uses it to do a getObject to get default attributes.
dojo.NodeList?'s instantiate method uses it to create instances. This anonymous constructor functionality would not be used likely with NodeList?.instantiate, but the widget implications are a little bit more troublesome.
In general it is nice to be able to use a string name for a module/constructor -- it means you do not have to know the name beforehand and allows dynamic code loading. So I'll close this as wontfix.
comment:2 Changed 12 years ago by
FYI: dojox.lang.oo.declare
is a faster experimental drop-in replacement for dojo.declare
. It implements the *subj* already --- see the inline documentation at the end of the file. The real purpose of this version was to fix numerous bugs in the existing implementation (e.g., this,inherited()
doesn't work sometimes depending on numerous factors). It is suitably complete --- I was able to replace declare.js
and run Dijit tests without any noticeable problems.
comment:3 Changed 12 years ago by
I forgot to add the link to the source code: http://bugs.dojotoolkit.org/browser/dojox/trunk/lang/oo/declare.js
Possible patch