Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#1358 closed defect (invalid)

dojo.hostenv.loadPath Requires dojo.widget.* Bug

Reported by: ole_ersoy@… Owned by: James Burke
Priority: high Milestone:
Component: Loader Version: 0.3
Keywords: Cc: ole_ersoy@…
Blocked By: Blocking:

Description

I have this in a script block after the script blocks that load dojo and jsunit:

dojo.require('dojo.widget.*'); dojo.hostenv.loadPath("../../src/main/js/Validators.js");

Validators.js just has this in it:

dojo.declare("V", null, { });

If I comment out

dojo.require('dojo.widget.*');

I can no longer create a V class, so

function testVCreation() { v= new V; }

will not pass.

Seems like loadPath should be independent of widgets...

If you need to see template examples Just search for my name and various bug reports / enhancements will come up with the standard templates I use.

Change History (4)

comment:1 Changed 13 years ago by dylan

Component: GeneralPackageSystem
Milestone: 0.4
Owner: changed from anonymous to alex

comment:2 Changed 13 years ago by James Burke

Owner: changed from alex to James Burke

Stealing io and package bugs from Alex. Holler if you want it back.

comment:3 Changed 13 years ago by James Burke

Cc: ole_ersoy@… added
Resolution: invalid
Status: newclosed

It looks like you are not doing a dojo.require("dojo.lang.declare"); inside Validators.js (put it at the top of the file). dojo.declare is not something that is automatically available in dojo, you have to load the pacakge for it. By doing a dojo.require("dojo.widget.*"), that is loading dojo.lang.declare.

In general, if you call any dojo.* methods in a file, be sure to put the corresponding dojo.require() statements at the top of the file (in this case Validators.js).

Also, it is suggested that you do not call dojo.hostenv.loadPath() directly. dojo.hostenv.* methods are generally considered "private" to dojo, although this is not strictly enforced. But I suggest using the normal dojo.require/provide syntax to load the files.

Marking the bug as resolved/invalid, but feel free to add more information or reopen if doing the dojo.require("dojo.lang.declare"); does not work.

comment:4 Changed 12 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.