Esempio n. 1
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(DynValue.NewString(m_Name), true);
				bc.Emit_Swap(0, 1);
				++argslen;
			}

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

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