Exemple #1
0
 /// <summary>
 /// Same as <see cref="EvaluateAndDescribeAsync(IRStackFrame, string, string, REvaluationResultProperties, string, CancellationToken)"/>,
 /// but uses <see langword="null"/> for <c>name</c>.
 /// </summary>
 public static Task <IRValueInfo> EvaluateAndDescribeAsync(
     this IRStackFrame frame,
     string expression,
     REvaluationResultProperties properties,
     string repr,
     CancellationToken cancellationToken = default(CancellationToken)
     ) =>
 frame.EvaluateAndDescribeAsync(expression, null, properties, repr, cancellationToken);
Exemple #2
0
 /// <summary>
 /// Produces an object describing this frame's environment. <see cref="REvaluationResultInfoExtensions.DescribeChildrenAsync"/>
 /// method can then be used to retrieve the variables in the frame.
 /// </summary>
 /// <param name="properties">
 /// Which properties of the returned object should be provided. Note that it should include at least the following flags
 /// argument value in order for <see cref="REvaluationResultInfoExtensions.DescribeChildrenAsync"/> to be working.
 /// </param>
 /// <remarks>
 /// <para>
 /// There is no guarantee that the returned evaluation result is <see cref="IRValueInfo"/>. Retrieving the frame environment involves
 /// evaluating <see cref="EnvironmentExpression"/>, and like any evaluation, it can fail. Caller should check for <see cref="IRErrorInfo"/>
 /// and handle it accordingly. However, it is never <see cref="IRPromiseInfo"/> or <see cref="IRActiveBindingInfo"/>.
 /// </para>
 /// <para>
 /// If this method is called on a stale frame (i.e if call stack has changed since the <see cref="RSessionExtensions.TracebackAsync"/>
 /// call that produced this frame), the result is undefined, and can be an error result, or contain unrelated data.
 /// </para>
 /// </remarks>
 public static Task <IRValueInfo> DescribeEnvironmentAsync(
     this IRStackFrame frame,
     REvaluationResultProperties properties,
     CancellationToken cancellationToken = default(CancellationToken)
     )
 {
     properties |= ExpressionProperty | LengthProperty | AttributeCountProperty | FlagsProperty;
     return(frame.EvaluateAndDescribeAsync("base::environment()", properties, null, cancellationToken));
 }