Bump the all-dependencies group with 6 updates#2460
Merged
Conversation
Mirrors the dependabot PR sebastienros#2452: - GitHubActionsTestLogger 3.0.3 → 3.0.4 - Meziantou.Analyzer 3.0.55 → 3.0.62 - Microsoft.NET.Test.Sdk 18.4.0 → 18.5.1 - NiL.JS 2.6.1721 → 2.6.1722 - NUnit 4.5.1 → 4.6.0 - YantraJS.Core 1.2.334 → 1.2.342 Meziantou.Analyzer 3.0.59 introduced MA0195 (static field may not be initialized yet), which fired on the source-generated descriptor fields that forward-reference user-defined static [JsProperty] fields in the same partial class. The compiler orders partial files lexically (user .cs before generator .g.cs), so the user fields are always initialized before the descriptor fields — suppress the warning at the top of every generated file. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
lahma
enabled auto-merge (squash)
May 9, 2026 10:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mirrors dependabot PR #2452 with the analyzer fix needed to compile cleanly.
Package bumps
Why dependabot's PR #2452 fails to build
Meziantou.Analyzer 3.0.59 introduced rule MA0195 — "Static field may not be initialized yet". It fires on every source-generated
__<Type>_Property_<Name>descriptor field that forward-references a user-defined static[JsProperty]field in the same partial class (e.g.MathInstance.EValue,GlobalObject.NaNValue,SymbolConstructor._asyncDispose, etc.) — about 60+ errors acrossMathInstance,GlobalObject,NumberConstructor,SymbolConstructor,Uint8ArrayConstructor,Uint8ArrayPrototype.In practice the field references are safe: the C# compiler orders partial files lexically, and source-generator output (
.g.cs) sorts after the user's hand-written.cs, so the referenced fields are always initialized first. The analyzer's pessimism is purely structural here.Fix
Emit
#pragma warning disable MA0195at the top of every source-generated file fromJint.SourceGenerators.Emitter. Scoped to generated output only, so MA0195 still catches genuine forward-reference bugs in hand-written code. The 17 verified snapshot tests underJint.Tests.SourceGenerators/are updated to match.Verified locally
dotnet build --configuration Release: 0 warnings, 0 errors across all TFMs (net462, netstandard2.0/2.1, net8.0, net10.0)dotnet test Jint.Tests: 2919 + 2872 passed, 0 faileddotnet test Jint.Tests.SourceGenerators: 30 passed, 0 faileddotnet test Jint.Tests.PublicInterface: 79 + 79 passed, 0 faileddotnet test Jint.Tests.CommonScripts: 28 + 28 passed, 0 failed🤖 Generated with Claude Code