UNPKG

@neo-one/smart-contract-compiler

Version:

NEO•ONE TypeScript smart contract compiler.

23 lines (21 loc) 879 B
import { tsUtils } from '@neo-one/ts-utils'; import { BuiltinInstanceMemberCall } from '../BuiltinInstanceMemberCall'; export class MapDelete 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.emitHelper(node, options, sb.helpers.unwrapMap); sb.visit(tsUtils.argumented.getArguments(node)[0], options); sb.emitSysCall(node, 'Neo.Runtime.Serialize'); sb.emitHelper(node, optionsIn, sb.helpers.mapDelete); } } //# sourceMappingURL=delete.js.map