googlearchive / polyup

A helpful assistant for migrating from Polymer v0.5 to 1.0. Does many of the boring mechanical parts for you.
http://polymerlabs.github.io/polyup/
BSD 3-Clause "New" or "Revised" License
38 stars 9 forks source link

Computed attributes being incorrectly generated #81

Open rictic opened 9 years ago

rictic commented 9 years ago

Vague bug, but I encountered an issue where it seemed like a computed function was written to the wrong attribute on an element with multiple bound attributes (perhaps because of attrName?='x' syntax?).

Need to track this down further.

ktiedt commented 9 years ago

I just came to open a similar bug I can provide a bit of context from my case here: (0.5)

      <section hidden?="{{section!='main'}}" id="main">
...
      </section>
      <section hidden?="{{section!='help'}}" id="help">
...
      </section>
      <section hidden?="{{section!='about'}}" id="about">
...
      </section>
      <section hidden?="{{section!='tmpl'}}" id="tmpl">
...
      </section>
      <section hidden?="{{section!='pm'}}" id="pm">
...
      </section>

was converted to: (1.0)

      <section id="{{computeHidden(section)}}" hidden$="{{computeHidden(section)}}">
...
      </section>
      <section id="{{computeHidden3(section)}}" hidden$="{{computeHidden(section)}}">
...
      </section>
      <section id="{{computeHidden4(section)}}" hidden$="{{computeHidden(section)}}">
...
      </section>
      <section id="{{computeHidden5(section)}}" hidden$="{{computeHidden(section)}}">
...
      </section>
      <section id="{{computeHidden6(section)}}" hidden$="{{computeHidden(section)}}">
...
      </section>

Where the methods it generated are: (1.0)

  computeHidden: function (section) {
    return section != 'main';
  },
  computeHidden3: function (section) {
    return section != 'help';
  },
  computeHidden4: function (section) {
    return section != 'about';
  },
  computeHidden5: function (section) {
    return section != 'tmpl';
  },
  computeHidden6: function (section) {
    return section != 'pm';
  },