@neo-one/smart-contract-compiler
Version:
NEO•ONE TypeScript smart contract compiler.
22 lines (20 loc) • 713 B
JavaScript
import * as constants from '../../../constants';
import { Helper } from '../Helper';
export class HandleCompletionHelper extends Helper {
emit(sb, node, optionsIn) {
const options = sb.pushValueOptions(optionsIn);
sb.emitHelper(node, options, sb.helpers.if({
condition: () => {
sb.emitPushInt(node, constants.NORMAL_COMPLETION);
sb.emitOp(node, 'NUMEQUAL');
},
whenFalse: () => {
sb.emitHelper(node, options, sb.helpers.throwCompletion);
},
}));
if (!optionsIn.pushValue) {
sb.emitOp(node, 'DROP');
}
}
}
//# sourceMappingURL=HandleCompletionHelper.js.map