From 5ff5589e79c96eeb14b5174446f5b7f9fb29bf7d Mon Sep 17 00:00:00 2001 From: Marko Lahma Date: Sun, 19 May 2024 09:23:32 +0300 Subject: [PATCH] Cleanup csproj files (#1865) --- Directory.Build.props | 3 +++ Jint.Benchmark/Jint.Benchmark.csproj | 1 + Jint.Tests.CommonScripts/Jint.Tests.CommonScripts.csproj | 3 +-- .../Jint.Tests.PublicInterface.csproj | 7 +------ Jint.Tests.Test262/Jint.Tests.Test262.csproj | 1 - Jint.Tests/Jint.Tests.csproj | 4 ---- Jint.Tests/Parser/JavascriptParserTests.cs | 4 +--- Jint.Tests/Runtime/InteropTests.MemberAccess.cs | 2 ++ Jint.Tests/Runtime/InteropTests.cs | 1 - Jint/AstExtensions.cs | 2 ++ Jint/Jint.csproj | 2 -- Jint/Native/Generator/GeneratorInstance.cs | 2 ++ .../Interpreter/Expressions/JintLiteralExpression.cs | 1 - .../Interpreter/Expressions/JintUpdateExpression.cs | 1 - 14 files changed, 13 insertions(+), 21 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index fc9bbe7652..dfa5898118 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -24,6 +24,9 @@ true true + latest + enable + diff --git a/Jint.Benchmark/Jint.Benchmark.csproj b/Jint.Benchmark/Jint.Benchmark.csproj index 52a1e0d2d9..5a1f33f9fd 100644 --- a/Jint.Benchmark/Jint.Benchmark.csproj +++ b/Jint.Benchmark/Jint.Benchmark.csproj @@ -17,6 +17,7 @@ latest false enable + $(NoWarn);CS8002 diff --git a/Jint.Tests.CommonScripts/Jint.Tests.CommonScripts.csproj b/Jint.Tests.CommonScripts/Jint.Tests.CommonScripts.csproj index 49c60a42b9..323b5a9d9d 100644 --- a/Jint.Tests.CommonScripts/Jint.Tests.CommonScripts.csproj +++ b/Jint.Tests.CommonScripts/Jint.Tests.CommonScripts.csproj @@ -1,8 +1,7 @@ - net8.0 - $(TargetFrameworks);net462 + net462;net8.0 false enable latest diff --git a/Jint.Tests.PublicInterface/Jint.Tests.PublicInterface.csproj b/Jint.Tests.PublicInterface/Jint.Tests.PublicInterface.csproj index 09d37f56f5..805f645b94 100644 --- a/Jint.Tests.PublicInterface/Jint.Tests.PublicInterface.csproj +++ b/Jint.Tests.PublicInterface/Jint.Tests.PublicInterface.csproj @@ -1,8 +1,7 @@ - net8.0 - $(TargetFrameworks);net462 + net462;net8.0 ..\Jint\Jint.snk true false @@ -17,10 +16,6 @@ - - - - diff --git a/Jint.Tests.Test262/Jint.Tests.Test262.csproj b/Jint.Tests.Test262/Jint.Tests.Test262.csproj index 710ce5e932..ba21aaef11 100644 --- a/Jint.Tests.Test262/Jint.Tests.Test262.csproj +++ b/Jint.Tests.Test262/Jint.Tests.Test262.csproj @@ -2,7 +2,6 @@ net8.0 - ..\Jint\Jint.snk true false diff --git a/Jint.Tests/Jint.Tests.csproj b/Jint.Tests/Jint.Tests.csproj index 0fc40fa091..3d0f151e11 100644 --- a/Jint.Tests/Jint.Tests.csproj +++ b/Jint.Tests/Jint.Tests.csproj @@ -19,10 +19,6 @@ - - - - diff --git a/Jint.Tests/Parser/JavascriptParserTests.cs b/Jint.Tests/Parser/JavascriptParserTests.cs index 3ef0590939..0a2659895b 100644 --- a/Jint.Tests/Parser/JavascriptParserTests.cs +++ b/Jint.Tests/Parser/JavascriptParserTests.cs @@ -1,6 +1,4 @@ -using Jint.Runtime; - -namespace Jint.Tests.Parsing; +namespace Jint.Tests.Parsing; public class JavascriptParserTests { diff --git a/Jint.Tests/Runtime/InteropTests.MemberAccess.cs b/Jint.Tests/Runtime/InteropTests.MemberAccess.cs index 2a61695bb0..88e7174ef8 100644 --- a/Jint.Tests/Runtime/InteropTests.MemberAccess.cs +++ b/Jint.Tests/Runtime/InteropTests.MemberAccess.cs @@ -183,7 +183,9 @@ public void CanAccessBaseClassStaticFields() private class BaseClassWithStatics { +#pragma warning disable CS0414 // Field is assigned but its value is never used public static int a = 42; +#pragma warning restore CS0414 // Field is assigned but its value is never used } private class InheritingFromClassWithStatics : BaseClassWithStatics diff --git a/Jint.Tests/Runtime/InteropTests.cs b/Jint.Tests/Runtime/InteropTests.cs index 2c3a062524..2c96ed88d8 100644 --- a/Jint.Tests/Runtime/InteropTests.cs +++ b/Jint.Tests/Runtime/InteropTests.cs @@ -3,7 +3,6 @@ using System.Reflection; using System.Runtime.CompilerServices; using Jint.Native; -using Jint.Native.Symbol; using Jint.Runtime; using Jint.Runtime.Interop; using Jint.Tests.Runtime.Converters; diff --git a/Jint/AstExtensions.cs b/Jint/AstExtensions.cs index 4551fd207b..3cab91dde5 100644 --- a/Jint/AstExtensions.cs +++ b/Jint/AstExtensions.cs @@ -13,7 +13,9 @@ namespace Jint { public static class AstExtensions { +#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value internal static readonly SourceLocation DefaultLocation; +#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value public static JsValue GetKey(this T property, Engine engine) where T : IProperty => GetKey(property.Key, engine, property.Computed); diff --git a/Jint/Jint.csproj b/Jint/Jint.csproj index a0c9568748..460620fc9d 100644 --- a/Jint/Jint.csproj +++ b/Jint/Jint.csproj @@ -7,8 +7,6 @@ true true - latest - enable enable true diff --git a/Jint/Native/Generator/GeneratorInstance.cs b/Jint/Native/Generator/GeneratorInstance.cs index dc6cae2480..8ef6bfbd39 100644 --- a/Jint/Native/Generator/GeneratorInstance.cs +++ b/Jint/Native/Generator/GeneratorInstance.cs @@ -13,7 +13,9 @@ internal sealed class GeneratorInstance : ObjectInstance { internal GeneratorState _generatorState; private ExecutionContext _generatorContext; +#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value private readonly JsValue? _generatorBrand; +#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value private JintStatementList _generatorBody = null!; public JsValue? _nextValue; diff --git a/Jint/Runtime/Interpreter/Expressions/JintLiteralExpression.cs b/Jint/Runtime/Interpreter/Expressions/JintLiteralExpression.cs index f3f28d947d..561a160882 100644 --- a/Jint/Runtime/Interpreter/Expressions/JintLiteralExpression.cs +++ b/Jint/Runtime/Interpreter/Expressions/JintLiteralExpression.cs @@ -1,4 +1,3 @@ -using System.Numerics; using System.Text.RegularExpressions; using Jint.Native; diff --git a/Jint/Runtime/Interpreter/Expressions/JintUpdateExpression.cs b/Jint/Runtime/Interpreter/Expressions/JintUpdateExpression.cs index 3d361b0739..fa2784618b 100644 --- a/Jint/Runtime/Interpreter/Expressions/JintUpdateExpression.cs +++ b/Jint/Runtime/Interpreter/Expressions/JintUpdateExpression.cs @@ -1,6 +1,5 @@ using Jint.Native; using Jint.Runtime.Environments; -using Environment = Jint.Runtime.Environments.Environment; namespace Jint.Runtime.Interpreter.Expressions {