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

Make Polymer gestures library safe for Closure property renaming. #5312

Closed
wants to merge 3 commits into from

Conversation

aomarks
Copy link
Member

@aomarks aomarks commented Aug 2, 2018

The issue here was that we were assuming that the method for a given gesture would always match the string name of that gesture, e.g. that if the gesture name was "mousedown" that we could call
gestureDefinition.mousedown. In actuality, gestureDefinition.mousedown could be renamed by Closure, which would throw with "undefined is not a function".

The fix is to move the GesturesRecognizer type into our externs, which prevents those methods from being renamed.

The issue here was that we were assuming that the method for a given
gesture would always match the string name of that gesture, e.g. that if
the gesture name was "mousedown" that we could call
gestureDefinition.mousedown. In actuality, gestureDefinition.mousedown
could be renamed by Closure, which would throw with "undefined is not a
function".

The fix is to move the GesturesRecognizer type into our externs, which
prevents those methods from being renamed.
@aomarks
Copy link
Member Author

aomarks commented Aug 2, 2018

Actually holding off for now, need to test something first.

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

Successfully merging this pull request may close these issues.

2 participants