comparison Jint.Runtime/VM/OpCodes/ConditionOp.cs @ 5:cb13da6e3349

simple loop test
author cin
date Mon, 28 Oct 2013 00:49:15 +0400
parents
children
comparison
equal deleted inserted replaced
4:1ae5b10f7a10 5:cb13da6e3349
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using System.Text;
5
6 namespace Jint.Runtime.VM.OpCodes {
7 class ConditionOp: IInstruction {
8 int m_test;
9 IInstruction m_success;
10 IInstruction m_fail;
11
12 public ConditionOp(int test, IInstruction success, IInstruction fail) {
13 m_test = test;
14 m_success = success;
15 m_fail = fail;
16 }
17
18 public IInstruction Invoke(Frame frame) {
19 return frame.GetConverted<bool>(m_test) ? m_success : m_fail;
20 }
21 }
22 }