fix: Report build errors to dev console (#36540)

This commit is contained in:
Oliver Eyton-Williams
2019-08-06 19:58:16 +01:00
committed by mrugesh
parent 8d0c027fa4
commit 052e30aff3

View File

@ -31,7 +31,8 @@ const __utils = (() => {
}
return {
postResult
postResult,
oldLog
};
})();
@ -54,7 +55,12 @@ self.onmessage = async e => {
`);
} catch (err) {
if (__userCodeWasExecuted) {
// rethrow error, since test failed.
throw err;
} else {
// report errors to dev console (not the editor console, since the test
// may still pass)
__utils.oldLog(err);
}
testResult = eval(e.data.testString);
}