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

Non-inlined lifecycle callbacks are mishandled #103

Open geoffromer opened 9 years ago

geoffromer commented 9 years ago
<polymer-element name='dummy'>
  <script>
    function detachedHelper() {}
    Polymer('dummy', {
        detached: detachedHelper,
    })
  </script>
</polymer-element>

When given the above input, Polyup handles detached as though it were a property, rather than a lifecycle callback:

<dom-module id="dummy">
  <script>
    function detachedHelper() {
    }
    Polymer({
      is: 'dummy',
      properties: {
        detached: {
          value: function () {
            return detachedHelper;
          }
        }
      }
    });
  </script>
</dom-module>

If I change the input to detached: function(){}, Polyup works as expected:

<dom-module id="dummy">
  <script>
    function detachedHelper() {
    }
    Polymer({
      is: 'dummy',
      detached: function () {
      }
    });
  </script>
</dom-module>