ToArray() public method

public ToArray ( ) : object[]
return object[]
Esempio n. 1
0
		private void OptimizeFunction(OptFunctionNode theFunction)
		{
			if (theFunction.fnode.RequiresActivation())
			{
				return;
			}
			inDirectCallFunction = theFunction.IsTargetOfDirectCall();
			this.theFunction = theFunction;
			ObjArray statementsArray = new ObjArray();
			BuildStatementList_r(theFunction.fnode, statementsArray);
			Node[] theStatementNodes = new Node[statementsArray.Size()];
			statementsArray.ToArray(theStatementNodes);
			Block.RunFlowAnalyzes(theFunction, theStatementNodes);
			if (!theFunction.fnode.RequiresActivation())
			{
				parameterUsedInNumberContext = false;
				foreach (Node theStatementNode in theStatementNodes)
				{
					RewriteForNumberVariables(theStatementNode, NumberType);
				}
				theFunction.SetParameterNumberContext(parameterUsedInNumberContext);
			}
		}
Esempio n. 2
0
		/// <summary>Returns an array of all functions in the given script.</summary>
		/// <remarks>Returns an array of all functions in the given script.</remarks>
		private static DebuggableScript[] GetAllFunctions(DebuggableScript function)
		{
			ObjArray functions = new ObjArray();
			CollectFunctions_r(function, functions);
			DebuggableScript[] result = new DebuggableScript[functions.Size()];
			functions.ToArray(result);
			return result;
		}
Esempio n. 3
0
		private void InitScriptNodesData(ScriptNode scriptOrFn)
		{
			ObjArray x = new ObjArray();
			CollectScriptNodes_r(scriptOrFn, x);
			int count = x.Size();
			scriptOrFnNodes = new ScriptNode[count];
			x.ToArray(scriptOrFnNodes);
			scriptOrFnIndexes = new ObjToIntMap(count);
			for (int i = 0; i != count; ++i)
			{
				scriptOrFnIndexes.Put(scriptOrFnNodes[i], i);
			}
		}