Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
compileLogic() {
let sourceErgo = this.getLogic();
if (sourceErgo === undefined || sourceErgo.length === 0) {
return null;
}
const compiledErgo = ErgoCompiler.compileToJavaScript(sourceErgo,this.modelManager.getModels(),'cicero',true);
//console.log('compiling' + this.contents);
if (compiledErgo.hasOwnProperty('error')) {
throw new Error(ErgoCompiler.ergoVerboseErrorToString(compiledErgo.error));
}
this.compiledScript = new Script(this.modelManager, 'main.js', '.js', compiledErgo.success);
return this.compiledScript;
}