Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return;
}
globalObserver.emit('Error', e);
const { initArgs, tradeOptions } = this.bot.tradeEngine;
this.terminateSession();
this.init();
this.$scope.observer.register('Error', onError);
this.bot.tradeEngine.init(...initArgs);
this.bot.tradeEngine.start(tradeOptions);
this.revert(this.startState);
};
this.$scope.observer.register('Error', onError);
this.interpreter = new JSInterpreter(code, initFunc);
this.onFinish = resolve;
this.loop();
});
}
return new Promise(r => {
const interpreter = new Interpreter(code, initFunc)
const loop = () => {
if (this.stopped || !interpreter.run()) {
if (this.observer) {
this.observer.unregisterAll('CONTINUE')
}
r(interpreter.pseudoToNative(interpreter.value))
return
}
if (!this.observer.isRegistered('CONTINUE')) {
this.observer.register('CONTINUE', () => setTimeout(loop, 0))
}
}
loop()
})