Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

noscript breaks inheritance #740

Closed
mbykovskyy opened this issue Sep 2, 2014 · 3 comments
Closed

noscript breaks inheritance #740

mbykovskyy opened this issue Sep 2, 2014 · 3 comments
Assignees

Comments

@mbykovskyy
Copy link

When two types extend the same super type they should no affect each other. However, in the following example i-break-inheritance appears to wipe out the prototype of su-per from should-work.

<polymer-element name="su-per">
  <script>
    Polymer({
      foo: function() {
        console.log('foo');
      }
    });
  </script>
</polymer-element>

<polymer-element name="should-work" extends="su-per">
  <script>
    Polymer({
      bar: function() {
        console.log('bar');
      }
    });
  </script>
</polymer-element>

<polymer-element name="i-break-inheritance" extends="su-per" noscript>
</polymer-element>

<polymer-element name="some-app">
  <template>
    <su-per id="su_per"></su-per>
    <should-work id="should_work"></should-work>
  </template>
  <script>
    Polymer({
      ready: function() {
        // This works.
        this.$.su_per.foo();

        // This is broken. foo is undefined.
        this.$.should_work.foo();
      }
    });
  </script>
</polymer-element>
@ebidel
Copy link
Contributor

ebidel commented Sep 2, 2014

http://jsbin.com/warifucaparu/1/edit doesn't produce errors for me. I see "foo" logged twice.

screen shot 2014-09-02 at 2 53 04 pm

@mbykovskyy
Copy link
Author

Ok, this is interesting. The cause was not what I was expecting. I just replaced my index file with your example and I was still getting the weird behaviour. I then realised that I was running it after it went through the vulcanize process which is part of my build. However, it worked well if I didn't vulcanize it.

Anyway, I had a 0.3.1 version of vulcanize. I updated it to the latest version and it works now. I'm gonna close the issue, sorry about that.

@ebidel
Copy link
Contributor

ebidel commented Sep 3, 2014

Glad to hear you worked it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants