mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-24 03:16:40 +00:00
Fix execution of code
This commit is contained in:
@@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user