Fix execution of code

This commit is contained in:
Samy Pessé
2014-04-01 00:24:09 -07:00
parent b3c865ef58
commit e08b09f3cf
2 changed files with 7 additions and 11 deletions
+6 -10
View File
@@ -74,16 +74,12 @@ define(function(){
};
var execute = function(solution, validation, callback) {
evalJS(solution + ass + validation, function(err, res) {
if(err) {
return callback(err);
}
console.log('validation =', res);
if (res.type == "error") {
callback(new Error(res.value));
} else {
callback(null, res.value);
}
// Validate with validation code
evalJS([solution, ass, validation].join(";\n"), function(err, res) {
if(err) return callback(err);
if (res.type == "error") callback(new Error(res.value));
else callback(null, res.value);
});
};
+1 -1
View File
File diff suppressed because one or more lines are too long