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

Event bug calling eventTarget.on after eventTarget.after with an array #1808

Open
solmsted opened this issue May 7, 2014 · 0 comments
Open

Comments

@solmsted
Copy link
Contributor

solmsted commented May 7, 2014

This bug can be reproduced by passing an array with a single event name to eventTarget.after and then passing the same event name to eventTarget.on: http://jsbin.com/luyubaca/2/edit?js,output

This happens because after passes its type to on: https://github.com/yui/yui3/blob/master/src/event-custom/js/event-target.js#L867

Then on passes it to _parseType https://github.com/yui/yui3/blob/master/src/event-custom/js/event-target.js#L220

and _parseType is wrapped with Y.cached: https://github.com/yui/yui3/blob/master/src/event-custom/js/event-target.js#L59

and Y.cached treats arguments as strings so ['eventName'] matches 'eventName': https://github.com/yui/yui3/blob/master/src/yui/js/yui-core.js#L45

jbalsas added a commit to jbalsas/liferay-portal that referenced this issue May 4, 2018
brianchandotcom pushed a commit to brianchandotcom/liferay-portal that referenced this issue May 4, 2018
brianchandotcom pushed a commit to liferay/liferay-portal that referenced this issue May 18, 2018
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

1 participant