less verbose invocation logging

sdl
Marcus 2021-05-18 10:51:53 -04:00
parent 9aa7ac1cb8
commit a9a6837c29
4 changed files with 24 additions and 19 deletions

View File

@ -83,10 +83,10 @@ export default class Instance extends Serializable {
function evalInContext(js, context, locals, passingArguments) {
//# Return the results of the in-line anonymous function we .call with the passed context
log('='.repeat(80) + 'OG Block');
log(js);
log('='.repeat(80) + 'Arguments');
log(passingArguments);
// log('='.repeat(80) + 'OG Block');
// log(js);
// log('='.repeat(80) + 'Arguments');
// log(passingArguments);
const that = this;
return function() {
const preminJs =
@ -96,11 +96,11 @@ function evalInContext(js, context, locals, passingArguments) {
${Object.keys(passingArguments).map(name => `let ${name} = passingArguments.${name};`).join('\n\t')}
${js}
})();`;
log('='.repeat(80) + 'preminjs');
log(preminJs);
// log('='.repeat(80) + 'preminjs');
// log(preminJs);
const newJs = minify(preminJs);
log('='.repeat(80) + 'minjs');
log(newJs);
// log('='.repeat(80) + 'minjs');
// log(newJs);
// newJs should inject into result...
let result;
eval(newJs);

View File

@ -0,0 +1 @@
namespace places

View File

@ -5,20 +5,24 @@ link character;
import random from 'random-world';
restore {
if(this.places.empty) {
for(let i = 0; i < 10; i ++) {
const name = random.city();
if(name.indexOf(' ') > -1) {
i --;
continue;
}
console.log(name);
}
}
if(this.places.empty)
this.createPlaces();
character ??= create('')
this.character ??= create('')
}
async render() {
}
createPlaces() {
for(let i = 0; i < 10; i ++) {
const name = random.city();
const valid = !!name.match(/^[A-Za-z ]*$/);
if(!valid) {
i --;
continue;
}
console.log(name);
}
}