Skip to content

Commit

Permalink
Merge pull request #1 from lofcz/1793-docs-public.members
Browse files Browse the repository at this point in the history
document public members
  • Loading branch information
scgm0 authored Feb 27, 2024
2 parents 13983b5 + 0d8306a commit a002795
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Jint/Options.Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ public static Options SetWrapObjectHandler(this Options options, Options.WrapObj
}

/// <summary>
///
/// Sets the handler used to build stack traces. This is useful if the code currently
/// running was transpiled (eg. TypeScript) and the source map of original code is available.
/// </summary>
public static Options SetBuildCallStackHandler(this Options options, Options.BuildCallStackDelegate buildCallStackHandler)
{
Expand Down
4 changes: 3 additions & 1 deletion Jint/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,9 @@ public class InteropOptions
public WrapObjectDelegate WrapObjectHandler { get; set; } = static (engine, target, type) => new ObjectWrapper(engine, target, type);

/// <summary>
///
/// The handler used to build stack traces. Changing this enables mapping
/// stack traces to code different from the code being executed, eg. when
/// executing code traspiled from TypeScript.
/// </summary>
public BuildCallStackDelegate BuildCallStackHandler { get; set; } = static (string description, Location location, List<string>? arguments) => null;

Expand Down
4 changes: 2 additions & 2 deletions Jint/Runtime/CallStack/JintCallStack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ static void AppendLocation(
// stack is one frame behind function-wise when we start to process it from expression level
var index = _stack._size - 1 - excludeTop;
var element = index >= 0 ? _stack[index] : (CallStackElement?) null;
var shortDescription = element?.ToString() ?? "";
var shortDescription = element?.ToString() ?? string.Empty;

AppendLocation(ref builder, shortDescription, location, element, engine);

Expand All @@ -186,7 +186,7 @@ static void AppendLocation(
while (index >= -1)
{
element = index >= 0 ? _stack[index] : null;
shortDescription = element?.ToString() ?? "";
shortDescription = element?.ToString() ?? string.Empty;

AppendLocation(ref builder, shortDescription, location, element, engine);

Expand Down

0 comments on commit a002795

Please sign in to comment.