@neo-one/smart-contract-compiler
Version:
NEO•ONE TypeScript smart contract compiler.
24 lines (22 loc) • 764 B
JavaScript
import * as constants from '../../../constants';
import { Helper } from '../Helper';
export class BreakHelper extends 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);
}
}
}
//# sourceMappingURL=BreakHelper.js.map