The Labs \ Source Viewer \ SSCLI \ Microsoft.JScript \ CallContext

  1. // ==++==
  2. //
  3. //
  4. // Copyright (c) 2006 Microsoft Corporation. All rights reserved.
  5. //
  6. // The use and distribution terms for this software are contained in the file
  7. // named license.txt, which can be found in the root of this distribution.
  8. // By using this software in any fashion, you are agreeing to be bound by the
  9. // terms of this license.
  10. //
  11. // You must not remove this notice, or any other, from this software.
  12. //
  13. //
  14. // ==--==
  15. namespace Microsoft.JScript
  16. {
  17.    
  18.     using System;
  19.    
  20. /*
  21.     This class keeps the information around that is necessary to construct a trace of the call stack.
  22.    
  23.     This class is only used by the Evaluator. When running IL it is too expensive and akward to create these things.
  24.     Instead, debugging information is emitted to the IL and used via the CLR debug API. (In the future, that is :-)
  25.     */   
  26.    
  27.     internal class CallContext
  28.     {
  29.         internal readonly Context sourceContext;
  30.         // The source context of the function call or eval expression.
  31.         private readonly LateBinding callee;
  32.         //Null if eval.
  33.         private readonly object[] actual_parameters;
  34.        
  35.        
  36.         internal CallContext(Context sourceContext, LateBinding callee, object[] actual_parameters)
  37.         {
  38.             this.sourceContext = sourceContext;
  39.             this.callee = callee;
  40.             this.actual_parameters = actual_parameters;
  41.         }
  42.        
  43.         internal string FunctionName()
  44.         {
  45.             if (callee == null)
  46.                 return "eval";
  47.             return callee.ToString();
  48.         }
  49.        
  50.     }
  51.    
  52. }

Developer Fusion