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

fire should only check for null and undefined. #646

Closed
mbullington opened this issue Jul 18, 2014 · 3 comments
Closed

fire should only check for null and undefined. #646

mbullington opened this issue Jul 18, 2014 · 3 comments
Assignees

Comments

@mbullington
Copy link

In the fire function, in file utils.js at line 153:

var detail = detail || {};

This restricts 0 or empty Strings from going through the fire function, when they are perfectly fine objects. So, fire should only check the detail variable for undefined or null, things that would cause a nasty error on the other side.

@sjmiles
Copy link
Contributor

sjmiles commented Jul 19, 2014

I made this commit (googlearchive/polymer-dev@43fe8b9) to prevent 0 from being squelched.

Normally, it would be good practice to have a test as well, but I'm making an exception because this is part of a larger issue.

Namely, this.fire has evolved two responsibilities (event sugaring and dom-based RPC), and I believe this method needs to be factored or at least revisited (in particular, why is detail not allowed to be null? the reason may be vestigial).

I'm going to leave this ticket open until I can link it to a more specific ticket for the larger question.

@mbullington
Copy link
Author

Thanks!

@sjmiles
Copy link
Contributor

sjmiles commented Aug 18, 2014

@sjmiles sjmiles closed this as completed Aug 18, 2014
nevir pushed a commit to nevir/polymer that referenced this issue Oct 31, 2014
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

2 participants