UNPKG

@neo-one/smart-contract-compiler

Version:

NEO•ONE TypeScript smart contract compiler.

36 lines (34 loc) 1.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RawEnumeratorFindHelper = void 0; const Helper_1 = require("../Helper"); class RawEnumeratorFindHelper extends Helper_1.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'); }, })); } } exports.RawEnumeratorFindHelper = RawEnumeratorFindHelper; //# sourceMappingURL=RawEnumeratorFindHelper.js.map