UNPKG

@neo-one/smart-contract-compiler

Version:

NEO•ONE TypeScript smart contract compiler.

23 lines (21 loc) 847 B
import { InternalObjectProperty } from '../../constants'; import { Helper } from '../Helper'; export class InvokeConstructHelper extends Helper { constructor(options = { noArgs: false }) { super(); this.noArgs = options.noArgs || false; } emit(sb, node, optionsIn) { const options = sb.pushValueOptions(optionsIn); sb.emitPushInt(node, InternalObjectProperty.Construct); sb.emitHelper(node, options, sb.helpers.getInternalObjectProperty); sb.emitHelper(node, options, sb.helpers.bindFunctionThis({ overwrite: true })); if (this.noArgs) { sb.emitPushInt(node, 0); sb.emitOp(node, 'NEWARRAY'); sb.emitOp(node, 'SWAP'); } sb.emitHelper(node, optionsIn, sb.helpers.call); } } //# sourceMappingURL=InvokeConstructHelper.js.map