Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 0 additions & 9 deletions src/libraries/System.Text.Json/src/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@
<data name="ArrayDepthTooLarge" xml:space="preserve">
<value>The maximum configured depth of {0} has been exceeded. Cannot read next JSON array.</value>
</data>
<data name="CallFlushToAvoidDataLoss" xml:space="preserve">
<value>The JSON writer needs to be flushed before getting the current state. There are {0} bytes that have not been committed to the output.</value>
</data>
<data name="CannotReadIncompleteUTF16" xml:space="preserve">
<value>Cannot read incomplete UTF-16 JSON text as string with missing low surrogate.</value>
</data>
Expand Down Expand Up @@ -620,12 +617,6 @@
<data name="CollectionIsReadOnly" xml:space="preserve">
<value>Collection is read-only.</value>
</data>
<data name="ArrayIndexNegative" xml:space="preserve">
<value>Number was less than 0.</value>
</data>
<data name="ArrayTooSmall" xml:space="preserve">
<value>Destination array was not long enough.</value>
</data>
<data name="NodeJsonObjectCustomConverterNotAllowedOnExtensionProperty" xml:space="preserve">
<value>A custom converter for JsonObject is not allowed on an extension property.</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ static int AmountToWrite(ReadOnlySpan<byte> span, long bytePositionInLine, ReadO
_totalConsumed = prevTotalConsumed;
consumed = default;
_currentPosition = copy;
throw GetInvalidLiteralMultiSegment(readSoFar.Slice(0, written).ToArray());
throw GetInvalidLiteralMultiSegment(readSoFar.Slice(0, written));
}

private static int FindMismatch(ReadOnlySpan<byte> span, ReadOnlySpan<byte> literal)
Expand All @@ -654,7 +654,7 @@ private static int FindMismatch(ReadOnlySpan<byte> span, ReadOnlySpan<byte> lite
return indexOfFirstMismatch;
}

private JsonException GetInvalidLiteralMultiSegment(ReadOnlySpan<byte> span)
private JsonException GetInvalidLiteralMultiSegment(scoped ReadOnlySpan<byte> span)
{
byte firstByte = span[0];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,9 @@ private bool CheckLiteral(ReadOnlySpan<byte> span, ReadOnlySpan<byte> literal)
return false;
}

private void ThrowInvalidLiteral(ReadOnlySpan<byte> span)
private void ThrowInvalidLiteral(ReadOnlySpan<byte> span) => throw GetInvalidLiteral(span);

private JsonException GetInvalidLiteral(ReadOnlySpan<byte> span)
{
byte firstByte = span[0];

Expand All @@ -1199,7 +1201,7 @@ private void ThrowInvalidLiteral(ReadOnlySpan<byte> span)
resource = ExceptionResource.ExpectedNull;
break;
}
ThrowHelper.ThrowJsonReaderException(ref this, resource, bytes: span);
return ThrowHelper.GetJsonReaderException(ref this, resource, nextByte: default, bytes: span);
}

private bool ConsumeNumber()
Expand Down
Loading
Loading