Created
November 17, 2010 20:06
-
-
Save tommedema/703968 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* SomeClass.js */ | |
Class("SomeClass", { | |
use : ["jquery.js", "OtherClass"], | |
after : { | |
initialize : function() { | |
var thisInstance = this; | |
use("jquery.js", function() { | |
console.log("Jquery should be loaded here: %o", jQuery); | |
use("OtherClass", function() { | |
new OtherClass(); | |
}); | |
}); | |
} | |
} | |
}); | |
/* OtherClass.js */ | |
Class("OtherClass", { | |
after : { | |
initialize : function() { | |
console.log("I did not set jquery.js as dependency here, but it is still loaded, see %o", jQuery); | |
// this is a problem because it should not be available here!!! | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment