@neo-one/smart-contract-compiler
Version:
NEO•ONE TypeScript smart contract compiler.
24 lines (22 loc) • 817 B
JavaScript
import { tsUtils } from '@neo-one/ts-utils';
import { Types } from '../../constants';
import { BuiltinInstanceMemberCall } from '../BuiltinInstanceMemberCall';
export class ArrayToString 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);
}
sb.emitHelper(node, options, sb.helpers.toString({ type: undefined, knownType: Types.Array }));
if (optionsIn.pushValue) {
sb.emitHelper(node, options, sb.helpers.wrapString);
}
else {
sb.emitOp(node, 'DROP');
}
}
}
//# sourceMappingURL=toString.js.map