Would it be feasible for polymer to auto-wrap array/object types in a function call? I can't imagine anyone wanting the existing behaviour - but if this was deemed to be necessary, then a new 'disableAutoWrap' option could be added to the type definition object?
On Friday, 18 March 2016 16:13:54 UTC, Karl Tiedt wrote: > > It is how Javascript has always worked... Arrays and Objects are by > reference, so in this situation, you have to return a new instance to get > that separation. > > In other libraries this was usually handled in the constructor with > this.varname = []; but in Polymer, if you want to handle it in the > properties definition (recommended way) requires the function call. > > -Karl Tiedt > > On Fri, Mar 18, 2016 at 9:00 AM, Rob Stone <[email protected] > <javascript:>> wrote: > >> Thinking about the mechanics of this, I can now see why it works this >> way. However, it is still a pretty nasty gotcha and it might be worth >> looking at that area of the documentation and making this issue a bit more >> obvious. >> >> Follow Polymer on Google+: plus.google.com/107187849809354688692 >> --- >> You received this message because you are subscribed to the Google Groups >> "Polymer" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/polymer-dev/08b6ea93-1fde-4d29-8271-71b5cf859343%40googlegroups.com >> >> <https://groups.google.com/d/msgid/polymer-dev/08b6ea93-1fde-4d29-8271-71b5cf859343%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > Follow Polymer on Google+: plus.google.com/107187849809354688692 --- You received this message because you are subscribed to the Google Groups "Polymer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/efa312f3-1cdc-4775-8efc-b3edec890adc%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
