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

1.fixed error when reflecting an indexed property(ignore it). 2.continue... #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
8 changes: 6 additions & 2 deletions fastJSON/JsonSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,12 @@ private void WriteObject(object obj)
_TypesWritten = true;
_current_depth++;
if (_current_depth > _MAX_DEPTH)
throw new Exception("Serializer encountered maximum depth of " + _MAX_DEPTH);

{
//throw new Exception("Serializer encountered maximum depth of " + _MAX_DEPTH);
_output.Append('}');
_current_depth--;
return;
}

Dictionary<string, string> map = new Dictionary<string, string>();
Type t = obj.GetType();
Expand Down
4 changes: 4 additions & 0 deletions fastJSON/Reflection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,10 @@ internal Getters[] GetGetters(Type type, JSONParameters param)
List<Getters> getters = new List<Getters>();
foreach (PropertyInfo p in props)
{
if (p.GetIndexParameters().Length > 0)
{// Property is an indexer
continue;
}
if (!p.CanWrite && param.ShowReadOnlyProperties == false) continue;
if (param.IgnoreAttributes != null)
{
Expand Down