Browse Source

Upgrade to Esprima 3.0.0-beta-3 (#1235)

Marko Lahma 3 years ago
parent
commit
ceec412f3f

+ 2 - 2
Jint/HoistingScope.cs

@@ -287,7 +287,7 @@ namespace Jint
                         && childNode.Type != Nodes.ArrowFunctionExpression
                         && childNode.Type != Nodes.ArrowFunctionExpression
                         && childNode.Type != Nodes.ArrowParameterPlaceHolder
                         && childNode.Type != Nodes.ArrowParameterPlaceHolder
                         && childNode.Type != Nodes.FunctionExpression
                         && childNode.Type != Nodes.FunctionExpression
-                        && childNode.ChildNodes.Count > 0)
+                        && !childNode.ChildNodes.IsEmpty())
                     {
                     {
                         Visit(childNode, node);
                         Visit(childNode, node);
                     }
                     }
@@ -327,7 +327,7 @@ namespace Jint
                         export.GetExportEntries(_exportEntries, _requestedModules);
                         export.GetExportEntries(_exportEntries, _requestedModules);
                     }
                     }
 
 
-                    if (childNode.ChildNodes.Count > 0)
+                    if (!childNode.ChildNodes.IsEmpty())
                     {
                     {
                         Visit(childNode);
                         Visit(childNode);
                     }
                     }

+ 1 - 1
Jint/Jint.csproj

@@ -10,7 +10,7 @@
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>
-    <PackageReference Include="Esprima" Version="3.0.0-beta-2" />
+    <PackageReference Include="Esprima" Version="3.0.0-beta-3" />
     <PackageReference Include="IsExternalInit" Version="1.0.2" PrivateAssets="all" />
     <PackageReference Include="IsExternalInit" Version="1.0.2" PrivateAssets="all" />
     <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
     <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
     <PackageReference Include="Nullable" Version="1.3.0" PrivateAssets="all" />
     <PackageReference Include="Nullable" Version="1.3.0" PrivateAssets="all" />

+ 2 - 2
Jint/Runtime/Interpreter/Expressions/JintAssignmentExpression.cs

@@ -73,7 +73,7 @@ namespace Jint.Runtime.Interpreter.Expressions
                     case AssignmentOperator.BitwiseOrAssign:
                     case AssignmentOperator.BitwiseOrAssign:
                         operatorClrName = "op_BitwiseOr";
                         operatorClrName = "op_BitwiseOr";
                         break;
                         break;
-                    case AssignmentOperator.BitwiseXOrAssign:
+                    case AssignmentOperator.BitwiseXorAssign:
                         operatorClrName = "op_ExclusiveOr";
                         operatorClrName = "op_ExclusiveOr";
                         break;
                         break;
                     case AssignmentOperator.LeftShiftAssign:
                     case AssignmentOperator.LeftShiftAssign:
@@ -222,7 +222,7 @@ namespace Jint.Runtime.Interpreter.Expressions
                         break;
                         break;
                     }
                     }
 
 
-                    case AssignmentOperator.BitwiseXOrAssign:
+                    case AssignmentOperator.BitwiseXorAssign:
                     {
                     {
                         var rval = _right.GetValue(context).Value;
                         var rval = _right.GetValue(context).Value;
                         lval = TypeConverter.ToInt32(lval) ^ TypeConverter.ToInt32(rval);
                         lval = TypeConverter.ToInt32(lval) ^ TypeConverter.ToInt32(rval);

+ 4 - 4
Jint/Runtime/Interpreter/Expressions/JintBinaryExpression.cs

@@ -118,7 +118,7 @@ namespace Jint.Runtime.Interpreter.Expressions
                     break;
                     break;
                 case BinaryOperator.BitwiseAnd:
                 case BinaryOperator.BitwiseAnd:
                 case BinaryOperator.BitwiseOr:
                 case BinaryOperator.BitwiseOr:
-                case BinaryOperator.BitwiseXOr:
+                case BinaryOperator.BitwiseXor:
                 case BinaryOperator.LeftShift:
                 case BinaryOperator.LeftShift:
                 case BinaryOperator.RightShift:
                 case BinaryOperator.RightShift:
                 case BinaryOperator.UnsignedRightShift:
                 case BinaryOperator.UnsignedRightShift:
@@ -715,7 +715,7 @@ namespace Jint.Runtime.Interpreter.Expressions
                     {
                     {
                         BinaryOperator.BitwiseAnd => "op_BitwiseAnd",
                         BinaryOperator.BitwiseAnd => "op_BitwiseAnd",
                         BinaryOperator.BitwiseOr => "op_BitwiseOr",
                         BinaryOperator.BitwiseOr => "op_BitwiseOr",
-                        BinaryOperator.BitwiseXOr => "op_ExclusiveOr",
+                        BinaryOperator.BitwiseXor => "op_ExclusiveOr",
                         BinaryOperator.LeftShift => "op_LeftShift",
                         BinaryOperator.LeftShift => "op_LeftShift",
                         BinaryOperator.RightShift => "op_RightShift",
                         BinaryOperator.RightShift => "op_RightShift",
                         BinaryOperator.UnsignedRightShift => "op_UnsignedRightShift",
                         BinaryOperator.UnsignedRightShift => "op_UnsignedRightShift",
@@ -764,7 +764,7 @@ namespace Jint.Runtime.Interpreter.Expressions
                         case BinaryOperator.BitwiseOr:
                         case BinaryOperator.BitwiseOr:
                             result = JsNumber.Create(leftValue | rightValue);
                             result = JsNumber.Create(leftValue | rightValue);
                             break;
                             break;
-                        case BinaryOperator.BitwiseXOr:
+                        case BinaryOperator.BitwiseXor:
                             result = JsNumber.Create(leftValue ^ rightValue);
                             result = JsNumber.Create(leftValue ^ rightValue);
                             break;
                             break;
                         case BinaryOperator.LeftShift:
                         case BinaryOperator.LeftShift:
@@ -810,7 +810,7 @@ namespace Jint.Runtime.Interpreter.Expressions
                         return JsBigInt.Create(TypeConverter.ToBigInt(left) | TypeConverter.ToBigInt(right));
                         return JsBigInt.Create(TypeConverter.ToBigInt(left) | TypeConverter.ToBigInt(right));
                     }
                     }
 
 
-                    case BinaryOperator.BitwiseXOr:
+                    case BinaryOperator.BitwiseXor:
                     {
                     {
                         if (!left.IsBigInt())
                         if (!left.IsBigInt())
                         {
                         {