< Summary

Information
Class: Elsa.Expressions.JavaScript.Notifications.EvaluatingJavaScript
Assembly: Elsa.Expressions.JavaScript
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.JavaScript/Notifications/EvaluatingJavaScript.cs
Line coverage
100%
Covered lines: 1
Uncovered lines: 0
Coverable lines: 1
Total lines: 31
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Engine()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Expressions.JavaScript/Notifications/EvaluatingJavaScript.cs

#LineLine coverage
 1using Elsa.Expressions.Models;
 2using Elsa.Mediator.Contracts;
 3using Jint;
 4
 5namespace Elsa.Expressions.JavaScript.Notifications;
 6
 7/// <summary>
 8/// This notification is published every time a JavaScript expression is about to be evaluated.
 9/// It gives subscribers a chance to configure the <see cref="Engine"/> with additional functions and variables.
 10/// </summary>
 11/// <param name="Engine">The engine the expression will be evaluated on.</param>
 12/// <param name="Context">The context the expression is evaluated in.</param>
 13/// <param name="Expression">The expression that is about to be evaluated.</param>
 14/// <param name="ReferencedGlobals">
 15/// The identifiers the expression references without declaring them, as reported by the parser. A handler that
 16/// would otherwise install a global speculatively can register only the names in this set: an identifier the
 17/// expression never mentions cannot be read from it.
 18/// <para>
 19/// Four cases are not answerable from the set and must be treated as "register everything":
 20/// <see cref="Jint.ReferencedGlobals.HasDirectEvalCall"/>, because evaluated code can reference anything; the
 21/// identifiers <c>eval</c> and <c>Function</c> appearing in the set, which is how indirect <c>eval</c> and the
 22/// <c>Function</c> constructor are signalled (neither is reported as a direct <c>eval</c> call); and
 23/// <c>globalThis</c>, because a global can be reached through it without its name appearing as an identifier.
 24/// </para>
 25/// <para>
 26/// Also note that only free identifiers are reported, so the member names in <c>variables.Foo</c> are not: the
 27/// set says whether <c>variables</c> is referenced, not which of its properties.
 28/// </para>
 29/// <see langword="null"/> when the expression was prepared without collecting them.
 30/// </param>
 261331public record EvaluatingJavaScript(Engine Engine, ExpressionExecutionContext Context, string Expression, ReferencedGloba

Methods/Properties

get_Engine()