UNPKG

@neo-one/smart-contract-compiler

Version:

NEO•ONE TypeScript smart contract compiler.

28 lines (26 loc) 887 B
import { tsUtils } from '@neo-one/ts-utils'; import { Helper } from '../Helper'; export class GetSmartContractPropertyHelper extends Helper { constructor({ property }) { super(); this.property = property; } emit(sb, node, options) { if (!options.pushValue) { return; } const initializer = tsUtils.initializer.getInitializer(this.property); if (initializer === undefined) { return; } const name = tsUtils.node.getName(this.property); sb.emitPushString(node, name); sb.emitHelper(node, options, sb.helpers.wrapString); sb.emitHelper(node, options, sb.helpers.getCachedValue({ create: (innerOptions) => { sb.visit(initializer, innerOptions); }, })); } } //# sourceMappingURL=GetSmartContractPropertyHelper.js.map