UNPKG

@neo-one/smart-contract-compiler

Version:

NEO•ONE TypeScript smart contract compiler.

32 lines (30 loc) 1 kB
import { Helper } from '../Helper'; export class RawEnumeratorFindHelper extends Helper { constructor(options) { super(); this.each = options.each; } emit(sb, node, optionsIn) { const options = sb.pushValueOptions(optionsIn); sb.emitHelper(node, options, sb.helpers.rawEnumeratorFilter({ each: this.each, })); sb.emitOp(node, 'DUP'); sb.emitHelper(node, options, sb.helpers.if({ condition: () => { sb.emitOp(node, 'ARRAYSIZE'); sb.emitPushInt(node, 0); sb.emitOp(node, 'NUMEQUAL'); }, whenTrue: () => { sb.emitOp(node, 'DROP'); sb.emitHelper(node, options, sb.helpers.wrapUndefined); }, whenFalse: () => { sb.emitPushInt(node, 0); sb.emitOp(node, 'PICKITEM'); }, })); } } //# sourceMappingURL=RawEnumeratorFindHelper.js.map