UNPKG

@neo-one/smart-contract-compiler

Version:

NEO•ONE TypeScript smart contract compiler.

34 lines (32 loc) 1.38 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ForEachValStructuredStorageHelper = void 0; const tslib_1 = require("tslib"); const StructuredStorageBaseHelper_1 = require("./StructuredStorageBaseHelper"); class ForEachValStructuredStorageHelper extends StructuredStorageBaseHelper_1.StructuredStorageBaseHelper { constructor(_a) { var { each } = _a, rest = tslib_1.__rest(_a, ["each"]); super(rest); this.each = each; } emit(sb, node, options) { sb.emitHelper(node, options, sb.helpers.forEachStructuredStorageBase({ type: this.type, each: (innerOptions) => { sb.emitHelper(node, sb.pushValueOptions(innerOptions), sb.helpers.if({ condition: () => { sb.emitHelper(node, sb.pushValueOptions(innerOptions), sb.helpers.handleValValueStructuredStorage); }, whenTrue: () => { this.each(sb.noPushValueOptions(innerOptions)); }, whenFalse: () => { sb.emitOp(node, 'DROP'); }, })); }, })); } } exports.ForEachValStructuredStorageHelper = ForEachValStructuredStorageHelper; //# sourceMappingURL=ForEachValStructuredStorageHelper.js.map