5
|
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 }
|