bytedance / sonic

A blazingly fast JSON serializing & deserializing library
Apache License 2.0
6.71k stars 333 forks source link

fix: didn't pass non-exist value when call `Node.Interface()` #544

Closed AsterDY closed 10 months ago

AsterDY commented 10 months ago

Issue

After Unset() some nodes for its parent, call parent.Interface() will return errors like unsupported type

Reason

That's because since # , sonic/ast didn't delete node memory after Unset() meanwhile Interface() logic counted the actually non-exist node

codecov-commenter commented 10 months ago

Codecov Report

Merging #544 (62d514d) into main (de254c3) will not change coverage. The diff coverage is 100.00%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

@@           Coverage Diff           @@
##             main     #544   +/-   ##
=======================================
  Coverage   78.30%   78.30%           
=======================================
  Files          69       69           
  Lines       10686    10686           
=======================================
  Hits         8368     8368           
  Misses       1955     1955           
  Partials      363      363           
Files Coverage Δ
ast/iterator.go 70.11% <100.00%> (+1.44%) :arrow_up:
ast/node.go 82.80% <100.00%> (-0.08%) :arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more