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) {
|
function evalInContext(js, context, locals, passingArguments) {
|
||||||
//# Return the results of the in-line anonymous function we .call with the passed context
|
//# Return the results of the in-line anonymous function we .call with the passed context
|
||||||
log('='.repeat(80) + 'OG Block');
|
// log('='.repeat(80) + 'OG Block');
|
||||||
log(js);
|
// log(js);
|
||||||
log('='.repeat(80) + 'Arguments');
|
// log('='.repeat(80) + 'Arguments');
|
||||||
log(passingArguments);
|
// log(passingArguments);
|
||||||
const that = this;
|
const that = this;
|
||||||
return function() {
|
return function() {
|
||||||
const preminJs =
|
const preminJs =
|
||||||
|
|
@ -96,11 +96,11 @@ function evalInContext(js, context, locals, passingArguments) {
|
||||||
${Object.keys(passingArguments).map(name => `let ${name} = passingArguments.${name};`).join('\n\t')}
|
${Object.keys(passingArguments).map(name => `let ${name} = passingArguments.${name};`).join('\n\t')}
|
||||||
${js}
|
${js}
|
||||||
})();`;
|
})();`;
|
||||||
log('='.repeat(80) + 'preminjs');
|
// log('='.repeat(80) + 'preminjs');
|
||||||
log(preminJs);
|
// log(preminJs);
|
||||||
const newJs = minify(preminJs);
|
const newJs = minify(preminJs);
|
||||||
log('='.repeat(80) + 'minjs');
|
// log('='.repeat(80) + 'minjs');
|
||||||
log(newJs);
|
// log(newJs);
|
||||||
// newJs should inject into result...
|
// newJs should inject into result...
|
||||||
let result;
|
let result;
|
||||||
eval(newJs);
|
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';
|
import random from 'random-world';
|
||||||
|
|
||||||
restore {
|
restore {
|
||||||
if(this.places.empty) {
|
if(this.places.empty)
|
||||||
for(let i = 0; i < 10; i ++) {
|
this.createPlaces();
|
||||||
const name = random.city();
|
|
||||||
if(name.indexOf(' ') > -1) {
|
|
||||||
i --;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
console.log(name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
character ??= create('')
|
this.character ??= create('')
|
||||||
}
|
}
|
||||||
|
|
||||||
async render() {
|
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