FIxed bug with script errors in nested progs

This commit is contained in:
Daniel Xie
2017-06-07 16:18:21 -05:00
parent a99e9391f2
commit 598efda098
4 changed files with 14 additions and 3 deletions
+8 -2
View File
@@ -104,8 +104,14 @@ function evaluate(exp, workerScript) {
evaluateProgPromise.then(function(w) {
resolve(workerScript);
}, function(e) {
workerScript.errorMessage = e.toString();
reject(workerScript);
if (typeof e === 'string' || e instanceof String) {
workerScript.errorMessage = e;
reject(workerScript);
} else if (e instanceof WorkerScript) {
reject(e);
} else {
reject(workerScript);
}
});
break;
case "call":