less verbose invocation logging
parent
9aa7ac1cb8
commit
a9a6837c29
16
Instance.js
16
Instance.js
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
namespace places
|
||||
26
test/world.v
26
test/world.v
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue