Esempio n. 1
0
        public override void Compile(Execution.VM.ByteCode bc)
        {
            int argslen = m_Arguments.Length;

            if (!string.IsNullOrEmpty(m_Name))
            {
                bc.Emit_Copy(0);
                bc.Emit_Literal(DynValue.NewString(m_Name));
                bc.Emit_Index();
                bc.Emit_Swap(0, 1);
                ++argslen;
            }

            for (int i = 0; i < m_Arguments.Length; i++)
            {
                m_Arguments[i].Compile(bc);
            }

            if (!string.IsNullOrEmpty(m_Name))
            {
                bc.Emit_ThisCall(argslen, m_DebugErr);
            }
            else
            {
                bc.Emit_Call(argslen, m_DebugErr);
            }
        }
Esempio n. 2
0
        public override void Compile(Execution.VM.ByteCode bc)
        {
            m_Function.Compile(bc);

            int argslen = m_Arguments.Count;

            if (!string.IsNullOrEmpty(m_Name))
            {
                bc.Emit_Copy(0);
                bc.Emit_Index(m_Name, true);
                bc.Emit_Swap(0, 1);
                ++argslen;
            }


            for (int i = 0; i < m_Arguments.Count; i++)
            {
                m_Arguments[i].CompilePossibleLiteral(bc);
            }

            if (!string.IsNullOrEmpty(m_Name))
            {
                bc.Emit_ThisCall(argslen, m_DebugErr);
            }
            else
            {
                bc.Emit_Call(argslen, m_DebugErr);
            }
        }