UNPKG

@neo-one/smart-contract-compiler

Version:

NEO•ONE TypeScript smart contract compiler.

23 lines (21 loc) 742 B
import { tsUtils } from '@neo-one/ts-utils'; import { BuiltinInstanceMemberCall } from '../BuiltinInstanceMemberCall'; export class BufferToInteger extends BuiltinInstanceMemberCall { canCall(_sb, _func, _node) { return true; } emitCall(sb, func, node, optionsIn, visited) { const options = sb.pushValueOptions(optionsIn); if (!visited) { sb.visit(tsUtils.expression.getExpression(func), options); } if (optionsIn.pushValue) { sb.emitHelper(node, options, sb.helpers.unwrapBuffer); sb.emitHelper(node, options, sb.helpers.wrapNumber); } else { sb.emitOp(node, 'DROP'); } } } //# sourceMappingURL=toInteger.js.map