UNPKG

@neo-one/smart-contract-compiler

Version:

NEO•ONE TypeScript smart contract compiler.

29 lines (27 loc) 967 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BreakHelper = void 0; const tslib_1 = require("tslib"); const constants = tslib_1.__importStar(require("../../../constants")); const Helper_1 = require("../Helper"); class BreakHelper extends Helper_1.Helper { emit(sb, node, options) { let pc = options.breakPC; if (pc === undefined) { sb.context.reportUnsupported(node); } else { if (options.finallyPC !== undefined) { sb.emitPushInt(node, constants.FINALLY_COMPLETION); } sb.emitPushInt(node, constants.BREAK_COMPLETION); if (options.finallyPC !== undefined) { pc = options.finallyPC; sb.emitPushInt(node, constants.FINALLY_COMPLETION); } sb.emitJmp(node, 'JMP', pc); } } } exports.BreakHelper = BreakHelper; //# sourceMappingURL=BreakHelper.js.map