There's really no way to do that. Critically, there's no way to fully clone an object. On Mar 18, 2016 9:57 AM, "Rob Stone" <[email protected]> wrote:
> 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]> 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]. >>> 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 > <https://groups.google.com/d/msgid/polymer-dev/efa312f3-1cdc-4775-8efc-b3edec890adc%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/CAEKsHmCftjMBdEy4D2Px5D-gV6X1JmhFNqxTTiSTS2CadeCMww%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
