UNPKG

@neo-one/smart-contract-compiler

Version:

NEO•ONE TypeScript smart contract compiler.

22 lines (20 loc) 870 B
import { tsUtils } from '@neo-one/ts-utils'; import { Types } from '../../../constants'; import { BuiltinInstanceMemberCall } from '../../BuiltinInstanceMemberCall'; export class SetStorageForEach extends BuiltinInstanceMemberCall { canCall(_sb, _func, node) { return tsUtils.argumented.getArguments(node).length === 1; } emitCall(sb, func, node, optionsIn, visited) { const options = sb.pushValueOptions(optionsIn); if (!visited) { sb.visit(tsUtils.expression.getExpression(func), options); } if (tsUtils.argumented.getArguments(node).length < 1) { return; } sb.visit(tsUtils.argumented.getArguments(node)[0], options); sb.emitHelper(node, optionsIn, sb.helpers.forEachKeyFuncStructuredStorage({ type: Types.SetStorage })); } } //# sourceMappingURL=forEach.js.map