UNPKG

@neo-one/smart-contract-compiler

Version:

NEO•ONE TypeScript smart contract compiler.

27 lines (25 loc) 989 B
import { tsUtils } from '@neo-one/ts-utils'; import { BuiltinInstanceMemberCall } from './BuiltinInstanceMemberCall'; export class BuiltinInstanceMemberMethod extends BuiltinInstanceMemberCall { constructor(method) { super(); this.method = method; } canCall() { return true; } emitCall(sb, _func, node, optionsIn, visited) { const options = sb.pushValueOptions(optionsIn); if (visited) { sb.emitOp(node, 'DROP'); } sb.emitHelper(node, options, sb.helpers.args); sb.withScope(this.method, optionsIn, (innerOptions) => { sb.emitHelper(this.method, sb.pushValueOptions(innerOptions), sb.helpers.parameters({ params: tsUtils.parametered.getParameters(this.method), })); sb.emitHelper(node, innerOptions, sb.helpers.invokeSmartContractMethod({ method: this.method })); }); } } //# sourceMappingURL=BuiltinInstanceMemberMethod.js.map