Skip to content

Instantly share code, notes, and snippets.

@canonic-epicure
Created November 17, 2010 20:16
Show Gist options
  • Save canonic-epicure/703996 to your computer and use it in GitHub Desktop.
Save canonic-epicure/703996 to your computer and use it in GitHub Desktop.
/* SomeClass.js */
Class("SomeClass", {
use : ["jquery.js", "OtherClass"],
after : {
initialize : 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!!!
}
}
});
use('SomeClass', function () {
var a = new SomeClass()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment