view Jint.Runtime/VM/OpCodes/ConditionOp.cs @ 8:5b2302d3ac4f default tip

Слияние
author cin
date Wed, 30 Oct 2013 20:44:42 +0400
parents cb13da6e3349
children
line wrap: on
line source

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Jint.Runtime.VM.OpCodes {
    class ConditionOp: IInstruction {
        int m_test;
        IInstruction m_success;
        IInstruction m_fail;

        public ConditionOp(int test, IInstruction success, IInstruction fail) {
            m_test = test;
            m_success = success;
            m_fail = fail;
        }

        public IInstruction Invoke(Frame frame) {
            return frame.GetConverted<bool>(m_test) ? m_success : m_fail;
        }
    }
}