Small loader changes

This commit is contained in:
WolverinDEV 2019-03-29 19:28:07 +01:00
parent ae4d5a93b2
commit 0542c20a97

View file

@ -118,11 +118,11 @@ namespace loader {
await Promise.all([...promises]); await Promise.all([...promises]);
if(errors.length > 0) { if(errors.length > 0) {
console.groupEnd();
console.error("Failed to execute loader. The following tasks failed (%d):", errors.length); console.error("Failed to execute loader. The following tasks failed (%d):", errors.length);
for(const error of errors) for(const error of errors)
console.error(" - %s: %o", error.task.name, error.error); console.error(" - %s: %o", error.task.name, error.error);
console.groupEnd();
throw "failed to process step " + Stage[current_stage]; throw "failed to process step " + Stage[current_stage];
} }
@ -988,6 +988,7 @@ try { /* lets try to print it as VM code :)*/
let hello_world_code = hello_world.toString(); let hello_world_code = hello_world.toString();
hello_world_code = hello_world_code.substr(hello_world_code.indexOf('() => {') + 8); hello_world_code = hello_world_code.substr(hello_world_code.indexOf('() => {') + 8);
hello_world_code = hello_world_code.substring(0, hello_world_code.lastIndexOf("}")); hello_world_code = hello_world_code.substring(0, hello_world_code.lastIndexOf("}"));
hello_world_code = hello_world_code.replace(/(?!"\S*) {2,}(?!\S*")/g, " ").replace(/[\n\r]/g, "");
eval(hello_world_code); eval(hello_world_code);
} catch(e) { } catch(e) {
hello_world(); hello_world();