UNPKG

@neo-one/smart-contract-compiler

Version:

NEO•ONE TypeScript smart contract compiler.

27 lines (25 loc) 839 B
import { tsUtils } from '@neo-one/ts-utils'; import { BuiltinMemberCall } from '../BuiltinMemberCall'; export class ValueFor extends BuiltinMemberCall { constructor(syscall, wrap) { super(); this.syscall = syscall; this.wrap = wrap; } emitCall(sb, _func, node, optionsIn) { if (tsUtils.argumented.getArguments(node).length < 1) { return; } const options = sb.pushValueOptions(optionsIn); sb.visit(tsUtils.argumented.getArguments(node)[0], options); if (optionsIn.pushValue) { sb.emitHelper(node, options, sb.helpers.unwrapBuffer); sb.emitSysCall(node, this.syscall); this.wrap(sb, node, options); } else { sb.emitOp(node, 'DROP'); } } } //# sourceMappingURL=ValueFor.js.map