Example #1
0
        /// <summary>
        /// Queues a Coral function to run asynchronously.
        /// </summary>
        public static void CallFunction( State state, string name, object[] args, StackTrace.StackFrame frame )
        {
            // Convert the arguments.
            AstNode[] wrapped = WrapArgs( args );

            // Construct a synthetic AstIdentifier for the name.
            AstIdentifier id = new AstIdentifier( name );

            // Construct a synthetic AstCall.
            AstCall call = new AstCall( id, wrapped, frame );

            call.run( state );
        }
Example #2
0
        /// <summary>
        /// Queues a Coral function to run asynchronously.
        /// </summary>
        public static void CallFunction( State state, FValue func, object[] args, StackTrace.StackFrame frame )
        {
            // Convert the arguments.
            AstNode[] wrapped = WrapArgs( args );

            // Construct a synthetic AstIdentifier for the name.
            AstNode funcNode = new WrapperAstObject( func );

            // Construct a synthetic AstCall.
            AstCall call = new AstCall( funcNode, wrapped, frame );

            call.run( state );
        }
Example #3
0
 /// <summary>
 /// Pass in the state and the step just executed. We'll temporarily push it
 /// back on the stack to get a full trace.
 /// </summary>
 public void setStackTrace( State s )
 {
     this.trace = s.getStackTrace();
     setValue( "trace", new List<object>( this.trace.frames.Select( f => f.ToStringI() ) ) );
 }
Example #4
0
 /// <summary>
 /// Calls a Coral function synchronously and returns its return value.
 /// </summary>
 public object callFunction( string name, object[] args, System.Type returnType, StackTrace.StackFrame frame )
 {
     CallFunction( _state, name, args, frame );
     runSync();
     return Util.CoerceToDotNet( returnType, _state.popResult() );
 }
Example #5
0
 public AstCall( AstNode source, AstNode[] parameters, StackTrace.StackFrame frame )
 {
     this.source = source;
     this.parameters = parameters;
     this.frame = frame;
 }