if (Check.versionOf("foo.js") == Check.NOT_LOADED) {
// foo.js is not loaded
}
// this might cause foo.js to be autoloaded...
if (Check.has("foo.js") == Check.NOT_LOADED) {
// tried to load foo.js but did not succeed
} else {
// foo.js autoloaded or was already loaded
}
// this will prevent foo.js from being autoloaded...
if (Check.has("foo.js", Check.NOT_LOADED)) {
// foo.js is not loaded
} else {
// foo.js was already loaded
}
Requiring a script to be not loaded...
var dependencies = {
"bar.js": Check.ANY_VERSION,
"foo.js": Check.NOT_LOADED
};
// the task will only run if bar.js is loaded and foo.js is *not* loaded
Check.doWhen(dependencies, self, task);
// will throw an error if bar.js is not loaded or foo.js is loaded
Check.required(dependencies, self);