eredo / dartson

Dartson is a Dart library that can be used to convert Dart objects into a JSON string.
MIT License
79 stars 29 forks source link

Check for Simple objects #32

Closed rightisleft closed 6 years ago

rightisleft commented 8 years ago

Looks like double wasn't added to the list - this enables the 'parser simple' to pass using doubles.

Also check for simply types instead of doing recursive lookups on all objects. This will prevent going down the tree to infinity for boxed objects.

eredo commented 8 years ago

I did a merge. However I'm currently seeing some issues with running the tests in compiled mode. Not quiet sure if it's 1.13-dev related or something I just haven't checked so far. I'll do some more investigation and then complete the merge.

rightisleft commented 8 years ago

Hi - looking are core_transformers.dart i see your point. I think i initially tried to modify the _convert* functionality.

However, i was able to block the infinite loop by checking _isSimpleType inside the serialize* functions. I also added int and double to _isSimpleType.

rightisleft commented 8 years ago

If you look at the output in https://github.com/eredo/dartson/issues/27 - you can see that the serialize function is trying to parse all of the helper methods for the numeric classes, isFinite, isNan, etc. etc

eredo commented 6 years ago

Closed due to 1.0.0-alpha