Always reset ValueSpan and ValueSequence whenever the other is set. (dotnet/corefx...
authorAhson Khan <ahkha@microsoft.com>
Sat, 19 Jan 2019 14:38:38 +0000 (06:38 -0800)
committerGitHub <noreply@github.com>
Sat, 19 Jan 2019 14:38:38 +0000 (06:38 -0800)
commitd1ebbcfce3627cb1ab79176ebf2ef789d4a02132
treeced48769000947ae084a6611fafa26b567ec0639
parent7e6f6d0f0e5e2f25755749ce6aca3b5e01551666
Always reset ValueSpan and ValueSequence whenever the other is set. (dotnet/corefx#34667)

* Always reset ValueSpan and ValueSequence whenever the other is set.

* Fix bug in GetNextSpan so current position remains at non-empty segment.

* Add valuespan and valuesequence checks in more places.

* Always set value properties to default at the start of Read

* Assert span == default instead of IsEmpty

Commit migrated from https://github.com/dotnet/corefx/commit/a45eb78f3d115cd545ef285129e11ddc2da3cad1
src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.MultiSegment.cs
src/libraries/System.Text.Json/src/System/Text/Json/Reader/Utf8JsonReader.cs
src/libraries/System.Text.Json/tests/JsonTestHelper.cs
src/libraries/System.Text.Json/tests/Utf8JsonReaderTests.MultiSegment.cs
src/libraries/System.Text.Json/tests/Utf8JsonReaderTests.cs