for (ScriptModule dependencyModule : module.getDependencies()) {
// since ScriptModule (holding dependency collection) is immutable it is
// not possible to create cyclic dependency (ie module dependency is reference to
// its defining module) so actually this check is never violated
if (dependencyModule == module) {
throw new CyclicDependencyScriptModuleException(
"Module " + module + " is referenced by its dependency module.");
}
if (!isRegistered(dependencyModule)) {
throw new UnregisteredScriptModuleDependencyException(
"Depency module " + dependencyModule + " hasn't been registered.");