It's not so much the effort of adding the function call, more that the 
problem (when it occurs) isn't particularly obvious. Hopefully this thread 
will come up in google searches to help the next person that comes across 
this issue :)

On Friday, 18 March 2016 17:03:52 UTC, Karl Tiedt wrote:
>
> I cant imagine adding code to prevent a native JS feature will happen... 
> and sometimes this effect *is* desired. Is adding a 1 line function that 
> much trouble? This is the first complaint I can remember about this. 
> However if you feel that strongly about it, I encourage you to file an 
> issue on the Polymer/Polymer <https://github.com/polymer/polymer/issues> 
> github repo
>
> -Karl Tiedt
>
> On Fri, Mar 18, 2016 at 9:56 AM, Rob Stone <[email protected] 
> <javascript:>> 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] <javascript:>.
>> 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/e4ffc62d-7495-43ca-a112-eff8249f6b76%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to