diff --git a/Instance.js b/Instance.js index f6fc866..8b9e282 100644 --- a/Instance.js +++ b/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); diff --git a/test/forest.v b/test/places/forest.v similarity index 100% rename from test/forest.v rename to test/places/forest.v diff --git a/test/places/population.v b/test/places/population.v new file mode 100644 index 0000000..8aff8b4 --- /dev/null +++ b/test/places/population.v @@ -0,0 +1 @@ +namespace places \ No newline at end of file diff --git a/test/world.v b/test/world.v index 8528b40..c59b7b4 100644 --- a/test/world.v +++ b/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); + } } \ No newline at end of file