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

[lint pass request] listening on a nonexistent or not yet stamped element #991

Closed
web-padawan opened this issue Dec 13, 2016 · 5 comments
Closed

Comments

@web-padawan
Copy link
Contributor

It would be nice to have a check for using id of element which is located inside of the dom-if template in listeners object. As of 1.7.0, this causes errors like this:

polymer.html:540 Uncaught TypeError: Invalid value used as weak map key
@rictic
Copy link
Contributor

rictic commented Feb 10, 2017

I see, so with an element whose template is like:

<template>
  <template is="dom-if" if="whatever">
    <div id="foo"></div>
  </template>
</template>

And it's declared like:

Polymer({
  is: 'example-elem',
  listeners: {
    'foo.tap': 'onFooTapped',
  },
  onFooTapped() { /* ... */ }
});

This doesn't work because the div doesn't exist when the element is first stamped.

@rictic rictic changed the title Feature request: misuse of 1.0 listeners syntax Feature request: listening on a nonexistant or not yet stamped element Feb 10, 2017
@rictic rictic changed the title Feature request: listening on a nonexistant or not yet stamped element Rule request: listening on a nonexistant or not yet stamped element Feb 10, 2017
@rictic rictic changed the title Rule request: listening on a nonexistant or not yet stamped element Rule request: listening on a nonexistent or not yet stamped element Feb 10, 2017
@rictic rictic changed the title Rule request: listening on a nonexistent or not yet stamped element [lint pass request] listening on a nonexistent or not yet stamped element Feb 10, 2017
@web-padawan
Copy link
Contributor Author

Another example could be this.$.elementId calls check (linter should throw error if element does not have a child which such id in its template). Had a typo like this today 😢

@davidmaxwaterman
Copy link

...and I would imagine it might be an easy task to add a check for properties/methods on such - eg this.$.elementId.open() - check there's a method open() on the element.

@aomarks aomarks transferred this issue from Polymer/polymer-linter Jan 3, 2019
@stale
Copy link

stale bot commented Mar 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 4, 2020
@web-padawan
Copy link
Contributor Author

So much notifications for "nice to have" issues that have never been implemented. Sigh.

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

No branches or pull requests

4 participants