if (name == null) {
throw new IllegalArgumentException("name can't be null");
}
ResourceId id = new ResourceId(scope, name);
ExoContainer container = ExoContainerContext.getCurrentContainer();
JavascriptConfigService service = (JavascriptConfigService) container
.getComponentInstanceOfType(JavascriptConfigService.class);
ScriptResource resource = service.getResource(id);
if (resource != null) {
if (FetchMode.IMMEDIATE.equals(resource.getFetchMode())) {
resourceIds.add(id, null);
} else {
Map<ResourceId, FetchMode> tmp = new HashMap<ResourceId, FetchMode>();
tmp.put(id, null);
for (ScriptResource res : service.resolveIds(tmp).keySet()) {
if (res.isNativeAmd()) {
/* Require scopeless id for native AMD modules. They are implicitly SHARED
* and baseUrl of requirejs ends with SHARED. Therefore there is no need
* to prepend the scope to the name here. */
require(res.getId().getName());