Browse Source

Rename EsprimaExtensions to AstExtensions (#1832)

adams85 1 year ago
parent
commit
6ec9e60545

+ 1 - 1
Jint/EsprimaExtensions.cs → Jint/AstExtensions.cs

@@ -11,7 +11,7 @@ using Environment = Jint.Runtime.Environments.Environment;
 
 
 namespace Jint
 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);
         public static JsValue GetKey<T>(this T property, Engine engine) where T : IProperty => GetKey(property.Key, engine, property.Computed);
 
 

+ 1 - 1
Jint/Engine.Modules.cs

@@ -174,7 +174,7 @@ public partial class Engine
                     ? cyclicModuleRecord.AbnormalCompletionLocation
                     ? cyclicModuleRecord.AbnormalCompletionLocation
                     : SourceLocation.From(new Position(), new Position());
                     : SourceLocation.From(new Position(), new Position());
 
 
-                var node = EsprimaExtensions.CreateLocationNode(location);
+                var node = AstExtensions.CreateLocationNode(location);
                 ExceptionHelper.ThrowJavaScriptException(_engine, promise.Value, node.Location);
                 ExceptionHelper.ThrowJavaScriptException(_engine, promise.Value, node.Location);
             }
             }
             else if (promise.State != PromiseState.Fulfilled)
             else if (promise.State != PromiseState.Fulfilled)

+ 2 - 2
Jint/Runtime/CallStack/JintCallStack.cs

@@ -188,13 +188,13 @@ namespace Jint.Runtime.CallStack
         }
         }
 
 
         /// <summary>
         /// <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>
         /// </summary>
         private static string GetPropertyKey(Node expression)
         private static string GetPropertyKey(Node expression)
         {
         {
             if (expression is Literal literal)
             if (expression is Literal literal)
             {
             {
-                return EsprimaExtensions.LiteralKeyToString(literal);
+                return AstExtensions.LiteralKeyToString(literal);
             }
             }
 
 
             if (expression is Identifier identifier)
             if (expression is Identifier identifier)

+ 1 - 1
Jint/Runtime/Interpreter/Expressions/JintExpression.cs

@@ -64,7 +64,7 @@ namespace Jint.Runtime.Interpreter.Expressions
             {
             {
                 if (expression is Literal literal)
                 if (expression is Literal literal)
                 {
                 {
-                    return EsprimaExtensions.LiteralKeyToString(literal);
+                    return AstExtensions.LiteralKeyToString(literal);
                 }
                 }
 
 
                 if (expression is Identifier identifier)
                 if (expression is Identifier identifier)

+ 1 - 1
Jint/Runtime/Interpreter/Expressions/JintObjectExpression.cs

@@ -80,7 +80,7 @@ namespace Jint.Runtime.Interpreter.Expressions
                 {
                 {
                     if (p.Key is Literal literal)
                     if (p.Key is Literal literal)
                     {
                     {
-                        propName = EsprimaExtensions.LiteralKeyToString(literal);
+                        propName = AstExtensions.LiteralKeyToString(literal);
                     }
                     }
 
 
                     if (!p.Computed && p.Key is Identifier identifier)
                     if (!p.Computed && p.Key is Identifier identifier)

+ 1 - 1
Jint/Runtime/Interpreter/JintStatementList.cs

@@ -172,7 +172,7 @@ namespace Jint.Runtime.Interpreter
             SyntaxElement source = s!._statement;
             SyntaxElement source = s!._statement;
             if (v.Location != default)
             if (v.Location != default)
             {
             {
-                source = EsprimaExtensions.CreateLocationNode(v.Location);
+                source = AstExtensions.CreateLocationNode(v.Location);
             }
             }
 
 
             return new Completion(CompletionType.Throw, v.Error, source);
             return new Completion(CompletionType.Throw, v.Error, source);