Collections add/set exposes raw target
Version
3.0.2
Reproduction link
https://jsfiddle.net/v9k3jmog/
Steps to reproduce
Call Set::add or Map::set.
Those methods are specified to return the collection itself, so they can be chained: set.add(1).add(2).add(3)
.
What is expected?
Those methods should return the reactive collection so that set.add(1) === set
is true and reactivity works when chaining.
What is actually happening?
Those methods return the raw collection, breaking the collections contracts and breaking reactivity.
I pointed a few other things that are less clear-cut bugs but probably not desirable behaviors (e.g. observable differences between reactive and non-reactive collections behaviors) here: https://github.com/vuejs/vue-next/commit/50adc014f59a7f385c836014abb059ec72c52239