private void ProcessTypeofBuiltin(MethodInvocationExpression node) { if (node.get_Arguments().get_Count() != 1) { this.Error(node, new CompilerError("UCE0001", node.get_Target().get_LexicalInfo(), "'typeof' takes a single argument.", null)); } else { IType type = node.get_Arguments().get_Item(0).get_Entity() as IType; if (type != null) { node.get_ParentNode().Replace(node, this.get_CodeBuilder().CreateTypeofExpression(type)); } else { node.set_Target(this.get_CodeBuilder().CreateReference(this._UnityRuntimeServices_GetTypeOf)); this.BindExpressionType(node, this.get_TypeSystemServices().TypeType); } } }
public void ReplaceEvalByEvaluatorEval(MethodInvocationExpression node) { node.get_ParentNode().Replace(node, this.CreateEvaluatorInvocation(node)); }
protected override void ProcessMethodInvocation(MethodInvocationExpression node, IMethod method) { base.ProcessMethodInvocation(node, method); if (UtilitiesModule.IsPossibleStartCoroutineInvocationForm(node)) { UnityScript.TypeSystem.UnityScriptTypeSystem unityScriptTypeSystem = this.UnityScriptTypeSystem; if (unityScriptTypeSystem.IsScriptType(method.get_DeclaringType()) && unityScriptTypeSystem.IsGenerator(method)) { if (this.get_CurrentMethod().get_IsStatic()) { this.get_Warnings().Add(UnityScriptWarnings.CannotStartCoroutineFromStaticFunction(node.get_LexicalInfo(), method.get_Name())); } else { node.get_ParentNode().Replace(node, this.get_CodeBuilder().CreateMethodInvocation(this.get_CodeBuilder().CreateSelfReference(node.get_LexicalInfo(), this.get_CurrentType()), this._StartCoroutine, node)); } } } }