Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: SimonCropp/Polyfill
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 10.11.1
Choose a base ref
...
head repository: SimonCropp/Polyfill
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 10.11.2
Choose a head ref
  • 3 commits
  • 450 files changed
  • 1 contributor

Commits on Jun 29, 2026

  1. Configuration menu
    Copy the full SHA
    7ea1e86 View commit details
    Browse the repository at this point in the history

Commits on Jun 30, 2026

  1. Fix issues where code diverged from bcl behavior (#566)

    * Fix issues where code diverged from BCL behavior
    
    Each polyfill below produced an observably different result from the
    real .NET API it emulates; fixed to match the BCL, with a regression
    test per bug that runs on both the polyfill (older TFMs) and the BCL
    (newer TFMs).
    
    Encoding / strings:
    - Encoding.GetChars(ROS<byte>, Span<char>): copy only the decoded char
      count instead of the whole scratch buffer (threw/clobbered on non-ASCII)
    - string.ReplaceLineEndings: handle empty input, preserve a trailing
      line ending, and recognise the full BCL set (FF/NEL/LS/PS)
    - string.Join(char, ROS<string?>): treat null elements as empty (unsafe path)
    - StringBuilder.Append(sb,int,int)/CopyTo: validate arguments
    
    Date / time:
    - DateTime/DateTimeOffset.AddMicroseconds: preserve sub-millisecond
      precision via AddTicks (AddMilliseconds rounds on .NET Framework)
    - DateTime/DateTimeOffset/TimeSpan Microsecond & Nanosecond: correct the
      TicksPerMicrosecond constant (10, not 10,000,000) and the formula
    - TimeSpan.FromDays/Hours/Minutes/Seconds/Milliseconds/Microseconds:
      throw ArgumentOutOfRangeException on overflow, accumulating in
      microseconds (decimal) so cancelling components stay in range
    
    Collections / spans:
    - Span.Sort(keys, values, Comparison): pass null keys to the comparison
    - ConcurrentDictionary.GetOrAdd: validate valueFactory
    - List.CopyTo(Span)/InsertRange: validate destination length / index
    - EqualityComparer.Create: validate the delegate
    
    Numbers / Convert:
    - double/float.TryParse(.., provider, ..): include NumberStyles.AllowThousands
      (the BCL default) in the default-style overloads
    - Convert.FromHexString (both OperationStatus overloads): correct
      charsConsumed on invalid data and give DestinationTooSmall priority
    - ArgumentOutOfRangeException.ThrowIfZero: set ActualValue and message;
      fix two nint relational message strings
    
    Reflection:
    - Type.GetMethod(name, genericParameterCount, ..): argument validation
    - MemberInfo.HasSameMetadataDefinitionAs(null): throw ArgumentNullException
    
    IO / XML / compression / crypto / async:
    - File.GetUnixFileMode/SetUnixFileMode: correct setuid(4)/setgid(2) mapping
    - XDocument/XElement.LoadAsync(Stream): honor the XML-declared encoding
      instead of forcing UTF-8
    - ZipFile.ExtractToDirectoryAsync(overwriteFiles:true): overwrite per file
      instead of deleting the whole destination directory
    - RandomNumberGenerator.GetInt32: off-by-one rejection that never returned
      the maximum value
    - TaskCompletionSource.TrySetCanceled(token): forward the token
    - ZLibStream: document that the Adler-32 trailer is not validated
    
    * .
    SimonCropp authored Jun 30, 2026
    Configuration menu
    Copy the full SHA
    e20851a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5067ef6 View commit details
    Browse the repository at this point in the history
Loading