From 6ec9e6054510497d5974abaf02b8155ad63e2062 Mon Sep 17 00:00:00 2001 From: adams85 <31276480+adams85@users.noreply.github.com> Date: Wed, 10 Apr 2024 17:04:55 +0200 Subject: [PATCH] Rename EsprimaExtensions to AstExtensions (#1832) --- Jint/{EsprimaExtensions.cs => AstExtensions.cs} | 2 +- Jint/Engine.Modules.cs | 2 +- Jint/Runtime/CallStack/JintCallStack.cs | 4 ++-- Jint/Runtime/Interpreter/Expressions/JintExpression.cs | 2 +- Jint/Runtime/Interpreter/Expressions/JintObjectExpression.cs | 2 +- Jint/Runtime/Interpreter/JintStatementList.cs | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) rename Jint/{EsprimaExtensions.cs => AstExtensions.cs} (99%) diff --git a/Jint/EsprimaExtensions.cs b/Jint/AstExtensions.cs similarity index 99% rename from Jint/EsprimaExtensions.cs rename to Jint/AstExtensions.cs index 754f221785..6fd3a5894a 100644 --- a/Jint/EsprimaExtensions.cs +++ b/Jint/AstExtensions.cs @@ -11,7 +11,7 @@ namespace Jint { - public static class EsprimaExtensions + public static class AstExtensions { public static JsValue GetKey(this T property, Engine engine) where T : IProperty => GetKey(property.Key, engine, property.Computed); diff --git a/Jint/Engine.Modules.cs b/Jint/Engine.Modules.cs index 65ad8f8c1a..f609410c7f 100644 --- a/Jint/Engine.Modules.cs +++ b/Jint/Engine.Modules.cs @@ -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) diff --git a/Jint/Runtime/CallStack/JintCallStack.cs b/Jint/Runtime/CallStack/JintCallStack.cs index 319a52f44c..a915016457 100644 --- a/Jint/Runtime/CallStack/JintCallStack.cs +++ b/Jint/Runtime/CallStack/JintCallStack.cs @@ -188,13 +188,13 @@ static void AppendLocation( } /// - /// A version of that cannot get into loop as we are already building a stack. + /// A version of that cannot get into loop as we are already building a stack. /// private static string GetPropertyKey(Node expression) { if (expression is Literal literal) { - return EsprimaExtensions.LiteralKeyToString(literal); + return AstExtensions.LiteralKeyToString(literal); } if (expression is Identifier identifier) diff --git a/Jint/Runtime/Interpreter/Expressions/JintExpression.cs b/Jint/Runtime/Interpreter/Expressions/JintExpression.cs index 8798cc8c65..c3f051ded1 100644 --- a/Jint/Runtime/Interpreter/Expressions/JintExpression.cs +++ b/Jint/Runtime/Interpreter/Expressions/JintExpression.cs @@ -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) diff --git a/Jint/Runtime/Interpreter/Expressions/JintObjectExpression.cs b/Jint/Runtime/Interpreter/Expressions/JintObjectExpression.cs index 5e8be35403..60670ad7a8 100644 --- a/Jint/Runtime/Interpreter/Expressions/JintObjectExpression.cs +++ b/Jint/Runtime/Interpreter/Expressions/JintObjectExpression.cs @@ -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) diff --git a/Jint/Runtime/Interpreter/JintStatementList.cs b/Jint/Runtime/Interpreter/JintStatementList.cs index 1dc3b1940a..c45e2b7da0 100644 --- a/Jint/Runtime/Interpreter/JintStatementList.cs +++ b/Jint/Runtime/Interpreter/JintStatementList.cs @@ -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);