Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement WriteStringValueSegment defined in Issue 67337 #101356

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9122ef8
Implement WriteStringValueSegment defined in Issue 67337
ificator Apr 21, 2024
e044b13
Fix some review comments
ificator May 26, 2024
e7abe7f
merge upstream/main
ificator May 26, 2024
b8d578c
Handle split surrogate pair
ificator May 26, 2024
181cef2
Merge remote-tracking branch 'upstream/main' into user/ificator/write…
ificator Dec 6, 2024
65006ce
Commit old changes responding to comments
ificator Dec 6, 2024
1601af8
utf8 and utf16
PranavSenthilnathan Dec 11, 2024
d6b66be
fix build error
PranavSenthilnathan Dec 16, 2024
a46a1cc
Update src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf…
PranavSenthilnathan Dec 16, 2024
b5d0c17
Update src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf…
PranavSenthilnathan Dec 16, 2024
4a0d1c6
PR comments
PranavSenthilnathan Dec 16, 2024
09d321d
Merge branch 'main' of https://github.com/dotnet/runtime into user/if…
PranavSenthilnathan Dec 16, 2024
96ed922
add encoding flags
PranavSenthilnathan Dec 17, 2024
a078bfd
add test for switching encoding
PranavSenthilnathan Dec 17, 2024
93e6ee9
use CoreLib Rune for polyfill instead of having a separate copy
PranavSenthilnathan Dec 17, 2024
501813f
Merge branch 'main' of https://github.com/dotnet/runtime into user/if…
PranavSenthilnathan Dec 17, 2024
c3b1c3b
move warning disabling to top and fix up tests
PranavSenthilnathan Dec 18, 2024
c9c4884
add fuzzer
PranavSenthilnathan Dec 19, 2024
8482b1c
Fix some tests I missed
PranavSenthilnathan Dec 19, 2024
d50bbca
clean up and add another test to fuzzer
PranavSenthilnathan Dec 19, 2024
55827d9
comment typo
PranavSenthilnathan Dec 20, 2024
a5cd855
pr comments
PranavSenthilnathan Dec 20, 2024
c82b035
Merge branch 'main' of https://github.com/dotnet/runtime into user/if…
PranavSenthilnathan Dec 20, 2024
4f63907
Merge branch 'user/ificator/writestringvaluesegment' of https://githu…
PranavSenthilnathan Dec 20, 2024
b7fd4a5
throw when encodings are mixed
PranavSenthilnathan Dec 24, 2024
c0a700c
update fuzzer to assert that mixing encodings always throws
PranavSenthilnathan Dec 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ internal static void ThrowArgumentOutOfRangeException(ExceptionArgument argument
throw new ArgumentOutOfRangeException(GetArgumentName(argument));
}

private static ArgumentException GetArgumentException(ExceptionResource resource)
{
return new ArgumentException(GetResourceString(resource));
}

private static ArgumentOutOfRangeException GetArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
{
return new ArgumentOutOfRangeException(GetArgumentName(argument), GetResourceString(resource));
Expand Down
17 changes: 17 additions & 0 deletions src/libraries/System.Text.Encodings.Web/tests/SR.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace System
{
internal static partial class SR
eiriktsarpalis marked this conversation as resolved.
Show resolved Hide resolved
{
/// <summary>Index was out of range. Must be non-negative and less than the size of the collection.</summary>
internal static string @ArgumentOutOfRange_IndexMustBeLess => @"Index was out of range. Must be non-negative and less than the size of the collection.";
/// <summary>Cannot extract a Unicode scalar value from the specified index in the input.</summary>
internal static string @Argument_CannotExtractScalar => @"Cannot extract a Unicode scalar value from the specified index in the input.";
/// <summary>Destination is too short.</summary>
internal static string @Argument_DestinationTooShort => @"Destination is too short.";
/// <summary>Object must be of type Rune.</summary>
internal static string @Arg_MustBeRune => @"Object must be of type Rune.";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetFrameworkMinimum)</TargetFrameworks>
<UnicodeUcdVersion>15.0</UnicodeUcdVersion>
<!-- CS3021: 'type' does not need a CLSCompliant attribute because the assembly does not have a CLSCompliant attribute -->
<NoWarn Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">$(NoWarn);CS3021</NoWarn>
</PropertyGroup>
<ItemGroup>
<CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
Expand All @@ -19,6 +21,7 @@
<Compile Include="AsciiByteMapTests.cs" />
<Compile Include="AsciiPreescapedDataTests.cs" />
<Compile Include="AllowedAsciiCodePointsTests.cs" />
<Compile Include="SR.cs" />
<Compile Include="InboxEncoderCommonTests.cs" />
<Compile Include="AllowedBmpCodePointsBitmapTests.cs" />
<Compile Include="TextEncoderBatteryTests.cs" />
Expand All @@ -39,9 +42,10 @@
<Compile Include="UnicodeTestHelpers.cs" />
<Compile Include="UrlEncoderTests.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<Compile Include="..\src\Polyfills\System.Text.Rune.netstandard20.cs" Link="Polyfills\System.Text.Rune.netstandard20.cs" />
<Compile Include="..\src\System\Text\Encodings\Web\ThrowHelper.cs" Link="System\Text\Encodings\Web\ThrowHelper.cs" />
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
<Compile Include="$(CoreLibSharedDir)System\Text\Rune.cs" Link="System\Text\Rune.cs" />
<Compile Include="$(CoreLibSharedDir)System\Text\Unicode\Utf16Utility.cs" Link="System\Text\Unicode\Utf16Utility.cs" />
<Compile Include="..\src\System\ThrowHelper.cs" Link="System\ThrowHelper.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Private.Runtime.UnicodeData" Version="$(SystemPrivateRuntimeUnicodeDataVersion)" ExcludeAssets="contentFiles" GeneratePathProperty="true" />
Expand Down
5 changes: 0 additions & 5 deletions src/libraries/System.Text.Json/src/System/ThrowHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ internal static void ThrowArgumentOutOfRangeException(ExceptionArgument argument
throw new ArgumentOutOfRangeException(GetArgumentName(argument));
}

private static ArgumentException GetArgumentException(ExceptionResource resource)
{
return new ArgumentException(GetResourceString(resource));
}

private static ArgumentOutOfRangeException GetArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
{
return new ArgumentOutOfRangeException(GetArgumentName(argument), GetResourceString(resource));
Expand Down