@neo-one/smart-contract-compiler
Version:
NEO•ONE TypeScript smart contract compiler.
28 lines (26 loc) • 1.06 kB
JavaScript
import { StructuredStorageBaseHelper } from './StructuredStorageBaseHelper';
export class ForEachValStructuredStorageHelper extends StructuredStorageBaseHelper {
constructor({ each, ...rest }) {
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');
},
}));
},
}));
}
}
//# sourceMappingURL=ForEachValStructuredStorageHelper.js.map