UNPKG

@neo-one/smart-contract-compiler

Version:

NEO•ONE TypeScript smart contract compiler.

25 lines (23 loc) 886 B
import { tsUtils } from '@neo-one/ts-utils'; import { BuiltinInstanceMemberCall } from '../../BuiltinInstanceMemberCall'; export class StorageForEach extends BuiltinInstanceMemberCall { constructor(type) { super(); this.type = type; } 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.forEachFuncStructuredStorage({ type: this.type })); } } //# sourceMappingURL=forEach.js.map