Progress towards refactoring

This commit is contained in:
Berkeley Martinez
2015-11-13 11:10:23 -08:00
parent 545e545f51
commit 748f7ab93f
18 changed files with 1291 additions and 925 deletions

View File

@@ -11,11 +11,11 @@ function importScript(url, error) {
return error;
}
function run(code) {
function run(code, cb) {
var err = null;
var result = {
input: code,
output: null,
error: null,
type: null
};
@@ -24,10 +24,15 @@ function run(code) {
result.type = typeof codeExec;
result.output = stringify(codeExec);
} catch (e) {
result.error = e.message;
err = e;
}
if (err) {
cb(err.message, null);
} else {
cb(null, result);
}
application.remote.output(result);
self.close();
}