Not sure I can word this right, so here's some code:
Note: this is in a file called a.js which is a dojo module
define([], function() {
var j = {
a : function() {
//a object
},
b : function() {
//b object
this.x = new j.a();// this works
this.y = new this.a(); // this causes error later, see jsfiddle link below
},
c : function() {
//c object
}
}
return j;
});
I simply want object b when creating a new 'a' object to do it as new (b's parent).a(); rather than new j.a(); where variable j is happens to be b's parent. Not sure if that explanation helped, but I basically want a relative way of creating a new 'a' object from b.
Error is reproduced in this code: http://jsfiddle.net/WhhV5/3/
Not sure how to run dojo stuff in jsfiddle so the code may not run, but these are the two files used on my home xampp