Don't log RAM calculator parse errors. Add semicolons and newlines when importing from URL in NSJS

This commit is contained in:
danielyxie 2018-10-03 15:24:32 -05:00
parent 037b521e02
commit f86d87fa03
2 changed files with 3 additions and 3 deletions

File diff suppressed because one or more lines are too long

@ -471,7 +471,7 @@ async function parseOnlyRamCalculate(server, code, workerScript) {
code = ""; code = "";
for (const prop in module) { for (const prop in module) {
if (typeof module[prop] === 'function') { if (typeof module[prop] === 'function') {
code += module[prop].toString(); code += module[prop].toString() + ";\n";
} }
} }
} catch(e) { } catch(e) {
@ -566,7 +566,7 @@ async function parseOnlyRamCalculate(server, code, workerScript) {
return ram; return ram;
} catch (error) { } catch (error) {
console.info("parse or eval error: ", error); // console.info("parse or eval error: ", error);
// This is not unexpected. The user may be editing a script, and it may be in // This is not unexpected. The user may be editing a script, and it may be in
// a transitory invalid state. // a transitory invalid state.
return -1; return -1;