mikesmullin / amf-js

Automatic Message Format (AMF0 + AMF3-compatible) Javascript Library
MIT License
3 stars 3 forks source link

Fixes for objectReferences ordering issues #2

Closed mastef closed 6 years ago

mastef commented 6 years ago

In some instances the wrong objectReferences were picked. That happened because vectors and arrays first added their children to the objectReferences array, and then themselves. This way if an array was e.g. : [[1,1], [2,2], [3,3], [4,4], [1,1]]; it would end up as : [[1,1], [2,2], [3,3], [4,4], [3,3]]; ( last entry picked a wrong reference ).

Pulling up the objectReferences.push before the arrays and vectors are looped fixes that.

mikesmullin commented 6 years ago

Thanks @mastef! 🤗