if (Check.versionOf("foo.js") == Check.NOT_LOADED) {
// foo.js is not loaded
}
// this will attempt to load foo.js if not already loaded...
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 not attempt to autoload foo.js...
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);