Skip to content

Improve stdlib compatibility #172

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

Merged
merged 1 commit into from
Sep 17, 2017

Conversation

olegshaldybin
Copy link
Contributor

  1. Null values for primitive types no longer clear the original value in
    the destination object.

  2. Dereference multiple levels of pointers in the destination interface{}
    type before unmarshaling into it. This is needed to match stdlib
    behavior when working with nested interface{} fields. If the destination
    object is a pointer to interface{} then the incoming nil value should
    nil out the destination object but keep the reference to that nil value
    on its parent object. However if the destination object is an
    interface{} value it should set the reference to nil but keep the
    original object intact.

  3. Correctly handle typed nil decode destinations.

@codecov
Copy link

codecov bot commented Sep 16, 2017

Codecov Report

Merging #172 into master will decrease coverage by 0.08%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #172      +/-   ##
==========================================
- Coverage   84.89%   84.81%   -0.09%     
==========================================
  Files          41       41              
  Lines        5205     5196       -9     
==========================================
- Hits         4419     4407      -12     
- Misses        623      625       +2     
- Partials      163      164       +1
Impacted Files Coverage Δ
feature_reflect_native.go 66.93% <100%> (-0.78%) ⬇️
feature_iter_object.go 67.12% <0%> (-3.43%) ⬇️
feature_iter_string.go 88.81% <0%> (-0.7%) ⬇️
feature_iter_skip.go 78.31% <0%> (+3.61%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c463aa1...9f6e596. Read the comment docs.

@taowen
Copy link
Contributor

taowen commented Sep 16, 2017

please fix the conflict

1. Null values for primitive types no longer clear the original value in
the destination object.

2. Dereference multiple levels of pointers in the destination interface{}
type before unmarshaling into it. This is needed to match stdlib
behavior when working with nested interface{} fields. If the destination
object is a pointer to interface{} then the incoming nil value should
nil out the destination object but keep the reference to that nil value
on its parent object. However if the destination object is an
interface{} value it should set the reference to nil but keep the
original object intact.

3. Correctly handle typed nil decode destinations.
@olegshaldybin
Copy link
Contributor Author

@taowen Done

@taowen taowen merged commit 3c298d8 into json-iterator:master Sep 17, 2017
zhenzou pushed a commit to zhenzou/jsoniter that referenced this pull request Feb 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants