@neo-one/smart-contract-compiler
Version:
NEO•ONE TypeScript smart contract compiler.
22 lines (20 loc) • 650 B
JavaScript
import { BuiltinInstanceOf } from '../BuiltinInstanceOf';
export class ValueInstanceOf extends BuiltinInstanceOf {
constructor(type, isHelper) {
super();
this.type = type;
this.isHelper = isHelper;
}
emitInstanceOf(sb, node, optionsIn) {
const options = sb.pushValueOptions(optionsIn);
sb.visit(node, options);
if (optionsIn.pushValue) {
sb.emitHelper(node, options, this.isHelper(sb));
sb.emitHelper(node, options, sb.helpers.wrapBoolean);
}
else {
sb.emitOp(node, 'DROP');
}
}
}
//# sourceMappingURL=ValueInstanceOf.js.map