didier

work on engine readability

......@@ -66,7 +66,7 @@ arcs_module = function(moduleDefinition, deps) {
// shim performed
require([dep],
function(d) { resolve(d); },
function(err) { reject(dep, err); }
function(err) { console.log("[ARCS] Trouble with module ", dep); reject(dep, err); }
);
}
});
......
......@@ -120,16 +120,18 @@ ARCS.Context = function( ctx ) {
var p, promises=[];
for (p in components) {
if (components.hasOwnProperty(p)) {
if (components.hasOwnProperty(p)) {
if (factories[components[p].type] === undefined) {
console.error("[ARCS] Factory " + components[p].type + " not found.");
console.error("[ARCS] Context dump follows: ", libraries, components, constants);
return ;
}
factory = factories[components[p].type];
try {
if (components[p].value !== undefined || components[p].url !== undefined || components[p].ref !== undefined) {
if (components[p].value !== undefined) {
console.log("instanciating ", p);
components[p].instance = new factory(components[p].value);
}
if (components[p].url !== undefined) {
......@@ -147,6 +149,7 @@ ARCS.Context = function( ctx ) {
} else {
components[p].instance = new factory();
}
} catch(e) { console.error("[ARCS] Component of type ", p, " not instanciated.", e);}
}
}
return Promise.all(promises);
......