Skip to content

Commit

Permalink
Rename EsprimaExtensions to AstExtensions (#1832)
Browse files Browse the repository at this point in the history
  • Loading branch information
adams85 authored Apr 10, 2024
1 parent e1e2d6d commit 6ec9e60
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Jint/EsprimaExtensions.cs → Jint/AstExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace Jint
{
public static class EsprimaExtensions
public static class AstExtensions
{
public static JsValue GetKey<T>(this T property, Engine engine) where T : IProperty => GetKey(property.Key, engine, property.Computed);

Expand Down
2 changes: 1 addition & 1 deletion Jint/Engine.Modules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ private JsValue EvaluateModule(string specifier, Module module)
? cyclicModuleRecord.AbnormalCompletionLocation
: SourceLocation.From(new Position(), new Position());

var node = EsprimaExtensions.CreateLocationNode(location);
var node = AstExtensions.CreateLocationNode(location);
ExceptionHelper.ThrowJavaScriptException(_engine, promise.Value, node.Location);
}
else if (promise.State != PromiseState.Fulfilled)
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 @@ -188,13 +188,13 @@ static void AppendLocation(
}

/// <summary>
/// A version of <see cref="EsprimaExtensions.GetKey"/> that cannot get into loop as we are already building a stack.
/// A version of <see cref="AstExtensions.GetKey"/> that cannot get into loop as we are already building a stack.
/// </summary>
private static string GetPropertyKey(Node expression)
{
if (expression is Literal literal)
{
return EsprimaExtensions.LiteralKeyToString(literal);
return AstExtensions.LiteralKeyToString(literal);
}

if (expression is Identifier identifier)
Expand Down
2 changes: 1 addition & 1 deletion Jint/Runtime/Interpreter/Expressions/JintExpression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ internal object EvaluateWithoutNodeTracking(EvaluationContext context)
{
if (expression is Literal literal)
{
return EsprimaExtensions.LiteralKeyToString(literal);
return AstExtensions.LiteralKeyToString(literal);
}

if (expression is Identifier identifier)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private void Initialize()
{
if (p.Key is Literal literal)
{
propName = EsprimaExtensions.LiteralKeyToString(literal);
propName = AstExtensions.LiteralKeyToString(literal);
}

if (!p.Computed && p.Key is Identifier identifier)
Expand Down
2 changes: 1 addition & 1 deletion Jint/Runtime/Interpreter/JintStatementList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ private static Completion CreateThrowCompletion(JintStatement? s, JavaScriptExce
SyntaxElement source = s!._statement;
if (v.Location != default)
{
source = EsprimaExtensions.CreateLocationNode(v.Location);
source = AstExtensions.CreateLocationNode(v.Location);
}

return new Completion(CompletionType.Throw, v.Error, source);
Expand Down

0 comments on commit 6ec9e60

Please sign in to comment.