UNPKG

@neo-one/smart-contract-compiler

Version:

NEO•ONE TypeScript smart contract compiler.

22 lines (20 loc) 789 B
import ts from 'typescript'; import { InternalObjectProperty } from '../constants'; import { NodeCompiler } from '../NodeCompiler'; export class ArrowFunctionCompiler extends NodeCompiler { constructor() { super(...arguments); this.kind = ts.SyntaxKind.ArrowFunction; } visitNode(sb, expr, options) { if (options.pushValue) { sb.scope.getThis(sb, expr, options); sb.emitHelper(expr, options, sb.helpers.createCallArray); sb.emitHelper(expr, options, sb.helpers.bindFunctionThis({ overwrite: true })); sb.emitHelper(expr, options, sb.helpers.createFunctionObject({ property: InternalObjectProperty.Call, })); } } } //# sourceMappingURL=ArrowFunctionCompiler.js.map